-
Notifications
You must be signed in to change notification settings - Fork 526
Forbid container privilege escalations for Seed and Garden cluster components #11519
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
Forbid container privilege escalations for Seed and Garden cluster components #11519
Conversation
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this was already discussed, but why don't we do this via a webhook in GRM? We could augment https://github.com/gardener/gardener/tree/master/pkg/resourcemanager/webhook/seccompprofile (rename) to also handle this AllowPrivilegeEscalation
field in pod specs (maybe even also other simple things from the component checklist)?
Doing this manually and expecting others to be aware of it will probably lead to deficiencies, don't you think?
/cc @ialidzhikov
It is not easy to determine when |
/test pull-gardener-e2e-kind-ipv6 |
Couldn't we add an opt-out option of the webhook with a label that can be set on |
For the seccomp profile field, the GRM webhook only covers the Seed/Garden cluster. For Shoots, we declaratively set the field. IIRC, the plan was even to drop the GRM webhook for the Seed/Garden cluster and use the corresponding kubelet field in the Shoot spec (for ManagedSeeds at least). The advantage of a webhook is that there won't be need to adapt each and every container. However, exceptions still have to be done - most likely via label/annotation to instruct the webhook to do not mutate in special cases when the workload needs privilege escalation for example. There was a push on #7157 or a similar issue on why we, from Gardener Core side, didn't do anything so far on the topic. However, my reply back then was that:
We also have diki that performs the checks, so it won't be the case that we missed to adapt a component. And, the webhook approach - it introduces a performance penalty (n milliseconds for the webhook call, network cost, etc) and yet another failure point in the system. tl;dr: I don't see super big advantage of using a webhook if we don't have the requirement to enforce the fields on the runtime (kyverno-like). But I am open to discuss and see other points. |
/test pull-gardener-integration |
1 similar comment
/test pull-gardener-integration |
/test pull-gardener-e2e-kind-ipv6 |
2 similar comments
/test pull-gardener-e2e-kind-ipv6 |
/test pull-gardener-e2e-kind-ipv6 |
Holding this PR until we have clarity on what approach to use for the |
/unhold |
…roller runtime deployment
…nager runtime deployment
…er-discover-server
ae01dfe
to
36d55b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: 8b8f746249017fa869fbe81ae14a62955327ff4f
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ialidzhikov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
How to categorize this PR?
/area compliance
/area security
/kind enhancement
What this PR does / why we need it:
This PR sets
securityContext.allowPrivilegeEscalation
to false for everySeed
andGarden
cluster component container, which does not havesecurityContext.Privileged
set totrue
or one ofCAP_SYS_ADMIN/SYS_ADMIN
capabilities added.Which issue(s) this PR fixes:
Part of #11139
Special notes for your reviewer:
/ cc @AleksandarSavchev
Release note: