🇰🇷 한글 설명
Kubernetes의 ServiceAccount admission plugin이 강제하는 마운트 가능 시크릿 정책을 우회할 수 있는 보안 취약점입니다. envFrom 필드가 있는 컨테이너, init 컨테이너, ephemeral 컨테이너를 사용하면 서비스 어카운트의 시크릿 필드에 지정된 시크릿만 참조하도록 제한되는 정책을 무시할 수 있습니다.
💡 쉬운 설명
Kubernetes에서 서비스 어카운트가 사용할 수 있는 시크릿을 제한하는 보안 정책이 있는데, 특정 방식의 컨테이너 설정을 사용하면 이 제한을 우회할 수 있습니다. 이는 승인되지 않은 민감한 정보에 접근할 수 있게 만들어 보안을 약화시킵니다.
🇺🇸 원문 (English)
A security issue was discovered in Kubernetes where users may be able to launch containers that bypass the mountable secrets policy enforced by the ServiceAccount admission plugin when using containers, init containers, and ephemeral containers with the envFrom field populated. The policy ensures pods running with a service account may only reference secrets specified in the service account’s secrets field. Kubernetes clusters are only affected if the ServiceAccount admission plugin and the kubernetes.io/enforce-mountable-secrets annotation are used together with containers, init containers, and ephemeral containers with the envFrom field populated.
📍 영향받는 시스템
Kubernetes clusters with ServiceAccount admission plugin and kubernetes.io/enforce-mountable-secrets annotation enabled
⚔️ 공격 벡터
envFrom 필드를 포함한 컨테이너, init 컨테이너, 또는 ephemeral 컨테이너를 배포하여 허용되지 않은 시크릿 참조
🛡️ 대응 방법
Kubernetes를 최신 패치 버전으로 업데이트하거나 정책 기반 컨테이너 사양 검증 도입
🔧 검증 코드
출력에서 각 pod의 envFrom으로 참조되는 시크릿 이름을 확인하고, 해당 서비스 어카운트의 허용된 시크릿 목록과 비교하여 정책 위반 여부 확인
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.spec.containers[*].envFrom[*].secretRef.name}{"\n"}{end}'