agent-substrate / agent-substrate/substrate

EgressRules has situations where strict ordering is a problem

Abierto
#1,585 3 comentarios 1 reacción 0 asignados Ver en GitHub
area/api area/network kind/design
Lenguaje dominante
Go
Estrellas
1.8k
Forks
316
Merge medio
2 d 43 min
PR fusionados (30 d)
287

Descripción

### Problem

Mixing of ip\_block and hostname-based rules based on ordering forces the implementation to handle all of the evaluation in a single place, but this might not be possible/efficient: commonly IPs are known and evaluated at lower layers vs hostname, which is an L7 (e.g. HTTP) property.

Imagine we have an egress policy:

```
"egress_policy": {
"metadata": {"atespace": "default", "name": "default"},
"rules": [
{ # a range covering api.github.com
"ip_blocks": { "cidrs": ["140.82.112.0/20"] }
},
{
"hostnames": {
"patterns": ["api.github.com"],
"effects": { ... }
}
]
}
```

Currently, the rule evaluation order is:
```
// Rules are evaluated in order. The first matching rule authorizes the
// request, only that rule's effects are applied, and evaluation stops even if
// later rules would also match. A request is denied when no rule matches.
//
// +k8s:optional
// +k8s:maxItems=256
// +k8s:listType=atomic # rule order matters
repeated EgressRule rules = 2;
```

This suggests that the `hostname` rule will not be evaluated.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.