29 lines
956 B
YAML
29 lines
956 B
YAML
|
|
apiVersion: kyverno.io/v1
|
||
|
|
kind: ClusterPolicy
|
||
|
|
metadata:
|
||
|
|
name: require-public-runtime-gvisor
|
||
|
|
annotations:
|
||
|
|
policies.kyverno.io/title: Require gVisor in public-runtime namespaces
|
||
|
|
policies.kyverno.io/category: Runtime Isolation
|
||
|
|
policies.kyverno.io/severity: high
|
||
|
|
policies.kyverno.io/description: >-
|
||
|
|
Tier O and Tier R application namespaces are labeled as public-runtime
|
||
|
|
namespaces. Every admitted pod in those namespaces must use gVisor.
|
||
|
|
spec:
|
||
|
|
validationFailureAction: Enforce
|
||
|
|
background: true
|
||
|
|
rules:
|
||
|
|
- name: public-pods-use-gvisor
|
||
|
|
match:
|
||
|
|
any:
|
||
|
|
- resources:
|
||
|
|
kinds:
|
||
|
|
- Pod
|
||
|
|
namespaceSelector:
|
||
|
|
matchLabels:
|
||
|
|
security.quorate.internal/public-runtime: gvisor
|
||
|
|
validate:
|
||
|
|
message: Public-runtime pods must set spec.runtimeClassName to gvisor.
|
||
|
|
pattern:
|
||
|
|
spec:
|
||
|
|
runtimeClassName: gvisor
|