Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save bharatmicrosystems/df0db6612708eb650af94f5780e95b18 to your computer and use it in GitHub Desktop.

Select an option

Save bharatmicrosystems/df0db6612708eb650af94f5780e95b18 to your computer and use it in GitHub Desktop.
cat <<EOF | kubectl apply -f -
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: disallow-privileged-pod
spec:
privileged: false #This disallows any privileged pods
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
runAsUser:
rule: RunAsAny
fsGroup:
rule: RunAsAny
volumes:
- '*'
EOF
podsecuritypolicy.policy/disallow-privileged-pod created
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment