Add calico GlobalNetworkPolicy to block traffic to 168.63.129.16#1682
Add calico GlobalNetworkPolicy to block traffic to 168.63.129.16#1682CecileRobertMichon wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/cc @devigned |
|
/retest |
|
What do you think about calling out the CVE in release notes? |
|
/retest |
1 similar comment
|
/retest |
|
@devigned the network policy e2e test is failing, it seems the problem is that we're applying a k8s network policy in one namespace to block egress and that is being overridden by our global allow calico policy. I'm trying to find documentation about the official order of precedence when both a calico net pol and a k8s net pol apply but couldn't find anything explicit. Any ideas on how we can get around this? |
The https://docs.projectcalico.org/reference/resources/globalnetworkpolicy |
@nader-ziada this is only for Calico network policies. The k8s Network Policies (not the CRD, the native type) don't have an order and it's unclear how they are applied when there are also Calico Network Policies https://docs.projectcalico.org/security/calico-network-policy ( |
found this here: https://stackoverflow.com/questions/67006051/project-calico-priority-between-global-policy-and-network-policy |
|
@nader-ziada great find 🤯 |
f8a30cf to
d9cb43a
Compare
|
trying with order 9999 so k8s native policies always take precedence |
|
looks like it didn't work :( |
|
that one looks like a different error though... progress? I'll dig in shortly |
|
/retest just in case |
|
/retest provisioning error |
|
so the issue is that NetworkPolicies (the k8s native ones) don't have a concept of "explicit deny" (this blog has a nice diagram to visualize if anyone is interested). It's either default allow (no policies on the pod), default-deny (at least one policy on the pod), or explicit allow. So by doing an explicit allow on all the pods with Calico, there is no way to do an explicit deny on top of it for some pods, via k8s network policy.. With Calico you can do: which does what we want. Options to move forward:
@nader-ziada @devigned what do you think? |
|
I think option 1; |
|
@CecileRobertMichon: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/close |
|
@CecileRobertMichon: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
What this PR does / why we need it: This PR explicitly ensures that TCP traffic bound for the reserved Azure IP 168.63.129.16 is blocked from containers to remediate https://msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2021-27075.
This is done in addition to kubernetes-sigs/image-builder#690.
Future work: determine if and how to do this for other CNI specs in the repo, IPv6 Calico, and Windows Flannel.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
TODOs:
Release note: