2019-11-13 13:56:20 -08:00
|
|
|
apiVersion: kyverno.io/v1
|
2019-10-04 17:28:42 -07:00
|
|
|
kind: ClusterPolicy
|
|
|
|
metadata:
|
|
|
|
name: validate-selinux-options
|
|
|
|
spec:
|
|
|
|
validationFailureAction: "audit"
|
|
|
|
rules:
|
|
|
|
- name: validate-selinux-options
|
|
|
|
match:
|
|
|
|
resources:
|
|
|
|
kinds:
|
|
|
|
- Pod
|
|
|
|
validate:
|
2019-10-04 17:48:57 -07:00
|
|
|
message: "SELinux level is required"
|
2019-10-04 17:28:42 -07:00
|
|
|
pattern:
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- securityContext:
|
|
|
|
seLinuxOptions:
|
2019-10-09 21:06:49 -07:00
|
|
|
level: "*"
|
|
|
|
# level: "s0:c25,c968"
|
2019-10-09 18:39:57 -07:00
|
|
|
# If SELinux security module is loaded on the host operating system,
|
|
|
|
# we can make sure pods only have access to specified configured level
|