Ensure that wildcard use in Kubernetes Roles and ClusterRoles is avoided. While wildcards (∗) simplify granting access to all objects or actions, they are not optimal from a security standpoint. Using wildcards risks granting inadvertent access when new resources or resources from future product versions, are added to the Kubernetes API, violating the Principle of Least Privilege (POLP).
Wildcard use risks providing excessive rights to the Kubernetes API and can lead to inadvertent access when new resources or Custom Resource Definitions (CRDs) are added.
Audit
To determine if wildcards are used for Roles and ClusterRoles within your OCI Kubernetes Engine (OKE) cluster, perform the following operations:
Remediation / Resolution
To implement the Principle of Least Privilege (POLP), replace all uses of the wildcard (∗) in Roles and ClusterRoles with explicitly defined resources, verbs, and apiGroups. This will ensure that principals only possess the exact permissions necessary to perform their specific functions, thus preventing accidental or malicious privilege escalation.
References
- Oracle Cloud Infrastructure Documentation
- Overview of Kubernetes Engine (OKE)
- Managing Kubernetes Clusters
- Setting Up Cluster Access
- Accessing a Cluster Using Kubectl
- About Access Control and Kubernetes Engine (OKE)
- Oracle Cloud Infrastructure CLI Documentation
- compartment list
- cluster list
- cluster create-kubeconfig
- Kubernetes Documentation
- Using RBAC Authorization