-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add k8sallowedreposv2 Policy with Exact Match & Glob Support #616
Conversation
Signed-off-by: yakirk <[email protected]>
Signed-off-by: yakirk <[email protected]>
Hey @maxsmythe @JaydipGabani @ritazh and @sozercan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@yakirk we are updating our library to include CEL logic as well. Are you interested in adding CEL engine code for this policy? Here is a sample policy that is a good starting point - https://open-policy-agent.github.io/gatekeeper-library/website/validation/requiredlabels. |
@JaydipGabani , thanks for the suggestion! I'm not familiar with CEL syntax yet, so I'd prefer merging the current policy for now. I may revisit adding a CEL policy later. |
@yakirk Sounds good, we need approval from one more maintainer to merge. @ritazh @maxsmythe PTAL |
Hey @JaydipGabani @maxsmythe @ritazh, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for putting up with all the feedback! Apologies for the slow response over the holidays.
Signed-off-by: Yakir Kadkoda <[email protected]>
Update allowedrepos version to 1.0.2 Signed-off-by: yakirk <[email protected]>
Update allowedrepos version to 1.0.2
Signed-off-by: Yakir Kadkoda <[email protected]>
fix: Correct pod name in example_allowed_images
Signed-off-by: Yakir Kadkoda <[email protected]>
Signed-off-by: Yakir Kadkoda <[email protected]>
Signed-off-by: Yakir Kadkoda <[email protected]>
Fix: Update and Correct samples and suite.yaml
This PR introduces a new k8sallowedreposv2 policy that improves the current k8sallowedrepos rule by adding support for exact matches and glob-like patterns. This makes it easier to create more precise and flexible rules for allowed container images.
What’s New?
New Policy - k8sallowedreposv2:Supports exact image names and glob-like syntax for better control.
Provides an alternative to the current prefix-only approach of k8sallowedrepos .
Documentation Update: Improved the k8sallowedrepos documentation to highlight the importance of adding a "/" when specifying DockerHub repositories, custom registries, and more.
This ensures users avoid potential bypasses, like allowing malicious registries or repositories with similar prefixes.
This change addresses security concerns discussed previously: #538 and #529
And provides a clearer, more secure way to define allowed container images.