Join our Newsletter — 33% off our NHI Course
Home› Guides› Workload Identity Federation Cheat Sheet: OIDC Trust Settings…
Template Cloud & Workload Identity

Workload Identity Federation Cheat Sheet: OIDC Trust Settings per Cloud

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 11 min read
On this page

Workload identity federation removes stored cloud keys from pipelines, but a trust setting that checks only the issuer lets any workload on a shared issuer, such as every GitHub or GitLab.com project in the world, request your credentials. The security of federation lives in a handful of fields: the issuer, the audience, and the subject or claim conditions. Each cloud names and enforces those fields differently. This cheat sheet puts the setting names, audience values and subject condition patterns for AWS, Google Cloud and Microsoft Azure side by side, then lists claim values for common CI providers and the misconfigurations to look for. It is for platform and DevOps engineers who already understand the concept; for the architecture and rollout, see the Workload Identity Federation Guide. Platforms are listed alphabetically.

This is an independent guide from NHI Mgmt Group, based on the public documentation of AWS IAM, Google Cloud IAM and Microsoft Entra, as of November 2026. It is not sponsored or reviewed by any of these vendors. Product features change, so confirm settings against each vendor's current documentation.

Key takeaways

  • Issuer alone is never enough: GitHub Actions, GitLab.com and HCP Terraform use one issuer for all customers, so every trust must also pin your organisation, repository or workspace.
  • Pin the audience: AWS checks aud against the provider's audience list, Google Cloud against allowed audiences, and Entra against exactly one audience value, usually api://AzureADTokenExchange.
  • Prefer immutable IDs: AWS and Google Cloud documentation both recommend numeric IDs such as repository_id and repository_owner_id over names, which can be reclaimed after a rename or deletion.
  • Bind production to a protected environment or branch: a subject ending :environment:production or :ref:refs/heads/main is far tighter than repo:org/repo:*.
  • Watch format changes: GitHub applies an immutable subject format, containing owner and repository IDs, to repositories created, renamed or transferred after 15 July 2026 (older repositories keep the previous format unless they opt in), so exact-match subjects written for the old format will stop matching.

How to use this template

  • Find your cloud section for the exact setting names, then the CI provider table for the claim values to pin.
  • Replace placeholders such as [ORG], [REPO], [PROJECT_NUMBER] and [POOL_ID] with your own values. Never copy example IDs.
  • Start narrow: write the tightest condition that works (one repository, one protected branch or environment), and widen only with a recorded reason.
  • Review existing trusts against the misconfigurations table. See the Workload Identity Federation Trust Review Checklist for a full review routine.
  • Troubleshooting errors such as audience mismatch or "no matching federated identity record" is covered in the Multi-Cloud Workload Identity Troubleshooting Guide.

AWS

AWS federation uses an IAM OIDC identity provider plus a role trust policy that allows sts:AssumeRoleWithWebIdentity.

SettingWhereValue or rule
Provider URLIAM OIDC identity providerMust begin https://, case-sensitive, no port, no query parameters, unique per account. GitHub: https://token.actions.githubusercontent.com
Audience (client ID)IAM OIDC identity providerAt least one, up to 100. Must match the token's aud; if the token carries azp, STS uses azp as the audience. GitHub to AWS convention: sts.amazonaws.com
ThumbprintsIAM OIDC identity providerOne to five. AWS validates the JWKS certificate against trusted root CAs and uses the thumbprint only when the certificate is not CA-signed, cannot be retrieved, or TLS 1.3 is required
PrincipalRole trust policy{"Federated": "arn:aws:iam::[ACCOUNT]:oidc-provider/[HOST]"}; one principal per role
Audience conditionRole trust policyStringEquals on [HOST]:aud
Subject conditionRole trust policyStringEquals (exact) or StringLike (wildcard) on [HOST]:sub. For GitHub, IAM requires the sub key and rejects a value that is only *, ? or null
Provider-specific keysRole trust policyGitHub: repository_id, repository_owner_id, job_workflow_ref, ref, environment, workflow, actor, enterprise_id. GitLab keys such as namespace_id and project_id apply to GitLab.com only

