Files
Homelabv4/infrastructure/kyverno/policies/disallow-host-namespaces.yaml
T
Scooby HuskyandClaude Opus 4.6 131cbca4a6 Fix ArgoCD ServerSideDiff permanent OutOfSync diffs
Add explicit CRD/API defaults to manifests that were causing ArgoCD's
SSA dry-run to produce results different from live state:

- HTTPRoutes: add group, kind, weight defaults to parentRefs/backendRefs
- Kyverno ClusterPolicies: add skipBackgroundRequests, allowExistingViolations
- Tetragon TracingPolicies: add return, maxData, resolve, returnCopy defaults
- Gateway certificateRefs: add group="" default
- Guacamole Gateway: add group="" to certificateRefs

Add ignoreDifferences for resources that legitimately differ:
- Cilium cert Secrets (auto-generated, data always differs)
- Istio ValidatingWebhookConfiguration failurePolicy (istiod mutates)
- Crowdsec LAPI Secrets (randomly generated)
- ServiceMonitor/PodMonitor relabeling action defaults
- StatefulSet volumeClaimTemplates apiVersion/kind defaults

Persist argocd-cm ignoreDifferences config in ArgoCD Helm values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:32:59 -05:00

43 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
skipBackgroundRequests: true
match:
any:
- resources:
kinds:
- Pod
exclude:
any:
- resources:
namespaces:
- kube-system
- rook-ceph
- istio-system
- prometheus
- kyverno
- crowdsec
validate:
allowExistingViolations: true
message: >-
Sharing host PID, IPC, or network namespaces is not allowed (STIG V-242386).
pattern:
spec:
=(hostPID): false
=(hostIPC): false
=(hostNetwork): false