Use short-lived workload credentials
A deployment pipeline outside Google Cloud needs access to one project and has a trusted OIDC issuer. How can it avoid a downloaded service-account key?
Use short-lived workload credentials
Impersonate a service account with the Token Creator role, request a short-lived access token and trace both identities in the audit log.
Work through the decision
A deployment pipeline outside Google Cloud needs access to one project and has a trusted OIDC issuer. How can it avoid a downloaded service-account key?
Check your reasoning
Configure a workload identity pool and provider, restrict the mapped identity or attributes and grant only the target permissions. If impersonating a service account, authorize that exchange and scope the account’s resource roles.
Interpret the evidence
- Workload Identity Federation
- An external workload exchanges a trusted identity assertion for short-lived Google credentials.
- Service Account Token Creator
- An authorized principal with this role on the target account can mint short-lived impersonated credentials.
- Service Account User
- The actAs permission lets a deployer attach the service account to an eligible resource. Resource access is governed by the attached identity’s roles.
- Attached service account
- A workload on a supported Google Cloud resource can obtain credentials for its runtime identity without a key file.
- Workload Identity Federation for GKE
- Grant access to a Kubernetes workload identity or authorize linkage to an IAM service account, avoiding shared node credentials.
Practice the guide skills
- Create a user-managed runtime identity, distinguish it from a Google-managed service agent and identify the minimum resource-level permissions it needs.
- Separate permission to attach the account to a VM from permission to mint tokens and from the account’s own access to the target resource.
- Describe a short-lived impersonation exchange and audit both caller and target. Compare it with an attached runtime identity obtaining credentials from its environment.
- For GKE, identify the Kubernetes service account and its Google Cloud grants. For another cloud, restrict the workload identity pool provider by issuer, audience and mapped attributes.
Official objectives for this lesson
Trace the caller, runtime account and resource
A build system authenticates through a trusted OIDC issuer and uses service-account impersonation. Read the exchange from left to right.
external job → identity provider → workload pool → impersonated service account → artifact repository
Restrict the issuer, audience and attribute mapping to the intended job. Grant the external principal permission to impersonate the target account and grant that account only the repository access the job needs. Verify the delegation chain in audit records.
Related lesson · Share a maintained dataset with controlled subscriptions
Use short-lived workload credentials quiz
Answer 3 questions. Check each answer for an explanation.