Windows pods offer the ability to run HostProcess containers which enables privileged access to the Windows node. Privileged access to the host is disallowed in the baseline policy. HostProcess pods are an alpha feature as of Kubernetes v1.22. This policy ensures the `hostProcess` field, if present, is set to `false`.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: disallow-host-processannotations:policies.kyverno.io/title: Disallow hostProcesspolicies.kyverno.io/category: Pod Security Standards (Baseline)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: Windows pods offer the ability to run HostProcess containers which enables privileged access to the Windows node. Privileged access to the host is disallowed in the baseline policy. HostProcess pods are an alpha feature as of Kubernetes v1.22. This policy ensures the `hostProcess` field, if present, is set to `false`.spec:validationFailureAction: Auditbackground: truerules:- name: host-process-containersmatch:any:- resources:kinds:- Podvalidate:message: HostProcess containers are disallowed. The fields spec.securityContext.windowsOptions.hostProcess, spec.containers[*].securityContext.windowsOptions.hostProcess, spec.initContainers[*].securityContext.windowsOptions.hostProcess, and spec.ephemeralContainers[*].securityContext.windowsOptions.hostProcess must either be undefined or set to `false`.pattern:spec:"=(ephemeralContainers)":- "=(securityContext)":"=(windowsOptions)":"=(hostProcess)": "false""=(initContainers)":- "=(securityContext)":"=(windowsOptions)":"=(hostProcess)": "false"containers:- "=(securityContext)":"=(windowsOptions)":"=(hostProcess)": "false"
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.