Skip to content

Commit 459a3f9

Browse files
committed
Fix links and markdown format for some pages
1 parent 517ec92 commit 459a3f9

File tree

3 files changed

+207
-157
lines changed

3 files changed

+207
-157
lines changed

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

Lines changed: 122 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ updates.
2323
## What is a Pod Security Policy?
2424

2525
A _Pod Security Policy_ is a cluster-level resource that controls security
26-
sensitive aspects of the pod specification. The [PodSecurityPolicy](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy) objects
26+
sensitive aspects of the pod specification. The
27+
[PodSecurityPolicy](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy) objects
2728
define a set of conditions that a pod must run with in order to be accepted into
2829
the system, as well as defaults for the related fields. They allow an
2930
administrator to control the following:
@@ -50,10 +51,10 @@ administrator to control the following:
5051

5152
## Enabling Pod Security Policies
5253

53-
Pod security policy control is implemented as an optional [admission
54-
controller](/docs/reference/access-authn-authz/admission-controllers/#podsecuritypolicy).
55-
PodSecurityPolicies are enforced by [enabling the admission
56-
controller](/docs/reference/access-authn-authz/admission-controllers/#how-do-i-turn-on-an-admission-control-plug-in),
54+
Pod security policy control is implemented as an optional
55+
[admission controller](/docs/reference/access-authn-authz/admission-controllers/#podsecuritypolicy).
56+
PodSecurityPolicies are enforced by
57+
[enabling the admission controller](/docs/reference/access-authn-authz/admission-controllers/#how-do-i-turn-on-an-admission-control-plug-in),
5758
but doing so without authorizing any policies **will prevent any pods from being created** in the
5859
cluster.
5960

@@ -65,9 +66,9 @@ controller.
6566
## Authorizing Policies
6667

6768
When a PodSecurityPolicy resource is created, it does nothing. In order to use
68-
it, the requesting user or target pod's [service
69-
account](/docs/tasks/configure-pod-container/configure-service-account/) must be
70-
authorized to use the policy, by allowing the `use` verb on the policy.
69+
it, the requesting user or target pod's
70+
[service account](/docs/tasks/configure-pod-container/configure-service-account/)
71+
must be authorized to use the policy, by allowing the `use` verb on the policy.
7172

7273
Most Kubernetes pods are not created directly by users. Instead, they are
7374
typically created indirectly as part of a
@@ -128,6 +129,7 @@ subjects:
128129
If a `RoleBinding` (not a `ClusterRoleBinding`) is used, it will only grant
129130
usage for pods being run in the same namespace as the binding. This can be
130131
paired with system groups to grant access to all pods run in the namespace:
132+
131133
```yaml
132134
# Authorize all service accounts in a namespace:
133135
- kind: Group
@@ -139,45 +141,47 @@ paired with system groups to grant access to all pods run in the namespace:
139141
name: system:authenticated
140142
```
141143

142-
For more examples of RBAC bindings, see [Role Binding
143-
Examples](/docs/reference/access-authn-authz/rbac#role-binding-examples).
144-
For a complete example of authorizing a PodSecurityPolicy, see
145-
[below](#example).
144+
For more examples of RBAC bindings, see
145+
[RoleBinding examples](/docs/reference/access-authn-authz/rbac#role-binding-examples).
146+
For a complete example of authorizing a PodSecurityPolicy, see [below](#example).
146147

147148
### Recommended Practice
148149

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:
150+
PodSecurityPolicy is being replaced by a new, simplified `PodSecurity`
151+
{{< glossary_tooltip text="admission controller" term_id="admission-controller" >}}.
152+
For more details on this change, see
153+
[PodSecurityPolicy Deprecation: Past, Present, and Future](/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/).
154+
Follow these guidelines to simplify migration from PodSecurityPolicy to the
155+
new admission controller:
156+
157+
1. Limit your PodSecurityPolicies to the policies defined by the
158+
[Pod Security Standards](/docs/concepts/security/pod-security-standards):
154159

155-
1. Limit your PodSecurityPolicies to the policies defined by the [Pod Security Standards](/docs/concepts/security/pod-security-standards):
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 >}}
160+
- {{< example file="policy/privileged-psp.yaml" >}}Privileged{{< /example >}}
161+
- {{< example file="policy/baseline-psp.yaml" >}}Baseline{{< /example >}}
162+
- {{< example file="policy/restricted-psp.yaml" >}}Restricted{{< /example >}}
159163

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

163-
```yaml
164-
apiVersion: rbac.authorization.k8s.io/v1
165-
# This cluster role binding allows all pods in the "development" namespace to use the baseline PSP.
166-
kind: ClusterRoleBinding
167-
metadata:
168-
name: psp-baseline-namespaces
169-
roleRef:
170-
kind: ClusterRole
171-
name: psp-baseline
172-
apiGroup: rbac.authorization.k8s.io
173-
subjects:
174-
- kind: Group
175-
name: system:serviceaccounts:development
176-
apiGroup: rbac.authorization.k8s.io
177-
- kind: Group
178-
name: system:serviceaccounts:canary
179-
apiGroup: rbac.authorization.k8s.io
180-
```
167+
```yaml
168+
apiVersion: rbac.authorization.k8s.io/v1
169+
# This cluster role binding allows all pods in the "development" namespace to use the baseline PSP.
170+
kind: ClusterRoleBinding
171+
metadata:
172+
name: psp-baseline-namespaces
173+
roleRef:
174+
kind: ClusterRole
175+
name: psp-baseline
176+
apiGroup: rbac.authorization.k8s.io
177+
subjects:
178+
- kind: Group
179+
name: system:serviceaccounts:development
180+
apiGroup: rbac.authorization.k8s.io
181+
- kind: Group
182+
name: system:serviceaccounts:canary
183+
apiGroup: rbac.authorization.k8s.io
184+
```
181185

182186
### Troubleshooting
183187

@@ -213,8 +217,8 @@ only non-mutating PodSecurityPolicies are used to validate the pod.
213217

214218
## Example
215219

216-
_This example assumes you have a running cluster with the PodSecurityPolicy
217-
admission controller enabled and you have cluster admin privileges._
220+
This example assumes you have a running cluster with the PodSecurityPolicy
221+
admission controller enabled and you have cluster admin privileges.
218222

219223
### Set up
220224

@@ -360,12 +364,24 @@ Let's try that again, slightly differently:
360364

361365
```shell
362366
kubectl-user create deployment pause --image=k8s.gcr.io/pause
363-
deployment "pause" created
367+
```
364368

369+
```none
370+
deployment "pause" created
371+
```
372+
```shell
365373
kubectl-user get pods
374+
```
375+
376+
```
366377
No resources found.
378+
```
367379

380+
```shell
368381
kubectl-user get events | head -n 2
382+
```
383+
384+
```
369385
LASTSEEN FIRSTSEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
370386
1m 2m 15 pause-7774d79b5 ReplicaSet Warning FailedCreate replicaset-controller Error creating: pods "pause-7774d79b5-" is forbidden: no providers available to validate pod request
371387
```
@@ -386,6 +402,9 @@ is `default`:
386402
kubectl-admin create rolebinding default:psp:unprivileged \
387403
--role=psp:unprivileged \
388404
--serviceaccount=psp-example:default
405+
```
406+
407+
```none
389408
rolebinding "default:psp:unprivileged" created
390409
```
391410

@@ -394,6 +413,9 @@ eventually succeed in creating the pod:
394413

395414
```shell
396415
kubectl-user get pods --watch
416+
```
417+
418+
```none
397419
NAME READY STATUS RESTARTS AGE
398420
pause-7774d79b5-qrgcb 0/1 Pending 0 1s
399421
pause-7774d79b5-qrgcb 0/1 Pending 0 1s
@@ -407,6 +429,9 @@ Delete the namespace to clean up most of the example resources:
407429

408430
```shell
409431
kubectl-admin delete ns psp-example
432+
```
433+
434+
```
410435
namespace "psp-example" deleted
411436
```
412437

@@ -415,6 +440,9 @@ up separately:
415440

416441
```shell
417442
kubectl-admin delete psp example
443+
```
444+
445+
```
418446
podsecuritypolicy "example" deleted
419447
```
420448

@@ -431,7 +459,8 @@ several security mechanisms.
431459

432460
{{< codenew file="policy/restricted-psp.yaml" >}}
433461

434-
See [Pod Security Standards](/docs/concepts/security/pod-security-standards/#policy-instantiation) for more examples.
462+
See [Pod Security Standards](/docs/concepts/security/pod-security-standards/#policy-instantiation)
463+
for more examples.
435464

436465
## Policy Reference
437466

@@ -467,17 +496,17 @@ and `max`(inclusive). Defaults to no allowed host ports.
467496
**Volumes** - Provides a list of allowed volume types. The allowable values
468497
correspond to the volume sources that are defined when creating a volume. For
469498
the complete list of volume types, see [Types of
470-
Volumes](/docs/concepts/storage/volumes/#types-of-volumes). Additionally, `*`
471-
may be used to allow all volume types.
499+
Volumes](/docs/concepts/storage/volumes/#types-of-volumes). Additionally,
500+
`*` may be used to allow all volume types.
472501

473502
The **recommended minimum set** of allowed volumes for new PSPs are:
474503

475-
- configMap
476-
- downwardAPI
477-
- emptyDir
478-
- persistentVolumeClaim
479-
- secret
480-
- projected
504+
- `configMap`
505+
- `downwardAPI`
506+
- `emptyDir`
507+
- `persistentVolumeClaim`
508+
- `secret`
509+
- `projected`
481510

482511
{{< warning >}}
483512
PodSecurityPolicy does not limit the types of `PersistentVolume` objects that
@@ -489,10 +518,10 @@ should be granted permission to create `PersistentVolume` objects.
489518
**FSGroup** - Controls the supplemental group applied to some volumes.
490519

491520
- *MustRunAs* - Requires at least one `range` to be specified. Uses the
492-
minimum value of the first range as the default. Validates against all ranges.
521+
minimum value of the first range as the default. Validates against all ranges.
493522
- *MayRunAs* - Requires at least one `range` to be specified. Allows
494-
`FSGroups` to be left unset without providing a default. Validates against
495-
all ranges if `FSGroups` is set.
523+
`FSGroups` to be left unset without providing a default. Validates against
524+
all ranges if `FSGroups` is set.
496525
- *RunAsAny* - No default provided. Allows any `fsGroup` ID to be specified.
497526

498527
**AllowedHostPaths** - This specifies a list of host paths that are allowed
@@ -511,7 +540,8 @@ For example:
511540
readOnly: true # only allow read-only mounts
512541
```
513542
514-
{{< warning >}}There are many ways a container with unrestricted access to the host
543+
{{< warning >}}
544+
There are many ways a container with unrestricted access to the host
515545
filesystem can escalate privileges, including reading data from other
516546
containers, and abusing the credentials of system services, such as Kubelet.
517547
@@ -552,33 +582,33 @@ spec:
552582
**RunAsUser** - Controls which user ID the containers are run with.
553583

554584
- *MustRunAs* - Requires at least one `range` to be specified. Uses the
555-
minimum value of the first range as the default. Validates against all ranges.
585+
minimum value of the first range as the default. Validates against all ranges.
556586
- *MustRunAsNonRoot* - Requires that the pod be submitted with a non-zero
557-
`runAsUser` or have the `USER` directive defined (using a numeric UID) in the
558-
image. Pods which have specified neither `runAsNonRoot` nor `runAsUser` settings
559-
will be mutated to set `runAsNonRoot=true`, thus requiring a defined non-zero
560-
numeric `USER` directive in the container. No default provided. Setting
561-
`allowPrivilegeEscalation=false` is strongly recommended with this strategy.
587+
`runAsUser` or have the `USER` directive defined (using a numeric UID) in the
588+
image. Pods which have specified neither `runAsNonRoot` nor `runAsUser` settings
589+
will be mutated to set `runAsNonRoot=true`, thus requiring a defined non-zero
590+
numeric `USER` directive in the container. No default provided. Setting
591+
`allowPrivilegeEscalation=false` is strongly recommended with this strategy.
562592
- *RunAsAny* - No default provided. Allows any `runAsUser` to be specified.
563593

564594
**RunAsGroup** - Controls which primary group ID the containers are run with.
565595

566596
- *MustRunAs* - Requires at least one `range` to be specified. Uses the
567-
minimum value of the first range as the default. Validates against all ranges.
597+
minimum value of the first range as the default. Validates against all ranges.
568598
- *MayRunAs* - Does not require that RunAsGroup be specified. However, when RunAsGroup
569-
is specified, they have to fall in the defined range.
599+
is specified, they have to fall in the defined range.
570600
- *RunAsAny* - No default provided. Allows any `runAsGroup` to be specified.
571601

572602

573603
**SupplementalGroups** - Controls which group IDs containers add.
574604

575605
- *MustRunAs* - Requires at least one `range` to be specified. Uses the
576-
minimum value of the first range as the default. Validates against all ranges.
606+
minimum value of the first range as the default. Validates against all ranges.
577607
- *MayRunAs* - Requires at least one `range` to be specified. Allows
578-
`supplementalGroups` to be left unset without providing a default.
579-
Validates against all ranges if `supplementalGroups` is set.
608+
`supplementalGroups` to be left unset without providing a default.
609+
Validates against all ranges if `supplementalGroups` is set.
580610
- *RunAsAny* - No default provided. Allows any `supplementalGroups` to be
581-
specified.
611+
specified.
582612

583613
### Privilege Escalation
584614

@@ -623,8 +653,8 @@ added. Capabilities listed in `RequiredDropCapabilities` must not be included in
623653
`AllowedCapabilities` or `DefaultAddCapabilities`.
624654

625655
**DefaultAddCapabilities** - The capabilities which are added to containers by
626-
default, in addition to the runtime defaults. See the [Docker
627-
documentation](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities)
656+
default, in addition to the runtime defaults. See the
657+
[Docker documentation](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities)
628658
for the default list of capabilities when using the Docker runtime.
629659

630660
### SELinux
@@ -651,16 +681,17 @@ denoted as the string `Unmasked`.
651681

652682
### AppArmor
653683

654-
Controlled via annotations on the PodSecurityPolicy. Refer to the [AppArmor
655-
documentation](/docs/tutorials/clusters/apparmor/#podsecuritypolicy-annotations).
684+
Controlled via annotations on the PodSecurityPolicy. Refer to the
685+
[AppArmor documentation](/docs/tutorials/security/apparmor/#podsecuritypolicy-annotations).
656686

657687
### Seccomp
658688

659689
As of Kubernetes v1.19, you can use the `seccompProfile` field in the
660-
`securityContext` of Pods or containers to [control use of seccomp
661-
profiles](/docs/tutorials/clusters/seccomp). In prior versions, seccomp was
662-
controlled by adding annotations to a Pod. The same PodSecurityPolicies can be
663-
used with either version to enforce how these fields or annotations are applied.
690+
`securityContext` of Pods or containers to
691+
[control use of seccomp profiles](/docs/tutorials/security/seccomp/).
692+
In prior versions, seccomp was controlled by adding annotations to a Pod. The
693+
same PodSecurityPolicies can be used with either version to enforce how these
694+
fields or annotations are applied.
664695

665696
**seccomp.security.alpha.kubernetes.io/defaultProfileName** - Annotation that
666697
specifies the default seccomp profile to apply to containers. Possible values
@@ -677,10 +708,10 @@ are:
677708
flag is not defined, the default path will be used, which is
678709
`<root-dir>/seccomp` where `<root-dir>` is specified by the `--root-dir` flag.
679710

680-
{{< note >}}
711+
{{< note >}}
681712
The `--seccomp-profile-root` flag is deprecated since Kubernetes
682713
v1.19. Users are encouraged to use the default path.
683-
{{< /note >}}
714+
{{< /note >}}
684715

685716
**seccomp.security.alpha.kubernetes.io/allowedProfileNames** - Annotation that
686717
specifies which values are allowed for the pod seccomp annotations. Specified as
@@ -692,18 +723,22 @@ default cannot be changed.
692723

693724
By default, all safe sysctls are allowed.
694725

695-
- `forbiddenSysctls` - excludes specific sysctls. You can forbid a combination of safe and unsafe sysctls in the list. To forbid setting any sysctls, use `*` on its own.
696-
- `allowedUnsafeSysctls` - allows specific sysctls that had been disallowed by the default list, so long as these are not listed in `forbiddenSysctls`.
726+
- `forbiddenSysctls` - excludes specific sysctls. You can forbid a combination
727+
of safe and unsafe sysctls in the list. To forbid setting any sysctls, use
728+
`*` on its own.
729+
- `allowedUnsafeSysctls` - allows specific sysctls that had been disallowed by
730+
the default list, so long as these are not listed in `forbiddenSysctls`.
697731

698-
Refer to the [Sysctl documentation](
699-
/docs/tasks/administer-cluster/sysctl-cluster/#podsecuritypolicy).
732+
Refer to the [Sysctl documentation](/docs/tasks/administer-cluster/sysctl-cluster/#podsecuritypolicy).
700733

701734
## {{% heading "whatsnext" %}}
702735

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.
736+
- See [PodSecurityPolicy Deprecation: Past, Present, and Future](/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/)
737+
to learn about the future of pod security policy.
738+
739+
- See [Pod Security Standards](/docs/concepts/security/pod-security-standards/)
740+
for policy recommendations.
706741

707-
- See [Pod Security Standards](/docs/concepts/security/pod-security-standards/) for policy recommendations.
742+
- Refer to [PodSecurityPolicy reference](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy)
743+
for the API details.
708744

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

content/en/docs/reference/using-api/deprecation-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ might have to add an equivalent field or represent it as an annotation.
8585
* **Beta API versions must be supported for 9 months or 3 releases (whichever is longer) after deprecation**
8686
* **Alpha API versions may be removed in any release without prior deprecation notice**
8787

88-
This ensures beta API support covers the [maximum supported version skew of 2 releases](/docs/setup/release/version-skew-policy/).
88+
This ensures beta API support covers the [maximum supported version skew of 2 releases](/releases/version-skew-policy/).
8989

9090
{{< note >}}
9191
There are no current plans for a major version revision of Kubernetes that removes GA APIs.

0 commit comments

Comments
 (0)