mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
27 lines
865 B
YAML
27 lines
865 B
YAML
apiVersion: kyverno.io/v1alpha1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: validate-deny-privileged-priviligedescalation
|
|
annotations:
|
|
policies.kyverno.io/category: Security Context
|
|
policies.kyverno.io/description: A container cannot run in privileged mode, and a process cannot gain more privileges than its parent process
|
|
spec:
|
|
rules:
|
|
- name: deny-privileged-priviligedescalation
|
|
match:
|
|
resources:
|
|
kinds:
|
|
- Pod
|
|
validate:
|
|
message: "Privileged mode is not allowed. Set allowPrivilegeEscalation and privileged to false"
|
|
anyPattern:
|
|
- spec:
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
privileged: false
|
|
- spec:
|
|
containers:
|
|
- name: "*"
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
privileged: false
|