Least privilege for Cloud Run means a dedicated service identity, Cloud Run Invoker per service and Developer for deploys
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Cloud Run splits deploying a service from invoking it. Google's documentation, read 16 Nov 2026, says deploying needs Cloud Run Developer, Artifact Registry Reader and Service Account User on the service identity, and warns that Service Account User lets a holder act as that identity.
Open the calculator ยท All services
Cloud Run has three separate grants: deploy, invoke and run-as
Google's documentation lists four predefined roles. Cloud Run Admin (roles/run.admin) gives full control over all Cloud Run resources. Cloud Run Developer (roles/run.developer) gives read and write access to all Cloud Run resources. Cloud Run Viewer (roles/run.viewer) views the state of all resources, including IAM policies. Cloud Run Invoker (roles/run.invoker) invokes services and instances and runs jobs.
All four can be granted on a Cloud Run service or job, not only on the project, so a deployer or invoker can be limited to one service.
The third grant is the identity the service runs as. Deploying with a service identity needs iam.serviceAccounts.actAs on it.
The identities that call this service (people, services, workloads, third parties) are covered in the Google Cloud service identities guide and the workload identities guide.
Roles and settings to avoid, with the documented reason
The documented cautions concern impersonation and public access.
- Service Account User with a powerful service identity: Google's caution says assigning it indirectly grants the role of the service identity to the user. Its example is a service identity with the Editor role, which lets a user act as an Editor. Google recommends least privilege on the service identity itself.
- Cloud Run Admin on a project: full control of every Cloud Run resource in it, including policies.
- Granting roles/run.invoker to allUsers: Google's Cloud Functions page shows this binding as the way to allow unauthenticated invocation; use it only for intentionally public endpoints.
- Basic roles on the project: highly permissive, per Google, and broader than any Cloud Run role.
A minimal binding to deploy one service
Google's documentation lists the roles a deployer account needs, each on a specific resource.
| Role | Resource | Permission it brings |
|---|---|---|
| roles/run.developer | The Cloud Run resource | run.services.create, run.services.update, run.services.get, run.operations.get |
| roles/artifactregistry.reader | The Artifact Registry repository holding the image | artifactregistry.repositories.downloadArtifacts |
| roles/iam.serviceAccountUser | The Cloud Run service identity | iam.serviceAccounts.actAs |
| roles/run.invoker | The one service, for callers | run.routes.invoke, run.instances.invoke, run.jobs.run |
Resource-level grants and a dedicated identity narrow access
Create a dedicated service identity for each service and grant it only what that service calls, so a deploy permission cannot be turned into a broad role. Grant Invoker per service to named callers rather than all authenticated users.
Google's IAM Conditions page says only some resource types accept conditions in role bindings. Where Cloud Run bindings do not accept a condition, place a conditional grant at the project or organization level instead, as that page describes.
Checking what is used
The IAM recommender lists excess permissions on principals using 90 days of usage, and it includes service accounts, according to Google's documentation. Check the service identity of each Cloud Run service with it.
Then list IAM policies on each service with the Viewer role's view of policies, and remove invoker grants for callers that no longer call.
Two follow-up checks are worth scheduling. First, list which service identity each Cloud Run service uses, and confirm that no service shares the default identity with unrelated workloads. Second, list the principals holding Service Account User on each identity, because Google's caution means each of them can act with that identity's roles. Removing a stale Service Account User grant removes a path to the identity without touching the service.
Related pages
Sources
- Cloud Run IAM roles, read 16 Nov 2026
- Cloud Functions access with IAM, read 16 Nov 2026
- IAM Conditions overview, read 16 Nov 2026
- Role recommendations overview, read 16 Nov 2026
Last reviewed 16 Nov 2026.