-
Notifications
You must be signed in to change notification settings - Fork 173
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
Add in runner and starter possibility to configure allowPrivilegeEscalation and capabilities in container SecurityContext #297
Comments
Hi @pasi-romo-idealo, thanks for opening the issue! This is surely an interesting one. Do I understand correctly, that in your setup both Thanks for the offer to help testing! Could you also please share specifics of your setup? (i.e. how to repeat this situation) AFAIS, your diagnosis is correct: these two options, |
Hi, thank you for having a look at this issue :) That is true i.e. we use kyverno to enforce certain policies. The related policies in this case would be similar like these: and To go around this issue for now I can configure the kyverno-rule directly to ignore the namespace, where the tests are running or create a separate policy exception, which cause kyverno to skip the checking for this namespace. I understand this is a bit edge case and maybe not that easy to handle somehow elegantly in the code :) To reproduce this issue one would basically need a test cluster with kyverno installed + with mentioned rules enabled and then try to run a test. I can also try if I can reproduce this issue e.g. in a kind-cluster and get back to you when I have a working setup, which you could also try. |
So here is a one way how to reproduce the issue.
and Make sure to change the "validationFailureAction" to "enforce".
shows
but this fails due to
Hopefully this is helpful. Please let me know if you need any more information. |
+1 to this issue! We also have the exact same issue as @pasi-romo-idealo. Let me know if you need more information! |
Hey, +1 as well! I lack any proficiency in helping to contribute to this, but it would be really nice to have this possibility. |
@pasi-romo-idealo I've just tried your instructions: I can repeat it with this 👍 Thank you greatly for the details! And thanks for the votes here, @pandrez @gonmmarques. It'd help us prioritize this, hopefully! |
Hi, |
Feature Description
I tried to start following kind of test in our cluster:
but this fails to work because it gets rejected by our policy engine, which requires the workloads to e.g. run as non-root and set seccompProfile. I noticed that it is possible to configure security contexts for the runner and starter so I tried something like this:
otherwise it works, but unfortunately the operator does not seem to support "allowPrivilegeEscalation" and "capabilities"-configurations i.e. I get following error, already while applying the manifest:
I tried to find out if this could be updated in the operator-code, and it seemed that the issue is related to this:
https://github.com/grafana/k6-operator/blob/main/api/v1alpha1/k6_types.go#L40
i.e. corev1.PodSecurityContext is being used, which does not support these configurations since they should get configured actually at the container level.
For now I can get around this issue by e.g. defining policy exceptions for this specific case, but of course it would be much nicer if you could configure this already in the k6-kind.
If you have an idea how this could be achieved, I would be more than happy to test this out in our environment.
Suggested Solution (optional)
No response
Already existing or connected issues / PRs (optional)
No response
The text was updated successfully, but these errors were encountered: