🇰🇷 한글 설명
Kubewarden-controller의 AdmissionPolicyGroup 기능이 높은 권한의 Policy Server ServiceAccount를 악용하여 접근 제한된 Kubernetes 리소스 정보를 조회할 수 있게 하는 취약점입니다. Context aware policies가 제약 없이 배포되면서 RBAC 권한을 우회하여 민감한 정보 노출이 가능합니다.
💡 쉬운 설명
Kubernetes 정책 시스템에서 높은 권한으로 실행되는 악의적 정책을 배포하면, 보지 못해야 할 리소스 정보에 접근할 수 있게 되는 문제입니다. 이는 관리자 권한과 일반 사용자 권한 사이의 경계가 무너지는 것을 의미합니다.
🇺🇸 원문 (English)
kubewarden-controller is a Kubernetes controller that allows you to dynamically register Kubewarden admission policies. The policy group feature, added to by the 1.17.0 release. By being namespaced, the AdmissionPolicyGroup has a well constrained impact on cluster resources. Hence, it’s considered safe to allow non-admin users to create and manage these resources in the namespaces they own. Kubewarden policies can be allowed to query the Kubernetes API at evaluation time; these types of policies are called “context aware“. Context aware policies can perform list and get operations against a Kubernetes cluster. The queries are done using the ServiceAccount of the Policy Server instance that hosts the policy. That means that access to the cluster is determined by the RBAC rules that apply to that ServiceAccount. The AdmissionPolicyGroup CRD allowed the deployment of context aware policies. This could allow an attacker to obtain information about resources that are out of their reach, by leveraging a higher access to the cluster granted to the ServiceAccount token used to run the policy. The impact of this vulnerability depends on the privileges that have been granted to the ServiceAccount used to run the Policy Server and assumes that users are using the recommended best practices of keeping the Policy Server's ServiceAccount least privileged. By default, the Kubewarden helm chart grants access to the following resources (cluster wide) only: Namespace, Pod, Deployment and Ingress. This vulnerability is fixed in 1.21.0.
📍 영향받는 시스템
kubewarden-controller 1.17.0 ~ 1.20.x 버전
⚔️ 공격 벡터
AdmissionPolicyGroup을 통해 context aware policies를 배포한 후 Policy Server의 높은 권한을 악용하여 Kubernetes API 쿼리로 RBAC 제한 우회 및 승인되지 않은 리소스 정보 조회
🛡️ 대응 방법
kubewarden-controller를 1.21.0 이상으로 업그레이드 또는 Policy Server ServiceAccount에 최소 권한 원칙 적용
🔧 검증 코드
이미지 태그에서 버전이 1.17.0~1.20.x이면 취약점 있음, 1.21.0 이상 또는 결과 없음이면 안전
kubectl get deployment -n kubewarden kubewarden-controller -o jsonpath='{.spec.template.spec.containers[0].image}' 2>/dev/null | grep -oE 'v(1\.(1[7-9]|20)\.|latest)' && echo 'VULNERABLE' || echo 'Safe or not installed'