Amazon EKS Auto Mode
TMA-EKS-AUTO-4.2.4
Require workload pods to run with hostNetwork set to false
설명
Require workload pods to run with hostNetwork set to false or leave it unset by restricting spec.hostNetwork: true in EKS Auto Mode workload namespaces. In EKS, Pod Security Standards can be applied through the built-in Pod Security Admission controller or an equivalent policy engine, using at least the baseline profile where host network sharing is not approved and restricted for stronger workload namespace hardening. Requires kubectl with cluster-wide read access (KUBECONFIG); system namespaces are excluded and listed resources must be remediated or documented as exceptions.
점검 방법
감사 방식: 셸 명령
out=$(kubectl get pods -A -o go-template='{{range .items}}{{.metadata.namespace}} {{.metadata.name}} {{.spec.hostNetwork}}{{"\n"}}{{end}}') || exit 1
bad=$(printf '%s\n' "$out" | awk -v ex='^(kube-system|kube-public|kube-node-lease)$' 'NF && $1 !~ ex && ($3=="true")')
if [ -z "$bad" ]; then echo compliant; else printf '%s\n' "$bad" | head -n 25; fi- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
Configure Pod Security Admission on workload namespaces so pods that request spec.hostNetwork: true are denied at admission time. For this control, baseline is sufficient because it prohibits hostNetwork, while restricted provides stronger hardening for workload namespaces that can meet the additional requirements. Use enforce' for remediation because it rejects violating pods and use warnandaudit` for visibility but do not treat it as enforcement. Configure each workload namespace to enforce the restricted profile. kubectl label ns $NAMESPACE pod-security.kubernetes.io/enforce=restricted --overwrite If restricted is too disruptive for a valid workload namespace, enforce baseline as the minimum profile for this specific control.
속성
- 운영 체제
- 모두
- 태그
- eks-autopoliciesnetwork
- 참고 자료
- CIS Amazon Elastic Kubernetes Service (EKS) Auto Mode Benchmark v1.0.0 - 4.2.4 Require workload pods to run with hostNetwork set to false
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
tmaegis scan --target eks-auto