TMAegis
Више правила за aks-automatic

TMA-AKS-AUTOMATIC-4.2.2

Minimize the admission of containers wishing to share the host process ID namespace

ВисокаНиво 1Аутоматскаaks-automatic

Опис

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.

Како се проверава

Метод провере: Команда љуске

shell
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
Очекивани излаз
compliant

Како се исправља

Метод исправке: Смерница или закрпа инфраструктуре

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.

Својства

Оперативни системи
Било који
Ознаке
aks-automaticpoliciespod-security
Референца
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

Проверите овај рачунар

Покрените ово на рачунару за који имате дозволу за проверу. Скенирање ради у режиму само за читање.

shell
tmaegis scan --target aks-automatic