policy: Enable ingress CIDR-dependent L3 policy (FromCIDR + ToPorts)#12482
Conversation
|
test-me-please |
joestringer
left a comment
There was a problem hiding this comment.
Nice work, just few minor nits.
26d0956 to
84b7a97
Compare
|
test-me-please |
|
CI failures look legit; seems like these tests can be flakey. Looking into making them more deterministic. |
84b7a97 to
2b51192
Compare
|
Reworked some of the tests a bit to make them more deterministic. The main changes from the original code are:
|
a4bccbb to
af4e675
Compare
|
test-me-please |
pchaigno
left a comment
There was a problem hiding this comment.
A few nits and questions below. LGTM overall!
It looks like implementing the same test for the host firewall is going to be fairly easy now 🎉 Thanks!
|
Marking this for backport because I think we will need it at least in 1.8, at least for the host firewall. |
af4e675 to
6a1f685
Compare
|
test-me-please |
6a1f685 to
174fa10
Compare
38951c0 to
7094430
Compare
This allows policies such as FromCIDR + ToPorts on ingress. Signed-off-by: Chris Tarazi <chris@isovalent.com>
This is useful for monitoring specific endpoints. Signed-off-by: Chris Tarazi <chris@isovalent.com>
Signed-off-by: Chris Tarazi <chris@isovalent.com>
Signed-off-by: Chris Tarazi <chris@isovalent.com>
This helper is useful for situations where you'd want to preserve the
previous Cilium configuration when redeploying. This helper abstracts
away the need to manually create a copy of the new merged configuration
before calling RedeployCilium.
Example usage:
```
daemonCfg := map[string]string{ ... }
(...)
RedeployCiliumWithMerge(..., daemonCfg, map[string]string{
"flag-previously-set-in-daemonCfg": "1",
"new-flag-also": "abc",
})
```
Signed-off-by: Chris Tarazi <chris@isovalent.com>
This test validates that the new ingress FromCIDR+ToPorts policy (CIDR-dependent L4) allows ingress traffic from an allowed IP address range, to specific ports. The setup of this test requires a third node (k8s3) which doesn't have Cilium installed on it by making use of the NO_CILIUM_ON_NODE environment variable of the test suite. The test validates the policy by checking that ingress traffic is: 1) Allowed before any policies 2) Disallowed by applying a default deny ingress policy 3) Allowed again after applying "cnp-ingress-from-cidr-to-ports" Signed-off-by: Chris Tarazi <chris@isovalent.com>
7094430 to
45ed873
Compare
|
test-me-please |
|
I've been providing the feedback for @cilium/api and Paul (as well as me to a secondary degree) have been reviewing on behalf of @cilium/ci so all codeowners should be covered. Tests are passing, reviews are in. Merging. |
This comes as a follow up to cilium#12482. Signed-off-by: Chris Tarazi <chris@isovalent.com>
This comes as a follow up to #12482. Signed-off-by: Chris Tarazi <chris@isovalent.com>
See commit msgs.
Updates: #4129
Note to backporters: If there are conflicts with the tests, then test coverage commits do not need to be backported; only enabling the policy.