| name | cis-gke-autopilot-v130-5.1.3 |
| description | Minimize cluster access to read-only for Container Image repositories (Manual) |
| category | cis-gke-autopilot |
| version | 1.3.0 |
| author | cyberstrike-official |
| tags | ["cis","gke-autopilot","kubernetes","gcp","image-registry","image-scanning","artifact-registry","vulnerability-scanning"] |
| cis_id | 5.1.3 |
| cis_benchmark | CIS Google Kubernetes Engine (GKE) Autopilot Benchmark v1.3.0 |
| tech_stack | ["kubernetes","gcp","gke"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
5.1.3 Minimize cluster access to read-only for Container Image repositories (Manual)
Profile Applicability
Description
Note: GCR is now deprecated, see the references for more details.
Configure the Cluster Service Account with Artifact Registry Viewer Role to only allow read-only access to AR repositories. Configure the Cluster Service Account with Storage Object Viewer Role to only allow read-only access to GCR.
Rationale
The Cluster Service Account does not require administrative access to GCR or AR, only requiring pull access to containers to deploy onto GKE. Restricting permissions follows the principles of least privilege and prevents credentials from being abused beyond the required role.
Impact
A separate dedicated service account may be required for use by build servers and other robot users pushing or managing container images.
Any account granted the Storage Object Viewer role at the project level can view all objects stored in GCS for the project.
Audit
For Images Hosted in AR:
Using Google Cloud Console:
- Go to Artifacts Browser by visiting https://console.cloud.google.com/artifacts
- From the list of repositories, for each repository with Format Docker
- Under the Permissions tab, review the role for GKE Service account and ensure that only the Artifact Registry Viewer role is set.
Using Command Line:
gcloud artifacts repositories get-iam-policy <repository-name> --location <repository-location>
The output of the command will return roles associated with the AR repository. If listed, ensure the GKE Service account is set to "role": "roles/artifactregistry.reader".
For Images Hosted in GCR:
Using Google Cloud Console:
- Go to Storage Browser by visiting https://console.cloud.google.com/storage/browser
- From the list of storage buckets, select
artifacts.<project_id>.appspot.com for the GCR bucket
- Under the Permissions tab, review the role for GKE Service account and ensure that only the Storage Object Viewer role is set.
Using Command Line:
GCR bucket permissions:
gsutil iam get gs://artifacts.<project_id>.appspot.com
The output of the command will return roles associated with the GCR bucket. If listed, ensure the GKE Service account is set to . If the GKE Service Account has project level permissions that are inherited within the bucket, ensure that these are not privileged: