Add "MayRunAs" value among other GroupStrategies#65135
Add "MayRunAs" value among other GroupStrategies#65135k8s-ci-robot merged 1 commit intokubernetes:masterfrom
Conversation
|
/sig auth PTAL @kubernetes/sig-auth-api-reviews CC @simo5 |
There was a problem hiding this comment.
Please, update the comment.
pkg/apis/policy/types.go
Outdated
There was a problem hiding this comment.
s/to run as a particular gid/to run with particular gids/ ?
There was a problem hiding this comment.
It was but a mere copy-paste but "with" sounds definitely better
pkg/apis/policy/types.go
Outdated
There was a problem hiding this comment.
s/when it is applied, it has to/when they are specified, they have to/ ?
|
@stlaz One more place to update: kubernetes/pkg/apis/policy/fuzzer/fuzzer.go Lines 49 to 58 in 3abba25 |
|
@kubernetes/sig-auth-api-reviews Do we need to update PSP in |
|
/assign @tallclair |
3d44643 to
5e430d8
Compare
|
Updated the patch to fix |
|
This change introduces backward incompatibility since the "MayRunAs" value to the groups is unknown to previous API versions. If we convert this to "MustRunAs" internally, we wouldn't be able to later get the information that it's actually "MayRunAs". |
|
@tallclair @php-coder i believe the MayRunAs would also be needed by RunAsGroup field. I will include that in the PSP changes for RunAsGroup in my next PR. |
|
PTAL @tallclair |
tallclair
left a comment
There was a problem hiding this comment.
This change introduces backward incompatibility since the "MayRunAs" value to the groups is unknown to previous API versions.
Backwards incompatibility means that a resource that was valid in a previous version is no longer valid (or behaves differently), which isn't the case here. What you're refering to is forwards compatibility, and that's not something Kubernetes provides, so this is a non-issue.
There was a problem hiding this comment.
dedupe this code with mustRunAs.Validate (extract a shared helper)
There was a problem hiding this comment.
This method is constant, don't bother testing it here. Instead, add a couple cases under https://github.com/kubernetes/kubernetes/blob/master/pkg/security/podsecuritypolicy/provider_test.go to ensure that the nil return works as expected.
5e430d8 to
698d161
Compare
fb98885 to
5cb67ba
Compare
|
/retest |
|
The "fall in all groups" issue should now be resolved, a positive multi-ranges test was added on top of the mayrunas tests. |
5cb67ba to
c946886
Compare
|
thanks. both tallclair and I are out of the office at the moment, but will pick this up when master reopens for 1.13. |
|
Thank you. I'm not sure exactly why the verify test does not pass since |
c946886 to
b738d40
Compare
|
/retest |
b738d40 to
4ae930c
Compare
|
@tallclair Test cases for multiple groups added. |
tallclair
left a comment
There was a problem hiding this comment.
A couple nits, but LGTM. Please squash.
Adds "MayRunAs" value among other group strategies. This strategy allows to define a certain range of GIDs for FSGroupStrategy and SupplementalGroupStrategy in a PSP. This new strategy works similarly to the "MustRunAs" one, except that when no GID is specified in a pod/container security context then no GID is generated for the respective containers. Resolves kubernetes#56173
4ae930c to
a577b50
Compare
|
Comments addressed + squashed. |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, stlaz, tallclair The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
hi folks, why not syncing these new internal definitions to the external repo? i'm afraid currently we can't specify the new strategy w/ client-go. also the "MayRunAs" will be an undefined value when deserialized into external types. ref: #69704 |
What this PR does / why we need it:
Adds "MayRunAs" value among other group strategies. This strategy
allows to define a certain range of GIDs for FSGroupStrategy and
SupplementalGroupStrategy in a PSP.
This new strategy works similarly to the "MustRunAs" one, except that
when no GID is specified in a pod/container security context then no
GID is generated for the respective containers.
Which issue(s) this PR fixes
Resolves #56173
Release note: