OCPSTRAT-3578: Add NetworkPolicy manifests for openshift-cluster-samples-operator namespace - #703
OCPSTRAT-3578: Add NetworkPolicy manifests for openshift-cluster-samples-operator namespace#703aroyoredhat wants to merge 3 commits into
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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe manifest adds default-deny ingress and egress rules for the operator namespace. It allows DNS egress, unrestricted operator egress, and Prometheus metrics ingress. ChangesNamespace network controls
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 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. |
- Rename allow-egress-to-api-server to allow-operator-egress to accurately reflect that the policy is unrestricted egress (not limited to the API server alone) - Scope metrics ingress to only openshift-monitoring namespace instead of allowing from anywhere Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@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 policiesSummary by CodeRabbit