Compliance

Phase 1, Phase 2, then keep it running

A fixed-price gap analysis, remediation through to your audit, and upkeep after it. All in a workspace you keep.

All compliance
Security

Find it before a buyer does

Testing, assessments and security leadership, run by the researcher who found the Mirai botnet kill switch.

All security
Industries

Prove you are secure

To the people you sell to, raise from or answer to.

All industries
Resources

Learn the space

Original research, free tools and plain-language guides, from a published security researcher.

Read the blog
Guides

Google Cloud IAM Least Privilege for Small Teams

On this page, 10 sections
  1. Why basic roles are the first thing to go
  2. Step 1: see who has what
  3. Step 2: grant to groups, not people
  4. Step 3: separate production from development
  5. Step 4: choose predefined roles that match the work
  6. Step 5: deal with service accounts
  7. Step 6: move secrets into Secret Manager
  8. Step 7: log it and review it
  9. A practical order for a small team
  10. Common questions

Google Cloud IAM least privilege for a small team means replacing the broad Owner and Editor roles with predefined roles that match each person's actual work, granting them to groups rather than individuals, separating production from development into different projects, removing service account keys in favour of keyless authentication, and keeping secrets in Secret Manager. Each step is achievable in days, not months.

Small teams usually start on Google Cloud the fast way: everyone is an Owner or Editor, one shared project holds everything, and a service account key sits in a configuration file so the app can deploy. That works until someone leaves, a laptop is stolen or a key lands in a public repository. This guide covers how to move to least privilege without slowing the team down, in the order that removes the most risk first.

Why basic roles are the first thing to go

Google Cloud has three basic roles: Owner, Editor and Viewer. They predate the fine-grained role system and they are very broad. Editor can change almost every resource in a project. Owner can do that and also grant access to anyone else. On a small team these roles get handed out because they make every permission error go away.

The cost is that every Editor account is a full path to production. If one of those accounts is phished, or belongs to a contractor who left months ago, the attacker inherits everything. In our fractional CISO engagement with an early-stage aviation marketplace, the product ran on Google Cloud and engineering was largely done by contractors. Google Cloud access was reorganized around least privilege early: broad owner and editor roles were replaced with narrower roles for the work each person actually did.

Step 1: see who has what

Before changing anything, export the current IAM policy for your organization, folders and projects. For each binding note the principal, the role and where it is granted. Look specifically for:

  • Anyone holding Owner or Editor.
  • Personal email addresses, such as consumer Gmail accounts, rather than company accounts.
  • Accounts belonging to people who have left.
  • Service accounts holding Owner or Editor, including default service accounts.
  • Roles granted at the organization or folder level, which apply to every project underneath.

Google Cloud's IAM recommender also suggests narrower roles based on the permissions each principal has actually used over recent weeks. It is a useful starting point, though it should be reviewed rather than applied blindly.

Step 2: grant to groups, not people

Create groups in your identity provider that reflect jobs, for example backend engineers, infrastructure, data and billing. Grant IAM roles to those groups, then manage membership in the identity provider.

This does two things. It keeps the IAM policy short enough to read, and it makes offboarding one action: remove someone from their groups, or suspend their account, and their cloud access goes with it. In the aviation engagement, sign-in to the cloud console went through company Workspace accounts and access was granted by role, which is why contractor access could end the same day an engagement did.

Also set the domain restricted sharing organization policy so that IAM roles can only be granted to accounts in your own domain. That stops anyone from adding a personal Gmail account to a project.

Step 3: separate production from development

The cheapest isolation boundary in Google Cloud is the project. Put production in its own project, separate from development and staging, ideally under a folder structure that makes the split obvious.

  • Developers can have broad roles in a development project where mistakes do not touch customers.
  • Production access is narrower and held by fewer people.
  • Production data is not copied into development.

In the aviation engagement, production and development were separated so that a mistake in testing could not reach live bookings. For a startup, that single change often removes more risk than any number of fine-grained role tweaks.

Free weekly email

Get The Compliance Brief every Tuesday

One email a week from Jacob Masse: the security and compliance stories that changed something that week, and what each one means if you sell software to enterprise buyers. Five stories, a take on each, five minutes to read.

Free. Unsubscribe in one click, and replies reach Jacob directly. Read the latest issue or browse the archive.

Step 4: choose predefined roles that match the work

Google Cloud has predefined roles for most services, each scoped to a job. Map each group to the smallest set that lets it work:

  • Engineers who deploy to Cloud Run might need a Cloud Run developer role and the ability to act as the runtime service account, not project-wide Editor.
  • People who read logs need a logs viewer role, not Viewer on everything.
  • Whoever manages billing needs billing roles, not Owner.
  • Very few people need to change IAM itself. Keep that power with one or two named people.

Write custom roles only when no predefined role fits. Custom roles need maintenance as services add permissions.

Break-glass and temporary access

Someone will occasionally need broad access to fix an incident. Rather than leaving that access in place permanently, grant it temporarily. IAM conditions can attach an expiry time to a role binding, and Google Cloud's Privileged Access Manager supports just-in-time requests with approval. At minimum, keep a documented break-glass account with strong protection and alerting on its use.

Step 5: deal with service accounts

Service accounts are where least privilege is most often lost.

Remove long-lived keys

A service account key is a long-lived credential file. It does not expire on its own, it is not protected by your team's 2-Step Verification, and it tends to end up in places it should not: laptops, CI variables, configuration files and occasionally public repositories. In the aviation engagement, service account keys were reduced and rotated as part of the cloud clean-up.

  • For workloads running on Google Cloud, attach the service account to the resource and let it obtain short-lived credentials automatically.
  • For CI/CD running outside Google Cloud, such as GitHub Actions, use Workload Identity Federation instead of a key.
  • Once no key is needed, enforce the organization policy that blocks service account key creation.
  • For any key you cannot yet remove, record who owns it and rotate it on a schedule.

One service account per workload

Give each service its own service account with only the roles it needs. A single shared service account with Editor means every service can reach every resource. Check the default compute service account in particular: in older projects it may still hold Editor.

Step 6: move secrets into Secret Manager

Database passwords, API keys for payment and messaging providers, and signing keys belong in Secret Manager, with access granted per secret to the service account that needs it. That gives you access control, versioning for rotation and a log of who read each secret. In the aviation engagement, secrets moved into a managed secret store rather than configuration files. Our guide on secrets management for startups covers the migration.

Step 7: log it and review it

  • Admin Activity audit logs are on by default and record IAM changes. Make sure someone knows where to find them.
  • Consider turning on Data Access logs for services holding sensitive data, mindful of log volume and cost.
  • Set an alert for changes to IAM policy on the production project and for any new service account key.
  • Review IAM bindings every quarter against your list of current staff and contractors. Our guide on running an access review covers how to record it.

A practical order for a small team

  1. Remove departed users and personal accounts. One afternoon.
  2. Split production into its own project if it is not already.
  3. Create groups and move bindings onto them.
  4. Replace Owner and Editor in production with predefined roles.
  5. Replace service account keys with attached service accounts and Workload Identity Federation.
  6. Move secrets into Secret Manager.
  7. Turn on alerts and schedule quarterly reviews.

If you want an outside view of how your project is set up, a cloud security assessment reviews IAM along with network exposure, logging and data storage, and our cloud security guide for SaaS covers the wider picture.

Common questions

Is it bad to give developers the Editor role in Google Cloud?

In a development project with no customer data, it is often acceptable. In production, Editor is too broad, because it lets one compromised account change almost anything. Replace it with predefined roles that match the work, and keep production access to fewer people.

How do we deploy from GitHub Actions without a service account key?

Use Workload Identity Federation. GitHub issues a short-lived token for each workflow run, and Google Cloud exchanges it for short-lived credentials for a specific service account. No long-lived key is stored anywhere.

How often should we review Google Cloud IAM?

Quarterly is a good default, with immediate removal when someone leaves handled separately through offboarding. Teams with frequent contractor changes may want to review monthly.

Do we need custom roles?

Rarely at a small company. Predefined roles cover most jobs. Use custom roles only when a predefined role is clearly too broad for a sensitive task and no narrower one exists.

If your team grew up on Owner and Editor and you want help getting to least privilege without breaking deployments, book a free call.

Want your cloud access cleaned up and kept that way? Our fractional CISO service starts from $2,500 a month.

See the fractional CISO serviceOr book a free call

Before you go

Want the rest of this by email?

If this was useful, I send a few short notes on security posture. Unsubscribe in one click, and replies reach me directly.

From Jacob Masse, Principal of TrazTech: the files by email, then a few short notes over the next month. No spam, unsubscribe in one click.