Skip to content

Commit ae1ae50

Browse files
committed
Address PR feedback
1 parent 4600715 commit ae1ae50

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

content/en/docs/concepts/policy/pod-security-policy.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ subjects:
115115
- kind: Group
116116
apiGroup: rbac.authorization.k8s.io
117117
name: system:serviceaccounts:<authorized namespace>
118-
# Authorize specific service accounts:
118+
# Authorize specific service accounts (not recommended):
119119
- kind: ServiceAccount
120120
name: <authorized service account name>
121121
namespace: <authorized pod namespace>
@@ -144,20 +144,21 @@ Examples](/docs/reference/access-authn-authz/rbac#role-binding-examples).
144144
For a complete example of authorizing a PodSecurityPolicy, see
145145
[below](#example).
146146

147-
### Best Practices
147+
### Recommended Practice
148148

149-
PodSecurityPolicy is being replaced by a new, simplified PodSecurity admission controller. The
150-
following recommended best-practices will make the migration to the new PodSecurity admission
151-
controller much simpler. For more details on this change, see
152-
[PodSecurityPolicy Deprecation: Past, Present, and Future](/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/).
149+
PodSecurityPolicy is being replaced by a new, simplified `PodSecurity` {{< glossary_tooltip
150+
text="admission controller" term_id="admission-controller" >}}. For more details on this change, see
151+
[PodSecurityPolicy Deprecation: Past, Present, and
152+
Future](/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/). Follow these
153+
guidelines to simplify migration from PodSecurityPolicy to the new admission controller:
153154

154155
1. Limit your PodSecurityPolicies to the policies defined by the [Pod Security Standards](/docs/concepts/security/pod-security-standards):
155-
- [Privileged](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/policy/privileged-psp.yaml)
156-
- [Baseline](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/policy/baseline-psp.yaml)
157-
- [Restricted](https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/policy/restricted-psp.yaml)
156+
- {{< example file="policy/privileged-psp.yaml" >}}Privileged{{< /example >}}
157+
- {{< example file="policy/baseline-psp.yaml" >}}Baseline{{< /example >}}
158+
- {{< example file="policy/restricted-psp.yaml" >}}Restricted{{< /example >}}
158159

159-
2. Only bind PSPs to namespaces, by using the `system:serviceaccounts:<namespace>` group (where
160-
`<namespace>` is the target namespace). For example:
160+
2. Only bind PSPs to entire namespaces, by using the `system:serviceaccounts:<namespace>` group
161+
(where `<namespace>` is the target namespace). For example:
161162

162163
```yaml
163164
apiVersion: rbac.authorization.k8s.io/v1
@@ -699,6 +700,10 @@ Refer to the [Sysctl documentation](
699700

700701
## {{% heading "whatsnext" %}}
701702

703+
- See [PodSecurityPolicy Deprecation: Past, Present, and
704+
Future](/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/) to learn about
705+
the future of pod security policy.
706+
702707
- See [Pod Security Standards](/docs/concepts/security/pod-security-standards/) for policy recommendations.
703708

704709
- Refer to [Pod Security Policy Reference](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy) for the api details.

content/en/docs/concepts/security/pod-security-standards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ enforced/disallowed:
8686
<tr>
8787
<td>Capabilities</td>
8888
<td>
89-
Adding additional capabilities beyond the <a href="https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities">default set (excluding NET_RAW)</a> must be disallowed.<br>
89+
Adding <tt>NET_RAW</tt> or capabilities beyond the <a href="https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities">default set</a> must be disallowed.<br>
9090
<br><b>Restricted Fields:</b><br>
9191
spec.containers[*].securityContext.capabilities.add<br>
9292
spec.initContainers[*].securityContext.capabilities.add<br>

content/en/examples/policy/baseline-psp.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ metadata:
66
# Optional: Allow the default AppArmor profile, requires setting the default.
77
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
88
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
9-
# Optional: Allow the default seccomp profile, requires setting the default.
10-
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default,unconfined'
11-
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'unconfined'
9+
seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
1210
spec:
1311
privileged: false
1412
# The moby default capability set, minus NET_RAW
@@ -34,15 +32,16 @@ spec:
3432
- 'projected'
3533
- 'secret'
3634
- 'downwardAPI'
37-
# Assume that persistentVolumes set up by the cluster admin are safe to use.
35+
# Assume that ephemeral CSI drivers & persistentVolumes set up by the cluster admin are safe to use.
36+
- 'csi'
3837
- 'persistentVolumeClaim'
38+
- 'ephemeral'
3939
# Allow all other non-hostpath volume types.
4040
- 'awsElasticBlockStore'
4141
- 'azureDisk'
4242
- 'azureFile'
4343
- 'cephFS'
4444
- 'cinder'
45-
- 'csi'
4645
- 'fc'
4746
- 'flexVolume'
4847
- 'flocker'

content/en/examples/policy/restricted-psp.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@ metadata:
55
annotations:
66
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default,runtime/default'
77
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
8-
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'runtime/default'
98
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
109
spec:
1110
privileged: false
1211
# Required to prevent escalations to root.
1312
allowPrivilegeEscalation: false
14-
# This is redundant with non-root + disallow privilege escalation,
15-
# but we can provide it for defense in depth.
1613
requiredDropCapabilities:
1714
- ALL
1815
# Allow core volume types.
@@ -22,9 +19,10 @@ spec:
2219
- 'projected'
2320
- 'secret'
2421
- 'downwardAPI'
25-
# Assume that CSI drivers & persistentVolumes set up by the cluster admin are safe to use.
26-
- 'persistentVolumeClaim'
22+
# Assume that ephemeral CSI drivers & persistentVolumes set up by the cluster admin are safe to use.
2723
- 'csi'
24+
- 'persistentVolumeClaim'
25+
- 'ephemeral'
2826
hostNetwork: false
2927
hostIPC: false
3028
hostPID: false

0 commit comments

Comments
 (0)