Tight GitHub pattern: StringEquals on token.actions.githubusercontent.com:aud = sts.amazonaws.com, plus either sub = repo:[ORG]/[REPO]:environment:production or the immutable-ID form AWS shows, repository_id = [ID] with ref = refs/heads/main. AWS labels repo:[ORG]/* as the broadest option and not recommended. See How to audit AWS IAM Roles Anywhere and OIDC identity providers.

Google Cloud

Google Cloud federation uses a workload identity pool containing one or more providers, with attribute mappings and a Common Expression Language (CEL) attribute condition, and grants roles to federated principals.

SettingWhereValue or rule
Pool and provider IDsWorkload identity poolFixed after creation; the gcp- prefix is reserved
Issuer URIOIDC providerGitHub https://token.actions.githubusercontent.com/; GitLab.com https://gitlab.com; HCP Terraform https://app.terraform.io; Azure DevOps from the service connection's federation details
Allowed audiencesOIDC providerDefault audience is the provider resource name //iam.googleapis.com/projects/[PROJECT_NUMBER]/locations/global/workloadIdentityPools/[POOL_ID]/providers/[PROVIDER_ID]. Azure DevOps uses application ID fb60f99c-7a34-4190-8149-302f77469936
Attribute mappingOIDC providergoogle.subject is required, maximum 127 characters (GitHub and GitLab: assertion.sub; HCP Terraform: assertion.terraform_workspace_id). Custom: attribute.[NAME]=assertion.[CLAIM]
Attribute conditionOIDC providerCEL expression that must be true; each claim used must be mapped. Google states that a condition restricting your organisation, group or tenant must be added for GitHub, GitLab.com and HCP Terraform
Principal (one identity)IAM bindingprincipal://iam.googleapis.com/projects/[PROJECT_NUMBER]/locations/global/workloadIdentityPools/[POOL_ID]/subject/[SUBJECT]
Principal set (by attribute)IAM bindingprincipalSet://.../workloadIdentityPools/[POOL_ID]/attribute.[NAME]/[VALUE]; avoid the whole-pool form /[POOL_ID]/*
Access modelIAM bindingDirect resource access (Google's recommended default where APIs allow; HCP Terraform uses impersonation) or service account impersonation via roles/iam.workloadIdentityUser

Tight GitHub pattern: map attribute.repository_id=assertion.repository_id and attribute.repository_owner_id=assertion.repository_owner_id; condition assertion.repository_owner_id=='[OWNER_ID]' && assertion.ref=='refs/heads/main'; bind roles to the principalSet for attribute.repository_id/[ID]. Google recommends the numeric ID claims because names can be reclaimed. See How to move GKE workloads from keys to Workload Identity Federation.

Microsoft Azure

Microsoft Entra ID federation uses a federated identity credential (FIC) on an app registration or a user-assigned managed identity.

SettingWhereValue or rule
issuerFICMust exactly match the token's issuer; up to 600 characters; leading or trailing whitespace breaks the exchange
subjectFICMust exactly match the token's sub; up to 600 characters. Use exact values: wildcard patterns go in a flexible FIC instead
audiencesFICExactly one value; Microsoft recommends api://AzureADTokenExchange
nameFIC3 to 120 URL-friendly characters, starting alphanumeric; immutable
Uniqueness and limitApp or managed identityIssuer plus subject must be unique; up to 20 FICs per app or user-assigned managed identity
claimsMatchingExpressionFlexible FIC (preview as of November 2026)Operators matches (with * and ?), eq, and; subject must be null; languageVersion 1. For GitHub, must match sub plus at least one of repository_id or repository_owner_id. Supported issuers: GitHub, GitLab, Terraform Cloud
Signing algorithmIssuerMicrosoft documents RS256 as the supported signing algorithm

Tight GitHub pattern: one FIC per deployment target with issuer https://token.actions.githubusercontent.com, subject repo:[ORG]/[REPO]:environment:production and audience api://AzureADTokenExchange. Microsoft notes that a wrong subject still saves successfully and only fails at token exchange, and that a newly created FIC can return AADSTS70021 until it replicates. Azure Policy can deny FIC creation on managed identities where federation should not be used. See How to audit Entra workload identity federated credentials and the AKS Workload Identity Guide.

Claim conditions per CI provider

CI providers are listed alphabetically. Values are as documented by each provider in November 2026.

CI providerIssuerDefault sub formatImmutable claims to pinNotes
Azure DevOpsShown in the service connection's workload identity federation detailsService connection specific; longer than 127 characters, so Google maps assertion.sub.split('/sc/')[1]oid (Google condition example: application object ID)Service connections create the Entra FIC; copy issuer and subject from the connection
GitHub Actionshttps://token.actions.githubusercontent.comrepo:[ORG]/[REPO]:environment:[ENV], ...:ref:refs/heads/[BRANCH], ...:ref:refs/tags/[TAG] or ...:pull_request; immutable form repo:[OWNER]@[OWNER_ID]/[REPO]@[REPO_ID]:...repository_id, repository_owner_id; also job_workflow_ref, environment, runner_environmentJob needs id-token: write. Default aud is the owner URL unless set. Subject template customisable via include_claim_keys; update cloud conditions first
GitLab.comhttps://gitlab.comproject_path:[GROUP]/[PROJECT]:ref_type:[TYPE]:ref:[BRANCH]namespace_id, project_id; also ref_protected, environment_protected, deployment_tierToken requested per job in id_tokens with one aud; RS256; expires with the job timeout, or after 5 minutes if none is set
HCP Terraformhttps://app.terraform.ioWorkspace and run based; AWS requires the trust policy to evaluate app.terraform.io:subterraform_organization_id, terraform_workspace_idGoogle maps google.subject to the workspace ID

For branch and environment scoping in more depth, see How to Scope CI OIDC Trust to Branch and Environment and the GitHub Actions OIDC Federation Hardening Guide.

Common misconfigurations

MisconfigurationWhy it mattersFix
No organisation or repository condition on a shared issuerAny customer of that CI service can mint an accepted tokenAWS: pin sub or repository_owner_id; Google Cloud: attribute condition on owner or namespace ID; Azure: exact subject or flexible FIC with an ID claim
Wildcard to the whole organisation (repo:[ORG]/*)Any repository, including new or low-trust ones, can deploy to productionOne trust per repository and environment
Pull request runs trusted for deploy rolesCode from forks or unreviewed branches gets cloud accessMatch only protected branches or environments with required reviewers
Name-based conditions onlyDeleted or renamed organisations and repositories can be re-registered by othersAdd repository_id, repository_owner_id, namespace_id or project_id
Google whole-pool binding (/[POOL_ID]/*)Every identity accepted by every provider in the pool gets the roleBind to a principalSet by attribute, or one principal
Broad audienceTokens minted for another service can be replayedUse the cloud-specific audience only
Subject format changed upstreamGitHub immutable subjects or a custom template stop matching exact conditions, causing outages and rushed wideningPrefer ID claims; update trusts before changing templates
Over-privileged target roleTight trust does not limit what the role can doLeast privilege per pipeline stage; separate plan and apply roles

Monitor the exchanges as well as the settings: AWS CloudTrail records AssumeRoleWithWebIdentity, Google Cloud records Security Token Service token exchanges in Cloud Audit Logs, and Entra records service principal sign-ins. Alert on new or changed providers and FICs, and on exchanges from subjects not seen before. The trust settings in this sheet map to NIST SP 800-53 Rev 5 IA-5 Authenticator Management and AC-6 Least Privilege. See the Top 10 Workload Identity Mistakes.

Practitioner checklist

  • List every OIDC provider, workload identity pool and FIC across all clouds, with owner and purpose.
  • Confirm every trust on a shared issuer pins your organisation, group or tenant.
  • Pin the audience to the cloud-specific value on every trust.
  • Add immutable ID claims (repository, owner, namespace, project or workspace IDs) wherever the cloud supports them.
  • Restrict production roles to protected branches or environments; never trust pull request subjects for deploy roles.
  • Replace Google whole-pool bindings with attribute-scoped principal sets.
  • Check GitHub repositories created, renamed or transferred since 15 July 2026 for the immutable subject format.
  • Alert on provider and FIC changes and on first-seen subjects in token exchange logs.

Standards and references

Related NHI Mgmt Group resources: Workload Identity Federation Guide · Cross-cloud workload identity federation · Workload Identity Federation Trust Review Checklist · Cloud Workload Identity Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.