You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a complete example of authorizing a PodSecurityPolicy, see
140
144
[below](#example).
141
145
146
+
### Recommended Practice
147
+
148
+
PodSecurityPolicy is being replaced by a new, simplified `PodSecurity` {{< glossary_tooltip
149
+
text="admission controller" term_id="admission-controller" >}}. For more details on this change, see
150
+
[PodSecurityPolicy Deprecation: Past, Present, and
151
+
Future](/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/). Follow these
152
+
guidelines to simplify migration from PodSecurityPolicy to the new admission controller:
153
+
154
+
1. Limit your PodSecurityPolicies to the policies defined by the [Pod Security Standards](/docs/concepts/security/pod-security-standards):
155
+
- {{< example file="policy/privileged-psp.yaml" >}}Privileged{{< /example >}}
156
+
- {{< example file="policy/baseline-psp.yaml" >}}Baseline{{< /example >}}
157
+
- {{< example file="policy/restricted-psp.yaml" >}}Restricted{{< /example >}}
158
+
159
+
2. Only bind PSPs to entire namespaces, by using the `system:serviceaccounts:<namespace>` group
160
+
(where `<namespace>` is the target namespace). For example:
161
+
162
+
```yaml
163
+
apiVersion: rbac.authorization.k8s.io/v1
164
+
# This cluster role binding allows all pods in the "development" namespace to use the baseline PSP.
165
+
kind: ClusterRoleBinding
166
+
metadata:
167
+
name: psp-baseline-namespaces
168
+
roleRef:
169
+
kind: ClusterRole
170
+
name: psp-baseline
171
+
apiGroup: rbac.authorization.k8s.io
172
+
subjects:
173
+
- kind: Group
174
+
name: system:serviceaccounts:development
175
+
apiGroup: rbac.authorization.k8s.io
176
+
- kind: Group
177
+
name: system:serviceaccounts:canary
178
+
apiGroup: rbac.authorization.k8s.io
179
+
```
142
180
143
181
### Troubleshooting
144
182
@@ -661,8 +699,10 @@ Refer to the [Sysctl documentation](
661
699
662
700
## {{% heading "whatsnext" %}}
663
701
702
+
- See [PodSecurityPolicy Deprecation: Past, Present, and
703
+
Future](/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/) to learn about
704
+
the future of pod security policy.
705
+
664
706
- See [Pod Security Standards](/docs/concepts/security/pod-security-standards/) for policy recommendations.
665
707
666
708
- Refer to [Pod Security Policy Reference](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy) for the api details.
Copy file name to clipboardExpand all lines: content/en/docs/concepts/security/pod-security-standards.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ enforced/disallowed:
86
86
<tr>
87
87
<td>Capabilities</td>
88
88
<td>
89
-
Adding additional capabilities beyond the <a href="https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities">default set</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>
@@ -194,7 +194,7 @@ well as lower-trust users.The following listed controls should be enforced/disal
194
194
<tr>
195
195
<td>Volume Types</td>
196
196
<td>
197
-
In addition to restricting HostPath volumes, the restricted profile limits usage of non-core volume types to those defined through PersistentVolumes.<br>
197
+
In addition to restricting HostPath volumes, the restricted profile limits usage of non-ephemeral volume types to those defined through PersistentVolumes.<br>
198
198
<br><b>Restricted Fields:</b><br>
199
199
spec.volumes[*].hostPath<br>
200
200
spec.volumes[*].gcePersistentDisk<br>
@@ -216,7 +216,6 @@ well as lower-trust users.The following listed controls should be enforced/disal
0 commit comments