Over-permissioned service accounts are how small breaches become large ones in Google Cloud. Google Cloud IAM least privilege means every user and service account gets only the permissions its job requires, nothing more, and those permissions are reviewed regularly. This guide shows how to apply Google Cloud IAM least privilege in practice: auditing what exists today, choosing predefined roles over primitive roles, and using custom roles and conditions where predefined roles are too broad.
You will work at the project level with gcloud, replace Owner and Editor grants with scoped roles, and set up a review habit that keeps permissions from drifting back. The approach works for a single project and scales to folders and organizations.

Prerequisites for Google Cloud IAM Least Privilege
You need a Google Cloud project, the gcloud CLI authenticated with a user who can manage IAM policy, and a list of the people and service accounts that actually use the project. If you do not know who needs access, start with the audit in step one before changing anything, because removing a permission a production service depends on will break it.
Understand the IAM hierarchy: organization, folder, project, and resource. A grant at a higher level flows down to everything below it, so a folder-level Editor grant defeats project-level care. Fix grants from the top down.
Step 1: Audit Current IAM Grants
List the current IAM policy and look for primitive roles first: Owner, Editor, and Viewer. These are the broadest roles in Google Cloud, and Editor in particular grants write access to nearly every service, which almost nobody needs:
gcloud projects get-iam-policy PROJECT_ID \
--format="table(bindings.role, bindings.members)"
Export the full policy to a file for review, and flag every primitive role, every grant to allUsers or allAuthenticatedUsers, and every service account with a role it no longer needs. Service accounts from deleted workloads are a common find: they keep their permissions indefinitely unless someone removes them.
gcloud projects get-iam-policy PROJECT_ID --format=json > iam-before.json
grep -E 'roles/(owner|editor|viewer)' iam-before.json
Step 2: Replace Primitive Roles with Predefined Roles
For each flagged grant, choose the narrowest predefined role that covers the job. A developer who deploys to Cloud Run needs roles/run.developer, not Editor. Someone who reads logs needs roles/logging.viewer, not Viewer at the project level combined with ad-hoc grants. Apply the change with the IAM policy commands:
gcloud projects remove-iam-policy-binding PROJECT_ID \
--member="user:[email protected]" --role="roles/editor"
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="user:[email protected]" --role="roles/run.developer"
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="user:[email protected]" --role="roles/logging.viewer"
For service accounts, the same rule applies, with one addition: a service account should also have a narrow scope for impersonation. Grant roles/iam.serviceAccountUser only to the specific service accounts a user may impersonate, never broadly. After each change, verify the policy again and test the affected workload before moving on.
Step 3: Use Custom Roles and IAM Conditions Where Needed
Sometimes no predefined role fits: a job needs three permissions from one role and two from another, and the union is too broad. Create a custom role with exactly the permissions required, at the project or organization level, and grant that instead:
gcloud iam roles create deployer_limited \
--project=PROJECT_ID \
--title="Limited Deployer" \
--description="Deploy to Cloud Run and read logs only" \
--permissions=run.services.get,run.services.update,logging.logEntries.list \
--stage=GA
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:deploy@PROJECT_ID.iam.gserviceaccount.com" \
--role="projects/PROJECT_ID/roles/deployer_limited"
IAM Conditions add a further dimension: time, resource, or request constraints. For example, grant a role only during business hours, or only for resources with a specific tag. Conditions are powerful but harder to audit, so document every condition in your access review notes and prefer simple conditions over clever ones.
Step 4: Review, Recommend, and Enforce Regularly
Least privilege decays without review. Enable IAM Recommender insights, which suggest role reductions based on actual permission usage over the last 90 days, and act on them monthly:
gcloud recommender recommendations list \
--project=PROJECT_ID \
--location=global \
--recommender=google.iam.policy.Recommender
Schedule a quarterly access review with service owners: confirm each grant is still needed, remove stale service accounts, and check for new primitive roles. For larger organizations, enforce guardrails with organization policies that deny primitive role grants and require approval for new service account keys. A review that nobody schedules will not happen, so put it on the calendar now.
Troubleshooting Google Cloud IAM Least Privilege
If a workload breaks after a role change, the error message usually names the missing permission, such as run.services.get or a storage permission. Add that single permission, preferably via a custom role, rather than restoring the old broad role. Check the audit log to find the exact denied call before guessing.
If a user cannot see a resource they should access, check the hierarchy: a deny policy at the organization or folder level overrides an allow at the project level. List deny policies explicitly, because they are easy to forget and invisible in a simple policy dump.
If IAM Recommender suggests removing a permission that is used rarely but critically, such as a disaster recovery action, keep it and document why. Least privilege is about removing unnecessary access, not about breaking the one job that runs twice a year.
Conclusion
Google Cloud IAM least privilege is a habit, not a one-time cleanup: audit primitive roles, replace them with predefined roles, use custom roles and conditions for the gaps, and review on a schedule. Each step reduces blast radius without slowing legitimate work, provided you change one grant at a time and test after each change. For related identity patterns, see our guides on GKE Workload Identity and Google Cloud firewall rules. The official guide to using IAM securely covers deny policies and best practices in full.