TMA-AKS-AUTOMATIC-4.2.2
Minimize the admission of containers wishing to share the host process ID namespace
Beschreibung
Minimize the admission of Pods that request spec.hostPID=true so that only tightly controlled, explicitly approved platform workloads can share the host process ID namespace in AKS. Users, groups, and service accounts with deployment rights should not be able to create or update workloads that use host PID sharing without an approved exception. Requires kubectl with cluster-wide read access (KUBECONFIG); system namespaces are excluded and listed resources must be remediated or documented as exceptions.
So wird geprüft
Prüfmethode: Shell-Befehl
out=$(kubectl get pods -A -o go-template='{{range .items}}{{.metadata.namespace}} {{.metadata.name}} {{.spec.hostPID}}{{"\n"}}{{end}}') || exit 1
bad=$(printf '%s\n' "$out" | awk -v ex='^(kube-system|kube-public|kube-node-lease|gatekeeper-system|azure-arc)$' 'NF && $1 !~ ex && ($3=="true")')
if [ -z "$bad" ]; then echo compliant; else printf '%s\n' "$bad" | head -n 25; fi- Erwartete Ausgabe
compliant
So wird behoben
Behebungsmethode: Anleitung oder Infrastruktur-Patch
AKS Automatic already enforces baseline Pod Security Standards and Deployment Safeguards. Remove spec.hostPID: true from user workloads that do not have an approved exception. Where an exception is required, use an approved namespace exclusion and limit who can manage it. Deployment Safeguards are already enabled in Enforce mode. Use Azure Policy only when additional centralized policy requirements are needed. Validate required workloads after making changes.
Eigenschaften
- Betriebssysteme
- Beliebig
- Tags
- aks-automaticpoliciespod-security
- Referenz
- CIS Azure Kubernetes Service Automatic (AKS Automatic) Benchmark v1.0.0 - 4.2.2 Minimize the admission of containers wishing to share the host process ID namespace
Diesen Host prüfen
Führen Sie dies auf einem Rechner aus, den Sie prüfen dürfen. Der Scan ist schreibgeschützt.
tmaegis scan --target aks-automatic