Amazon EKS
TMA-EKS-4.5.2
The default namespace should not be used
설명
Avoid placing application workloads in the default namespace, and instead deploy them into dedicated namespaces that reflect the intended team, application, or environment boundary. In EKS, namespaces are the primary logical partition for organizing workloads and supporting soft multi-tenancy in a shared cluster. Requires kubectl read access; fails when the default namespace holds objects other than the kubernetes Service, kube-root-ca.crt ConfigMap and default ServiceAccount.
점검 방법
감사 방식: 셸 명령
out=$(kubectl get pods,services,configmaps,secrets,serviceaccounts,deployments,statefulsets,daemonsets,jobs,cronjobs,ingresses,roles,rolebindings -n default -o name) || exit 1
bad=$(printf '%s\n' "$out" | grep -v '^$' | sed 's#^\([a-z]*\)\.[^/]*/#\1/#' | grep -Evx 'service/kubernetes|configmap/kube-root-ca\.crt|serviceaccount/default')
if [ -z "$bad" ]; then echo compliant; else printf '%s\n' "$bad" | head -n 25; fi- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
Move user workloads out of the default namespace and place them in dedicated namespaces that reflect the intended team, application, or environment boundary. In EKS, namespaces are the core logical partition for soft multi-tenancy, but they only become meaningful administrative boundaries when they are paired with namespace-scoped access, service accounts, quotas, limits, and network policies. Because namespaced objects are created in default when no namespace is specified, remediation should address both existing workloads and the deployment process that created them there. • Create dedicated namespaces for each team, application, or environment that needs its own administrative scope, then redeploy or migrate user workloads from default into those namespaces.
속성
- 운영 체제
- 모두
- 태그
- ekspolicies
- 참고 자료
- CIS Amazon Elastic Kubernetes Service (EKS) Benchmark v2.0.0 - 4.5.2 The default namespace should not be used
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
tmaegis scan --target eks