ROX-33673: Add missing OOTB egress network policy#19522
Closed
AlexVulaj wants to merge 1 commit intostackrox:masterfrom
Closed
ROX-33673: Add missing OOTB egress network policy#19522AlexVulaj wants to merge 1 commit intostackrox:masterfrom
AlexVulaj wants to merge 1 commit intostackrox:masterfrom
Conversation
Contributor
Author
|
Closing fork PR to recreate from upstream branch for CI access to secrets |
Contributor
Author
|
Closed in favor of #19524 , which is from the upstream repo instead of my fork. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a missing OOTB policy to detect deployments that lack egress network policies. While StackRox added network policy detection capabilities and shipped the "Deployments should have at least one ingress Network Policy" policy (ID:
38bf79e7-48bf-4ab1-b72f-38e8ad8b4ec3) several versions ago, the corresponding egress policy was never created despite the underlying field support existing in the codebase.The new policy "Deployments should have at least one egress Network Policy" (ID:
dae95df3-ce8e-435c-8e16-c5197943db6e) mirrors the structure and behavior of its ingress counterpart. It alerts when deployments are missing egress network policies, helping enforce zero-trust networking principles by identifying workloads with unrestricted outbound network access that could potentially exfiltrate data or communicate with untrusted endpoints.Related JIRA: https://redhat.atlassian.net/browse/ROX-33673
User-facing documentation
CHANGELOG entry added. User documentation update may be needed to document the new policy alongside the existing ingress policy documentation.
Testing and quality
flag
Automated testing
Updated test data in
sensor/tests/resource/networkpolicy/data/policies.jsonto include the new egress policy. The underlying "Has Egress Network Policy" field already has existing test coverage inpkg/booleanpolicy/network_criteria_test.go. Policy loading is validated by existing tests inpkg/defaults/policies/policies_test.gowhich verify MITRE exception list consistency and policy structure.How I validated my change
pkg/booleanpolicy/augmentedobjs/custom_types.goandpkg/booleanpolicy/fieldnames/list.go