agent-substrate / agent-substrate/substrate

EgressRules has situations where strict ordering is a problem

Đang mở
#1,585 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
area/api area/network kind/design
Ngôn ngữ chính
Go
Star
1.8k
Fork
316
Merge trung bình
2 ngày 43 phút
Pull request đã merge (30 ngày)
287

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.