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] Pod spec security contexts are being mutated #591

Closed
tspearconquest opened this issue Aug 19, 2023 · 5 comments · Fixed by #592
Closed

[BUG] Pod spec security contexts are being mutated #591

tspearconquest opened this issue Aug 19, 2023 · 5 comments · Fixed by #592
Labels
bug Something isn't working

Comments

@tspearconquest
Copy link
Contributor

Components and versions
[ ] Controller, version: x.x.x (docker image tag)
[ x ] Env-Injector (webhook), version: 1.5.0 (docker image tag)
[ ] Other

Describe the bug
#548 Introduces a hard-coded default for the pod security context to force the pod's security context read only root filesystem value to false. This causes the webhook to mutate pods which may have already set the security context to true, and users have no option to prevent this behavior.

To Reproduce
Deploy and use the env-injector.

Expected behavior
Expected behaviour would be for the AKV2K8S webhook to NOT mutate the pod-level security context, which may be set true for some workloads and false for some other workloads.

Additional context
We could set the webhook_pod_spec_security_context_non_root field to true through the webhook, then it will force all pod specs to true, which is not what we want.

AKV2K8S should not mutate pod spec securityContext fields in the pods it's mutating, and should only have added the security context for its own containers.

@tspearconquest tspearconquest added the bug Something isn't working label Aug 19, 2023
@tspearconquest tspearconquest changed the title [BUG] [BUG] Pod spec security contexts are being mutated Aug 19, 2023
@HammerNL89
Copy link

Yes, we noticed the same behavior, the webhook is modifying/overwriting 'every' pod securityContext even if the pod isn't using any @azurekeyvault references.
The webhook should not modify the securityContext of 'users' pods, apart from it's own 'copy' initContainer.

Would be nice if the linked PR could be merged asap, because we need the newer version for workload identity.

@slushysnowman
Copy link

This is pretty important, would be good if this could be looked at

@tspearconquest
Copy link
Contributor Author

Hi all, I've pinged in the team's slack channel to ask a maintainer to take a look. They are based in EU time and my ping was at the end of their day, so hopefully they will take a look tomorrow.

@slushysnowman
Copy link

@181192 thanks for merging, any chance we can get a helm release with this fix in it?

@tspearconquest
Copy link
Contributor Author

#592 (comment)

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

Successfully merging a pull request may close this issue.

3 participants