-
Notifications
You must be signed in to change notification settings - Fork 764
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
Resource violates rule but is created #3216
Comments
Kubernetes webhooks cannot evaluate ValidatingWebhookConfiguration/MutatingWebhookConfiguration objects. ValidatingAdmissionPolicy might be able to, but there is a similar problem there (VAP objects cannot validate other VAP objects). Violations should show up in audit. K8s doc source: see the docstring for the |
Thanks @maxsmythe , I had suspected that but didn't know where to look. That answers my question, but should this issue then be considered a bug for |
I have a similar issue which the policy is being flagged but Gatekeeper lets the resource to be created. #3228 |
Gatekeeper the webhook cannot/should not validate these resources. Gatekeeper audit and the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
What steps did you take and what happened:
[A clear and concise description of what the bug is.]
I have created a rule to block webhook configurations that do not have namespace selectors, unless exempt.
Constraint
Template
This test resource is still able to be created:
Test Resource
What did you expect to happen:
I expected the test resource to be denied. It is denied when testing locally with
gator
:Gator
The resource also shows in the Constraint as a violation:
Violation
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
It seems that the creation event is never evaluated by Gatekeeper. We have several other rules that are correctly being enforced, so I assume it is not a general problem with our Gatekeeper deployment.
Gatekeeper is deployed using the Helm chart and is minimally altered. The rules for the validation webhook are default:
Webhook rules
It's entirely possible (or likely) that this is not a bug and I've missed something, but at this point I'm out of ideas.
Environment:
kubectl version
):The text was updated successfully, but these errors were encountered: