Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
kubernetes-yaml-templates/podsecurity/podsecurity-advanced.yaml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
50 lines (50 sloc)
1.55 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://kubernetes.io/docs/concepts/policy/pod-security-policy/ | |
# https://cheatsheet.dennyzhang.com/kubernetes-yaml-templates | |
apiVersion: policy/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: restricted-advanced | |
annotations: | |
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default' | |
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' | |
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' | |
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' | |
spec: | |
privileged: false | |
# Required to prevent escalations to root. | |
allowPrivilegeEscalation: false | |
# This is redundant with non-root + disallow privilege escalation, | |
# but we can provide it for defense in depth. | |
requiredDropCapabilities: | |
- ALL | |
# Allow core volume types. | |
volumes: | |
- 'configMap' | |
- 'emptyDir' | |
- 'projected' | |
- 'secret' | |
- 'downwardAPI' | |
# Assume that persistentVolumes set up by the cluster admin are safe to use. | |
- 'persistentVolumeClaim' | |
hostNetwork: false | |
hostIPC: false | |
hostPID: false | |
runAsUser: | |
# Require the container to run without root privileges. | |
rule: 'MustRunAsNonRoot' | |
seLinux: | |
# This policy assumes the nodes are using AppArmor rather than SELinux. | |
rule: 'RunAsAny' | |
supplementalGroups: | |
rule: 'MustRunAs' | |
ranges: | |
# Forbid adding the root group. | |
- min: 1 | |
max: 65535 | |
fsGroup: | |
rule: 'MustRunAs' | |
ranges: | |
# Forbid adding the root group. | |
- min: 1 | |
max: 65535 | |
readOnlyRootFilesystem: false |