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

[BUG] error from server(forbidden): admission webhook "validation.gatekeeper.sh" denied the request: [denied by pod-allowed-capabilities] [azurepolicy-k8azurev2nonprivilege-19124c6401684452c142] privilege container not allowed: copy-azurekeyvault-env #817

Open
cramakan opened this issue Mar 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@cramakan
Copy link

cramakan commented Mar 11, 2025

Note: Make sure to check out known issues (https://akv2k8s.io/troubleshooting/known-issues/) before submitting

Components and versions
Select which component(s) the bug relates to with [X].

[ ] Controller, version: 1.7.3 (docker image tag)
[ ] Env-Injector (webhook), version: 1.7.3 (docker image tag)
[ ] Other

Describe the bug
A clear and concise description of what the bug is.
Getting error as denied by privilege container not allowed

error from server(forbidden): admission webhook "validation.gatekeeper.sh" denied the request: [denied by pod-allowed-capabilities] [azurepolicy-k8azurev2nonprivilege-19124c6401684452c142] privilege container not allowed: copy-azurekeyvault-env, securityContext { "capabilities" : {"drop" } : [ "ALL" ]}, "privilege" : "true", "readOnlyRootFileSystem" : "true" , "runasNonRoot" : "false" }

Seems below code is blocking above policy, is there any way to override below in file cmd/azure-keyvault-secrets-webhook/pod.go?

SecurityContext: &corev1.SecurityContext{ Capabilities: &corev1.Capabilities{ Drop: []corev1.Capability{"ALL"}, }, ReadOnlyRootFilesystem: &[]bool{viper.GetBool("webhook_container_security_context_read_only")}[0], RunAsNonRoot: &[]bool{viper.GetBool("webhook_container_security_context_non_root")}[0], Privileged: &[]bool{viper.GetBool("webhook_container_security_context_privileged")}[0], },

@cramakan cramakan added the bug Something isn't working label Mar 11, 2025
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