More Info:
Restrict IAM permissions so only required users and service accounts have write access to container image repositories. Broad storage-admin roles allow tampering with image content.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS GKE
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify over-privileged principals at the project level
- Run on any machine with
gcloudaccess: - For each returned
member, document which applications, CI pipelines, or teams depend on that access and whether they truly need write or admin rights to container images.
- Run on any machine with
-
Review and adjust project-level IAM for GCR/AR access
- If a principal does not require broad storage admin or legacy write roles, update the project IAM policy file instead of editing individual bindings ad hoc.
- Export the current policy:
- Edit
/tmp/${PROJECT_ID}-iam-policy.yamland remove or narrow any bindings that grant:roles/storage.adminroles/storage.objectAdminroles/storage.objectCreatorroles/storage.legacyBucketOwnerroles/storage.legacyBucketWriterroles/storage.legacyObjectOwner
where they are not strictly required for image publishing/management.
- Re-apply the policy:
-
Tighten GCR bucket-level permissions (if using GCR)
- Determine the GCR bucket name, typically:
artifacts.${PROJECT_ID}.appspot.com. - Show current IAM on the bucket:
- For any principal that only needs read access, first grant a read-only role if not already present, for example:
- Then remove over-privileged roles from the bucket:
- Adjust
user:toserviceAccount:and the role string as appropriate for each principal you identified.
- Determine the GCR bucket name, typically:
-
Restrict Artifact Registry repository IAM (if using AR)
- List repositories to identify which hold container images:
(Repeat with other locations as needed.)
- For each repository that stores container images, get its current IAM policy:
- Review bindings and ensure only the minimal required users/service accounts have write or admin roles (for example, CI/CD or image promotion jobs). Remove wide groups or general-purpose accounts that do not need image write access.
- After editing
/tmp/${REPO_NAME}-iam-policy.yaml, apply it:
- List repositories to identify which hold container images:
-
Confirm remaining write access is justified and scoped
- For each principal that still has write or admin access (project-level, bucket-level, or AR repo-level), document:
- What pipeline or workload uses it (e.g., image build, promotion, security scanning).
- Why write access cannot be further reduced (e.g., needs only
artifactregistry.repoAdminon a single repo instead of project-level storage admin).
- Where possible, replace direct user accounts with dedicated service accounts scoped to a single project or repository and used only from CI/CD or automation.
- For each principal that still has write or admin access (project-level, bucket-level, or AR repo-level), document:
-
Re-run the audit to verify reduction of broad roles
- Run again on any machine with
gcloudaccess: - Confirm that:
- No general-purpose users, broad groups, or unrelated service accounts retain these roles.
- Any remaining use of these roles is explicitly reviewed and accepted as a justified exception.
- Run again on any machine with
Using kubectl
Using kubectl
kubectl cannot be used to change IAM permissions on Google Cloud container image repositories; these settings are managed at the cloud project / Artifact Registry / GCR level via gcloud, gsutil, or IaC. Perform the remediation in the cloud provider configuration instead, following the guidance in the Manual Steps section.
Automation
Automation

