More Info:
Set up the kubeconfig file appropriately and restrict cluster access so users have only the minimum permissions needed, preferring read-only access where possible.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS OKE
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify how access is granted to the cluster
- On any machine with access to your tenancy, list all OKE clusters and note which IAM groups/users use them (via tags, naming, or documentation).
- In OCI Console: Developer Services → Kubernetes Clusters (OKE) → each cluster → Access Cluster, and note which IAM policies reference those compartments.
- In Terraform (if used), inspect all
oci_containerengine_cluster,oci_identity_policy, andoci_containerengine_cluster_kube_configresources to see who is granted access.
-
Review OCI IAM policies that permit OKE access
- In OCI Console: Identity & Security → Policies → search for statements with verbs related to OKE and Kubernetes access, for example
use cluster-family,manage cluster-family,use kubeconfig. - For each policy, record:
- The group(s)/dynamic group(s) it applies to.
- Whether it allows broad access (e.g.
manage all-resourceson the compartment/tenancy) versus specific OKE-related verbs.
- Decide which groups should be read-only versus admin/maintainer for OKE.
- In OCI Console: Identity & Security → Policies → search for statements with verbs related to OKE and Kubernetes access, for example
-
Inspect generated kubeconfig files and bound identities
- On any machine with kubectl access, list configured contexts and clusters:
- For each user/context, determine whether the underlying OCI principal is a user or instance principal (from how the kubeconfig was created and from OCI CLI configuration in
~/.oci/config). - Map each user/context back to an OCI IAM group or dynamic group discovered in step 2.
- On any machine with kubectl access, list configured contexts and clusters:
-
Evaluate Kubernetes RBAC for those identities
- On any machine with kubectl access, gather RBAC assignments:
- In these files, look for
subjectsthat match the identities used in kubeconfig (service accounts, users, groups). - For each subject, verify whether the bound
Role/ClusterRoleis:- Read-only (e.g. only
get,list,watch) or - Broad/admin (e.g.
*verbs, built‑incluster-admin,edit,admin).
- Read-only (e.g. only
- Flag any identities that don’t need full privileges but are bound to admin or overly broad roles.
- On any machine with kubectl access, gather RBAC assignments:
-
Adjust access to minimize privileges (prefer read-only)
- In OCI IAM (console or IaC), for groups that should only have read-only cluster access, replace broad policy statements with least-privilege ones (for example,
inspect/readlevel verbs on OKE resources instead ofmanage all-resources). - In your IaC (Terraform or similar), update:
- Any
oci_identity_policyresources to narrow actions and scopes. - Any automation that generates kubeconfigs so that:
- Only appropriate groups/users can generate admin kubeconfigs.
- Others get kubeconfigs aligned with read-only RBAC where possible.
- Any
- In Kubernetes RBAC (via manifests in IaC), ensure:
- Operational/admin identities are bound to admin roles as required.
- Other identities are bound to custom or built-in read-only roles (
viewor custom roles with onlyget,list,watch). - Remove or downgrade unnecessary
cluster-admin/editbindings.
- In OCI IAM (console or IaC), for groups that should only have read-only cluster access, replace broad policy statements with least-privilege ones (for example,
-
Re-verify effective access
- From a sample read-only user’s environment, confirm access is limited:
- Ensure:
- Read operations (
get,list,watch) required for that user are allowed. - Mutating operations (
create,update,patch,delete) and wildcard verbs/resources are denied for users that should be read-only.
- Read operations (
- Repeat for admin/maintainer roles to verify they still have the necessary permissions.
- From a sample read-only user’s environment, confirm access is limited:
Using kubectl
Using kubectl
kubectl cannot be used to change how kubeconfig files are created or how Oracle Cloud Infrastructure access to the cluster is restricted; those settings are controlled in the OCI console / IAM / API key configuration and any associated IaC. To address this finding, follow the guidance in the Manual Steps section for hardening kubeconfig generation and IAM policies.
Automation
Automation
- In sections 2 and 3, any Role/ClusterRole listed has verbs beyond
get,list,watch. - In section 4, any human user or group (from your IdP) that appears is a candidate violation of “read‑only where possible”.
- Use this report together with your cloud/IaC configuration and kubeconfig distribution records to decide where access should be reduced or split into read‑only vs admin profiles.

