WIP: OCPNODE-4123: Add NetworkPolicy manifests for DAS operator#999
WIP: OCPNODE-4123: Add NetworkPolicy manifests for DAS operator#999harche wants to merge 2 commits intoopenshift:nextfrom
Conversation
Add default-deny and allow NetworkPolicy resources to the das-operator namespace to restrict ingress and egress traffic per OCPSTRAT-2061 requirements. This addresses CIS Kubernetes Benchmark 5.3.2 and Red Hat ProdSec guidance for control plane hardening. Network policies added: - 99-deny-all: Default deny all ingress and egress - 10-allow-egress-api: Allow egress to kube-apiserver (port 6443) - 10-allow-egress-cluster-dns: Allow egress to openshift-dns - 10-allow-ingress-webhook: Allow ingress to webhook (port 8443) The operator reconciles these policies as part of its sync loop, following the same pattern used by kueue-operator. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: harche The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add e2e tests that verify: - All 4 expected NetworkPolicy resources are created in the das-operator namespace after operator deployment - The operator reconciles deleted NetworkPolicies (delete one, verify it gets recreated) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/test e2e-bundle-runc |
|
@harche: The following test failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
Summary
das-operatornamespace per OCPSTRAT-2061 / OCPSTRAT-819 requirementsChanges
New network policy manifests (
bindata/assets/instaslice-operator/networkpolicy/):99-deny-all.yaml— Default deny all ingress and egress for all pods in the namespace10-allow-egress-api.yaml— Allow all DAS pods egress to kube-apiserver on port 644310-allow-egress-cluster-dns.yaml— Allow all DAS pods egress to openshift-dns for name resolution10-allow-ingress-webhook.yaml— Allow ingress to webhook pods on port 8443 (admission webhook calls)New helper (
pkg/util/resourceapply/networking.go):ReadNetworkPolicyV1OrDie()andApplyNetworkPolicy()— ported from kueue-operator since library-go doesn't have NetworkPolicy apply support yetModified reconciler (
pkg/operator/target_config_reconciler.go):manageNetworkPolicies()function called duringsync()Modified bindata (
bindata/assets.go):AssetDir()function to iterate over files in a directoryJira
Test plan
🤖 Generated with Claude Code