Host namespaces (Process ID namespace, Inter-Process Communication namespace, and network namespace) allow access to shared information and can be used to elevate privileges. Pods should not be allowed access to host namespaces. This policy ensures fields which make use of these host namespaces are unset or set to `false`.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: disallow-host-namespacesannotations:policies.kyverno.io/title: Disallow Host Namespacespolicies.kyverno.io/category: Pod Security Standards (Baseline)policies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.6.0kyverno.io/kubernetes-version: 1.22-1.23policies.kyverno.io/subject: Podpolicies.kyverno.io/description: Host namespaces (Process ID namespace, Inter-Process Communication namespace, and network namespace) allow access to shared information and can be used to elevate privileges. Pods should not be allowed access to host namespaces. This policy ensures fields which make use of these host namespaces are unset or set to `false`.spec:validationFailureAction: Auditbackground: truerules:- name: host-namespacesmatch:any:- resources:kinds:- Podvalidate:message: Sharing the host namespaces is disallowed. The fields spec.hostNetwork, spec.hostIPC, and spec.hostPID must be unset or set to `false`.pattern:spec:"=(hostPID)": "false""=(hostIPC)": "false""=(hostNetwork)": "false"
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.
This policy ensures that the name of the ApplicationSet is the same value provided in the project.