From 6cc9bf8293db61ac7963acb035bd6167d92c86be Mon Sep 17 00:00:00 2001 From: Tim Allclair Date: Wed, 23 Jun 2021 17:42:58 -0700 Subject: [PATCH] Update PodSecurityStandards to match PodSecurity KEP --- .../en/docs/concepts/security/pod-security-standards.md | 5 ++--- content/en/examples/policy/baseline-psp.yaml | 7 ++++--- content/en/examples/policy/restricted-psp.yaml | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/content/en/docs/concepts/security/pod-security-standards.md b/content/en/docs/concepts/security/pod-security-standards.md index 5a69cc8e64..e41e7de809 100644 --- a/content/en/docs/concepts/security/pod-security-standards.md +++ b/content/en/docs/concepts/security/pod-security-standards.md @@ -86,7 +86,7 @@ enforced/disallowed: Capabilities - Adding additional capabilities beyond the default set must be disallowed.
+ Adding additional capabilities beyond the default set (excluding NET_RAW) must be disallowed.

Restricted Fields:
spec.containers[*].securityContext.capabilities.add
spec.initContainers[*].securityContext.capabilities.add
@@ -194,7 +194,7 @@ well as lower-trust users.The following listed controls should be enforced/disal Volume Types - In addition to restricting HostPath volumes, the restricted profile limits usage of non-core volume types to those defined through PersistentVolumes.
+ In addition to restricting HostPath volumes, the restricted profile limits usage of non-ephemeral volume types to those defined through PersistentVolumes.

Restricted Fields:
spec.volumes[*].hostPath
spec.volumes[*].gcePersistentDisk
@@ -216,7 +216,6 @@ well as lower-trust users.The following listed controls should be enforced/disal spec.volumes[*].portworxVolume
spec.volumes[*].scaleIO
spec.volumes[*].storageos
- spec.volumes[*].csi

Allowed Values: undefined/nil
diff --git a/content/en/examples/policy/baseline-psp.yaml b/content/en/examples/policy/baseline-psp.yaml index 36e440588b..97ddc3680e 100644 --- a/content/en/examples/policy/baseline-psp.yaml +++ b/content/en/examples/policy/baseline-psp.yaml @@ -11,15 +11,13 @@ metadata: seccomp.security.alpha.kubernetes.io/defaultProfileName: 'unconfined' spec: privileged: false - # The moby default capability set, defined here: - # https://github.com/moby/moby/blob/0a5cec2833f82a6ad797d70acbf9cbbaf8956017/oci/caps/defaults.go#L6-L19 + # The moby default capability set, minus NET_RAW allowedCapabilities: - 'CHOWN' - 'DAC_OVERRIDE' - 'FSETID' - 'FOWNER' - 'MKNOD' - - 'NET_RAW' - 'SETGID' - 'SETUID' - 'SETFCAP' @@ -67,6 +65,9 @@ spec: runAsUser: rule: 'RunAsAny' seLinux: + # This policy assumes the nodes are using AppArmor rather than SELinux. + # The PSP SELinux API cannot express the SELinux Pod Security Standards, + # so if using SELinux, you must choose a more restrictive default. rule: 'RunAsAny' supplementalGroups: rule: 'RunAsAny' diff --git a/content/en/examples/policy/restricted-psp.yaml b/content/en/examples/policy/restricted-psp.yaml index 4db57688b1..d7150d9d10 100644 --- a/content/en/examples/policy/restricted-psp.yaml +++ b/content/en/examples/policy/restricted-psp.yaml @@ -22,8 +22,9 @@ spec: - 'projected' - 'secret' - 'downwardAPI' - # Assume that persistentVolumes set up by the cluster admin are safe to use. + # Assume that CSI drivers & persistentVolumes set up by the cluster admin are safe to use. - 'persistentVolumeClaim' + - 'csi' hostNetwork: false hostIPC: false hostPID: false