OCPSTRAT-3578: Add NetworkPolicy manifests for openshift-cluster-samples-operator namespace - #703
Conversation
…mespace Implements tailored network policies per HPSTRAT-104/HPSTRAT-766 to restrict ingress and egress traffic to only necessary communication, satisfying CIS Kube benchmark 5.3.2 for this namespace. Policies added: - default-deny: namespace-wide deny-all for ingress and egress - allow-to-dns: egress to openshift-dns on port 5353 (TCP+UDP) - allow-egress-to-api-server: unrestricted egress for operator pods (API server is host-networked, cannot be targeted by NetworkPolicy) - allow-ingress-to-metrics: TCP port 60000 for Prometheus scraping Co-authored-by: Cursor <cursoragent@cursor.com>
|
@aroyoredhat: This pull request references HPSTRAT-766 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature to target the "5.0.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThe manifest adds default-deny ingress and egress rules for the operator namespace. It then permits DNS resolution, operator access to the Kubernetes API server, and Prometheus access to the operator metrics endpoint. ChangesOperator namespace network controls
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aroyoredhat 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 |
|
@aroyoredhat: This pull request references OCPSTRAT-3578 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the feature to target the "5.0.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@aroyoredhat: This pull request references OCPSTRAT-3578 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@aroyoredhat: all tests passed! 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
Implements tailored NetworkPolicy resources for the
openshift-cluster-samples-operatornamespace per HPSTRAT-104 / OCPSTRAT-3578.This satisfies:
Policies added
default-denypodSelector: {})allow-to-dnsopenshift-dnson port 5353 (TCP + UDP)allow-egress-to-api-serverallow-ingress-to-metricsNotes
capability.openshift.io/name: openshift-samplesand release inclusion annotationsTest plan
oc get networkpolicy -n openshift-cluster-samples-operatorshows all four policies