-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Document kubernetes.io/psp annotation #30578
Comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Hi @disconnect3d. The code you point out would run for any pod that passed validation however given the current state of PSP and the deprecation policy I would defer to @tallclair on whether anything more should be documented. I also see that the |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Yes, this annotation can be relied on as long as PSP is still around. |
We should document this in https://kubernetes.io/docs/reference/labels-annotations-taints/ |
/lifecycle frozen |
The actions I'd want:
Those are fairly self-contained @disconnect3d would you be willing to update the issue description to link to this specific comment? |
BTW the “important-soon” priority is because the replacement feature is going beta in the next release, and properly documenting the feature it replaces is equally timely. |
I can do that! |
/close |
@sftim: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hey,
I have a question regarding validating if PSP is applied, as well as an enhancement request on clarifying this.
It seems to me that when a Pod is validated with a PSP, a
"kubernetes.io/psp"
annotation is added with the name of the used pod security policy as its value. It is not obvious if that mechanism can be relied on, especially since it is not documented in the PSP documentation - https://kubernetes.io/docs/concepts/policy/pod-security-policy/.However, it can be found to be relied on per the psp/rbac examples readme:
https://github.com/kubernetes/examples/blob/master/staging/podsecuritypolicy/rbac/README.md#testing-access
"Show me the code"
The
"kubernetes.io/psp"
is defined in pkg/security/podsecuritypolicy/util/util.go#L29 and the annotation is written into the pod object in plugin/pkg/admission/security/podsecuritypolicy/admission.go#L139. I haven't debugged this piece of code nor have I tested if it is invoked in all possible paths, and so on. That's also partially why I want to make this issue: to confirm this detail ;).TLDR
What would you like to be added:
Documentation about the
kubernetes.io/psp
annotation in Pod Security Policy docs.Why is this needed:
To know how to check if a given Pod was validated by a given PSP. This can be very important when using managed kubernetes services, as some providers add a "privileged" PSP by default, to keep backwards compatibility.
It will also be useful for auditors to have a ground truth for this behaviour and have a place to link to :).
The text was updated successfully, but these errors were encountered: