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

SecurityContext for initContainer #57

Closed
jeroendk opened this issue Feb 16, 2023 · 2 comments · Fixed by #58
Closed

SecurityContext for initContainer #57

jeroendk opened this issue Feb 16, 2023 · 2 comments · Fixed by #58
Labels
area/injection Patch Injections area area/security Security related issues/PRs enhancement New feature or request

Comments

@jeroendk
Copy link

Is it somehow possible to define a custom securityContext for the injected initContainer?
We want to enforce a restricted admission policy but at the moment we can't due to the initContainers of k8tz.

@yonatankahana yonatankahana added enhancement New feature or request area/injection Patch Injections area area/security Security related issues/PRs labels Feb 16, 2023
@yonatankahana
Copy link
Member

Hi @jeroendk,
I'm considering running k8tz controller and injected initContainers as restricted by default.
Could you try running a demo version at your cluster and tell me if it solves your problem?

To do that, create test-restricted-values.yaml file with contents:

# test-restricted-values.yaml
image:
  repository: quay.io/yonatankahana/k8tz
  tag: 0.12.0-beta0

podSecurityContext:
  runAsNonRoot: true
  seccompProfile:
    type: RuntimeDefault

securityContext:
  allowPrivilegeEscalation: false
  capabilities:
    drop:
      - ALL
  runAsNonRoot: true
  seccompProfile:
    type: RuntimeDefault

and install/upgrade k8tz:

helm upgrade --install k8tz k8tz/k8tz -f test-restricted-values.yaml

Thanks!

@jeroendk
Copy link
Author

@yonatankahana tha above works like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/injection Patch Injections area area/security Security related issues/PRs enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants