Skip to main content

More Info:

Manage access to OKE clusters using OCI IAM combined with Kubernetes RBAC, granting clusterroles such as cluster-admin only to users who require them.

Risk Level

High

Address

Security

Compliance Standards

  • CIS OKE

Triage and Remediation

Remediation

Manual Steps

  1. List current OCI IAM access and admin mappings
    • Where: Any machine with OCI CLI access.
    • Command (list cluster admins via OCI groups/policies):
    • Review: Identify which OCI users/groups/compartments are allowed to access OKE clusters and whether any broad or overly permissive policies exist (for example, tenancy-wide admins or groups with full manage cluster-family where not required).
  2. Enumerate Kubernetes RBAC clusterrolebindings and bindings to cluster-admin
    • Where: Any machine with kubectl access to the cluster (using your own kubeconfig for that user).
    • Commands:
    • Review: Note which users, groups, and service accounts are bound to cluster-admin. Flag bindings that are not clearly required (e.g., generic groups, automation identities that do not need full cluster-wide admin).
  3. Map cluster-admin subjects back to OCI identities and confirm business need
    • Where: Any machine with kubectl and OCI CLI access.
    • Commands (example lookups):
    • Review: For each subject bound to cluster-admin, confirm with application/operations owners that the identity truly requires cluster-wide admin versus narrower roles.
  4. Tighten access: remove unnecessary cluster-admin bindings
    • Where: Any machine with kubectl access.
    • Commands (for each binding you decide is unnecessary):
    • Operational impact: Identities removed from cluster-admin immediately lose cluster-wide admin rights; ensure they have appropriate alternative RBAC before deletion.
  5. Grant cluster-admin only where explicitly justified
    • Where: Any machine with kubectl access.
    • Command (example, per benchmark remediation):
    • Review: Use distinct, descriptive binding names and bind to specific users (or tightly scoped groups) whose need for cluster-admin is documented and approved.
  6. Re-verify effective access and document approvals
    • Where: Any machine with kubectl access.
    • Verification command:
    • Review: Confirm that only the approved list of users/groups/service accounts have cluster-admin, and record the final list and approval in your change management or security documentation.
kubectl cannot remediate this finding because it concerns Oracle Cloud Infrastructure IAM and managed OKE control-plane configuration, which are changed through the OCI Console, OCI CLI, or IaC. To address this finding, follow the guidance in the Manual Steps section for reviewing and adjusting OCI IAM policies and Kubernetes RBAC bindings.
How to run (any machine with kubectl access):
Output that indicates a potential problem (requires human review):
  • Any ClusterRoleBinding with:
    • roleRef.name == cluster-admin and
    • Subject kind=User or Subject kind=Group using:
      • Broad groups (e.g., “Administrators”, “Developers”, generic OCI IAM groups).
      • User OCIDs belonging to people who do not strictly need cluster-admin.
  • Any binding that uses cluster-admin where a narrower role would suffice.
  • Any [WARN] No subjects entries (misconfiguration that may indicate prior mistakes).
Use this report to compare actual subjects (user/group OCIDs) against your OCI IAM design and the least-privilege intent, then adjust OCI IAM policies and/or RBAC bindings manually as appropriate.