TMAegis
aks 관련 규칙 더 보기

TMA-AKS-4.2.3

Minimize the admission of containers wishing to share the host IPC namespace

높음레벨 1자동aks

설명

Minimize the admission of pods that request spec.hostIPC=true so that only tightly controlled, explicitly approved platform workloads can share the host IPC namespace in AKS. As it relates to RBAC and service accounts, this means users, groups, and service accounts with pod or controller deployment rights should not broadly be able to create or update workloads that enable host IPC sharing, because AKS relies on RBAC to scope what identities can ... 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.hostIPC}}{{"\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

조치 방법

조치 방식: 가이드 또는 인프라 패치

Add policies to each namespace in the cluster which has user workloads to restrict the admission of hostIPC containers. Pod Security Policies and Assignments can be found by searching for Policies in the Azure Portal. A detailed step-by-step guide can be found here: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/policy-for-kubernetes

속성

운영 체제
모두
태그
akspoliciespod-security
참고 자료
CIS Azure Kubernetes Service (AKS) Benchmark v2.0.0 - 4.2.3 Minimize the admission of containers wishing to share the host IPC namespace

이 호스트 점검하기

감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.

shell
tmaegis scan --target aks