Skip to content
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

Validatingwebhookconfiguration scope: * can cause cluster instability. #3249

Closed
BenCoughlan15 opened this issue Feb 1, 2024 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@BenCoughlan15
Copy link

BenCoughlan15 commented Feb 1, 2024

Summary

the validating webhook configuration and mutating webhook configuration by default, are scoped to "cluster", the value isn't set in the templates, or configurable.

They should be scoped to Namespaced by default, with the option to set the value to cluster.

Details

Google doc advising not to use webhooks on the cluster level

specifically:

Ensure that you set scope to Namespaced, not *, so that the webhook only operates in specific namespaces. Also ensure that if the operator is NotIn, you include kube-system and kube-node-lease in values (in this example, with blue-system).

PoC

https://github.com/open-policy-agent/gatekeeper/blob/master/charts/gatekeeper/templates/gatekeeper-mutating-webhook-configuration-mutatingwebhookconfiguration.yaml#L48-L64

set default value of scope: Namespaced

https://github.com/open-policy-agent/gatekeeper/blob/master/charts/gatekeeper/templates/gatekeeper-validating-webhook-configuration-validatingwebhookconfiguration.yaml#L101-L113

set default value of scope: Namespaced

Or allow this value to be set, i.e: like in https://github.com/open-policy-agent/gatekeeper/blob/master/charts/gatekeeper/templates/gatekeeper-mutating-webhook-configuration-mutatingwebhookconfiguration.yaml#L48-L64

Impact

What kind of vulnerability is it? Who is impacted?

@BenCoughlan15 BenCoughlan15 added the bug Something isn't working label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant