mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-21 11:36:50 +00:00
41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: disallow-host-namespaces
|
|
annotations:
|
|
policies.kyverno.io/title: Disallow Host Namespaces
|
|
policies.kyverno.io/category: DoD STIG
|
|
policies.kyverno.io/severity: high
|
|
policies.kyverno.io/description: >-
|
|
STIG V-242386: Containers must not share the host process ID, IPC,
|
|
or network namespace. Sharing host namespaces allows containers to
|
|
access host-level resources and break isolation boundaries.
|
|
spec:
|
|
validationFailureAction: Enforce
|
|
background: true
|
|
rules:
|
|
- name: host-namespaces
|
|
match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Pod
|
|
exclude:
|
|
any:
|
|
- resources:
|
|
namespaces:
|
|
- kube-system
|
|
- rook-ceph
|
|
- istio-system
|
|
- prometheus
|
|
- kyverno
|
|
- crowdsec
|
|
validate:
|
|
message: >-
|
|
Sharing host PID, IPC, or network namespaces is not allowed (STIG V-242386).
|
|
pattern:
|
|
spec:
|
|
=(hostPID): false
|
|
=(hostIPC): false
|
|
=(hostNetwork): false
|