RBAC 권한 상승 허용 Role

RBAC의 bind와 escalate 권한은 각각 역할 연결과 역할 정의의 권한 상승 방지 제약을 완화합니다.

설명

RBAC의 bind와 escalate는 역할에 담긴 권한을 다른 주체에 부여하거나 역할 자체를 수정해야 하는 관리자에게만 허용하세요. 바인딩 생성·수정 권한과 bind를 함께 가진 주체는 자신이 갖지 않은 권한을 포함한 역할도 연결할 수 있습니다. 역할 생성·수정 권한과 escalate를 함께 가지면 그런 권한을 역할에 추가할 수 있습니다.

잠재적 영향

이 권한을 일반 계정에 부여하면 해당 계정이 관리할 수 있는 권한의 범위가 본래 업무보다 넓어집니다.

해결 방법

일반 사용자 역할과 관리자 역할을 분리하세요. roles·clusterroles와 rolebindings·clusterrolebindings의 생성·수정 권한을 함께 검토하고, 각 계정이 다른 바인딩을 통해 bind나 escalate를 받는지도 확인하세요.

예시

두 예시는 ClusterRole을 정의합니다. 계정과 역할을 연결하는 바인딩은 생략했습니다.

변경 전

yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: rbac-binder
rules:
  - apiGroups: ["rbac.authorization.k8s.io"]
    resources: ["clusterroles"]
    verbs: ["bind"]
  - apiGroups: ["rbac.authorization.k8s.io"]
    resources: ["clusterrolebindings"]
    verbs: ["create"]

변경 후

yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: not-rbac-binder
rules:
  - apiGroups: ["rbac.authorization.k8s.io"]
    resources: ["clusterrolebindings"]
    verbs: ["create"]

두 번째 역할은 ClusterRoleBinding 생성을 허용하지만 bind는 부여하지 않습니다. 다른 역할에서도 bind를 받지 않은 계정은 자신이 이미 보유한 권한 범위에서만 역할을 연결할 수 있습니다.

참조