🇰🇷 한글 설명
Kubewarden policies의 trusted-repos-policy는 2.1.2 이전 버전에서 이미지의 registry 호스트명을 대소문자 구분하여 거부/허용 목록과 비교합니다. DNS 호스트명은 대소문자를 구분하지 않으므로, 대문자나 혼합 대소문자로 된 호스트명을 사용하면 거부 목록 규칙을 우회할 수 있습니다. 이 우회는 거부 목록(reject list) 설정에서만 발생하며, 허용 목록(allow list) 설정은 오히려 과도하게 차단하는 방식으로 안전하게 동작합니다.
💡 쉬운 설명
쿠버네티스 보안 정책이 주소의 대문자와 소문자를 구분하지 못해, 금지된 저장소도 글자 모양만 바꾸면 통과될 수 있습니다. 이 문제는 금지 목록을 쓰는 환경에서만 발생하며 2.1.2 버전에서 수정되었습니다.
🇺🇸 원문 (English)
Kubewarden policies is a collection of WebAssembly policies for securing and governing Kubernetes clusters. For versions provisionally classified as affected before 2.1.2, `trusted-repos-policy` compares an image's `registry` hostname against `reject lists` and `allow lists` case-sensitively even though `registry` DNS names are case-insensitive. An image with an uppercase or mixed-case `registry` hostname can miss a rejection rule for the equivalent lowercase host, so the admission policy accepts a resource whose container runtime pulls the same prohibited image. Only reject-list configurations have this bypass: allow-list configurations fail closed by over-denying differently cased hostnames. The security consequences depend on the configured rejection policy and deployment environment. This issue is fixed in version 2.1.2.
📍 영향받는 시스템
Kubewarden policies 2.1.2 미만 버전의 trusted-repos-policy를 거부 목록 방식으로 사용하는 환경
⚔️ 공격 벡터
금지된 레지스트리 호스트명을 대문자 또는 혼합 대소문자로 표기한 이미지를 배포하여 거부 규칙을 우회
🛡️ 대응 방법
Kubewarden policies를 2.1.2 이상으로 업그레이드하거나, 허용 목록 방식으로 전환하세요
🔧 검증 코드
출력된 정책의 모듈 이미지 태그 버전을 확인하여 2.1.2 미만이면 취약하며, 2.1.2 이상이면 패치된 것입니다.
kubectl get clusteradmissionpolicies -A -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.spec.module}{"\n"}{end}' 2>/dev/null | grep -i trusted-repos