The seccomp profile in the Restricted group must not be explicitly set to Unconfined but additionally must also not allow an unset value. This policy, requiring Kubernetes v1.19 or later, ensures that seccomp is set to `RuntimeDefault` or `Localhost`. A known issue prevents a policy such as this using `anyPattern` from being persisted properly in Kubernetes 1.23.0-1.23.2.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: restrict-seccomp-strictannotations:policies.kyverno.io/title: Restrict Seccomp (Strict)policies.kyverno.io/category: Pod Security Standards (Restricted)policies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Podkyverno.io/kyverno-version: 1.6.0kyverno.io/kubernetes-version: 1.22-1.23policies.kyverno.io/description: The seccomp profile in the Restricted group must not be explicitly set to Unconfined but additionally must also not allow an unset value. This policy, requiring Kubernetes v1.19 or later, ensures that seccomp is set to `RuntimeDefault` or `Localhost`. A known issue prevents a policy such as this using `anyPattern` from being persisted properly in Kubernetes 1.23.0-1.23.2.spec:background: truevalidationFailureAction: Auditrules:- name: check-seccomp-strictmatch:any:- resources:kinds:- Podvalidate:message: Use of custom Seccomp profiles is disallowed. The fields spec.securityContext.seccompProfile.type, spec.containers[*].securityContext.seccompProfile.type, spec.initContainers[*].securityContext.seccompProfile.type, and spec.ephemeralContainers[*].securityContext.seccompProfile.type must be set to `RuntimeDefault` or `Localhost`.anyPattern:- spec:securityContext:seccompProfile:type: RuntimeDefault | Localhost"=(ephemeralContainers)":- "=(securityContext)":"=(seccompProfile)":"=(type)": RuntimeDefault | Localhost"=(initContainers)":- "=(securityContext)":"=(seccompProfile)":"=(type)": RuntimeDefault | Localhostcontainers:- "=(securityContext)":"=(seccompProfile)":"=(type)": RuntimeDefault | Localhost- spec:"=(ephemeralContainers)":- securityContext:seccompProfile:type: RuntimeDefault | Localhost"=(initContainers)":- securityContext:seccompProfile:type: RuntimeDefault | Localhostcontainers:- securityContext:seccompProfile:type: RuntimeDefault | Localhost
This policy performs some best practices validation on Application fields. Path or chart must be specified but never both. And destination.name or destination.server must be specified but never both.
This policy prevents the use of the default project in an Application.
This policy prevents updates to the project field after an Application is created.