-
Notifications
You must be signed in to change notification settings - Fork 479
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
Enable PodSecurityPolicies by default #226
Conversation
Thanks @mvladev. Review postponed until Gardener 0.7.0 has been released. |
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.
Shouldn't we use garden.sapcloud.io:
as prefix instead of gardener:
(like we do it when creating secrets or certificates for components needed/deployed by Gardener)?
Looks good generally. However, one issue I found is with Heapster. PTAL at my comments inline.
Regarding enabling/disabling privileged containers: Currently, the user has to patch the ClusterRoleBinding
which is only ensured to exist by the kube-addon-manager. Can we use the allowPrivilegedContainers
field to enable/disable? That would be much nicer and a clearer contract.
Can you also please remove https://github.com/gardener/gardener/blob/master/charts/shoot-cloud-config/charts/original/templates/kubelet/_kubelet.flags#L3 and https://github.com/gardener/gardener/blob/master/charts/shoot-cloud-config/charts/original/templates/kubelet/_kubelet.flags#L40 (as the --allow-privileged flag is deprecated and will be removed in 1.13)?
Could you also please keep in mind to add a document describing the behaviour, how to disable/enable privileged mode, etc. (can be done later as well)?
charts/shoot-addons/charts/kube2iam/templates/psp/kube2ima-rolebinding-privileged.yaml
Outdated
Show resolved
Hide resolved
charts/shoot-core/charts/00-podsecuritypolicy/templates/node-rolebinding.yaml
Outdated
Show resolved
Hide resolved
charts/shoot-core/charts/00-podsecuritypolicy/templates/node-rolebinding.yaml
Outdated
Show resolved
Hide resolved
charts/shoot-core/charts/00-podsecuritypolicy/templates/privileged-clusterrolebinding.yaml
Outdated
Show resolved
Hide resolved
charts/shoot-core/charts/00-podsecuritypolicy/templates/privileged-psp.yaml
Outdated
Show resolved
Hide resolved
charts/shoot-core/charts/00-podsecuritypolicy/templates/unprivileged-clusterrolebinding.yaml
Outdated
Show resolved
Hide resolved
charts/shoot-addons/charts/heapster/templates/_deploymentspec.yaml
Outdated
Show resolved
Hide resolved
|
ping @mvladev |
What's the status with this one? Shall we close it and you reopen it once you have rebased and addressed the initial feedback? |
I'll update the PR on Monday |
e147fed
to
dd24748
Compare
Thank you @mvladev for checking. So, as we are not about to enable AppArmor, it looks like we should look for another test or create a new test in go which we can use to test if PSP really works in our clusters. Is there already a GitHub issue we can link here to not forget that there is a test needed? |
Copied from a conversation with @mvladev in Slack:
|
charts/shoot-core/charts/podsecuritypolicies/templates/privileged-clusterrolebinding.yaml
Outdated
Show resolved
Hide resolved
Updated monocular-ui in 11fd7af |
PodSecurityPolicy admission controller is enabled by default for all Shoot clusters. - gardener.unprivileged PSP limits the Pod privileges to the absolute minimum - gardener.privileged PSP grants full unrestricted Pod creation. By default, all authenticated users are given access to both PSP, thus keeping the old behavior (as if `PodSecurityPolicy` admission controller is not enabled). Cluster administrators, seeking to increase the security of their clusters can disable this behavior by setting `spec.kubernetes.allowPrivilegedContainers` to `false` in the `Shoot` resource. For example: `kubectl patch shoot my-shoot -p '{"spec":{"kubernetes":{"allowPrivilegedContainers":false}}}'`
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
remove robohash.org dependency
What this PR does / why we need it:
PodSecurityPolicy admission controller is enabled by default for all Shoot clusters.
By default, all authenticated users are given access to both PSP, thus keeping the old behavior (as if
PodSecurityPolicy
admission controller is not enabled). Those roles are assigned usingspec.kubernetes.allowPrivilegedContainers
of aShoot
resource.Cluster operators are encouraged to create
PodSecurityPolicies
in advanced and test their behavior.Which issue(s) this PR fixes:
Fixes #211
Release note: