Workload Identity Federation
“Secretless” authentication where a workload proves its identity with a short-lived, platform-issued token or certificate (GitHub Actions OIDC, EKS IRSA/Pod Identity, IAM Roles Anywhere) and exchanges it for temporary cloud credentials, so there is no static key to leak — but the trust policy becomes the secret.
How it works
The workload never holds a long-lived credential. Instead:
- The platform issues a signed identity assertion per job/pod/host — a JWT from
https://token.actions.githubusercontent.com, a projected service-account token, or an X.509 cert. - The cloud verifies issuer + claims against a trust policy and returns STS session credentials (
sts:AssumeRoleWithWebIdentity/CreateSession). - Credentials expire in minutes to hours; nothing durable to commit, bake into images or leave on runners.
AWS Well-Architected SEC02-BP03 frames the order: remove the credential, replace it with short-term alternatives (roles), and only store/rotate what is left in Secrets Manager.
GitHub Actions → AWS
permissions:
id-token: write # allow the job to request the OIDC JWT
contents: read
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789012:role/deploy-prod
aws-region: eu-west-1Relevant token claims: sub (e.g. repo:octo-org/octo-repo:environment:prod or …:ref:refs/heads/main), aud (overridden to sts.amazonaws.com by the AWS action), iss, repository_owner_id, job_workflow_ref. Repos created after 15 July 2026 get an immutable default sub that includes owner and repo IDs, which defeats rename/re-registration confusion. Org admins can add repository custom properties as repo_property_* claims for ABAC.
Trust-policy pitfalls
| Policy condition | Problem |
|---|---|
sub matches repo name without pinning owner (codecentric’s “unsecure” example) | A push to a same-named repo owned by any user can assume the role |
sub/aud not both verified | codecentric and GitHub both make the subject + audience check the core control |
| Role is over-permissive (can create IAM roles/stacks) | A stolen token or compromised workflow becomes account takeover (UNC6426 below) |
Pin owner + repo (+ environment or protected branch) in sub, and scope the role to the job.
Other federation forms
- IAM Roles Anywhere — on-prem/hybrid workloads present an X.509 cert from a registered trust anchor; Subject/Issuer/SAN fields become
aws:PrincipalTag/x509Subject/CN,x509Issuer/O,x509SAN/DNSfor policy conditions; SPIFFE IDs supported. - EKS IRSA — projected token at
/var/run/secrets/eks.amazonaws.com/serviceaccount/token+AWS_ROLE_ARN→AssumeRoleWithWebIdentity. EKS Pod Identity — agent at169.254.170.23withAWS_CONTAINER_AUTHORIZATION_TOKEN_FILE. Both are still credential endpoints an attacker with pod code execution or SSRF in Kubernetes and Containers can use.
Notable cases
- UNC6426 (2025–26) — a developer’s GitHub token stolen by the nx/QUIETVAULT stealer; the actor used Nord Stream to pull CI secrets, generated STS tokens for an overly permissive
Github-Actions-CloudFormationrole through the GitHub→AWS OIDC trust, then deployed a stack withCAPABILITY_NAMED_IAMto create an admin role — full AWS compromise in 72h. Federation removed static keys but the role’s blast radius was unchanged. - agent-framework
.pthstealer (Nov 2026) — code running inside a pipeline can mint federation tokens itself. Inside Azure DevOps it POSTed toSYSTEM_OIDCREQUESTURIwithSYSTEM_ACCESSTOKENforapi://AzureADTokenExchange(without theserviceConnectionIdMicrosoft’s flow uses, so usefulness is unclear); in GitHub Actions (1.26.2) it calledACTIONS_ID_TOKEN_REQUEST_URLwith audiencesapi://AzureADTokenExchangeandhttps://management.azure.com/; on Azure hosts it requested managed-identity tokens fromIDENTITY_ENDPOINT/IMDS for 12 resources (ARM, Graph, Key Vault, Storage, ACR, Azure DevOps…). A usable token carries the service connection’s Azure role assignments, resource-group or subscription wide (Elastic). - ARTEX-Harvester (Oct–Nov 2026) — compromised VCS credentials let an agentic operator push branches that abused CI workload-identity trust into the cloud, then run workflows that dumped CI secrets and Terraform state (Wiz; Agentic Offensive Frameworks). Branch-based trust (
ref:subjects any pusher can satisfy) is the gap; pin to protected environments. - GitHub PAT → Actions → cloud (Wiz CIRT) — attackers with a write PAT add workflows that run with the repo’s cloud trust; workflow logs are rarely in the SIEM and are deleted afterward. See GitHub Actions Security.
Defenses / review checklist
- No IAM users or access keys for CI; one role per repo/environment, least privilege, no IAM write.
- Trust policy pins
subto owner/repo and a protected environment or branch; prefer ID-based subjects. - Require GitHub environments with reviewers for prod roles; treat
pull_request_targetand fork PRs as untrusted (Pwn Requests). - Log and alert on
AssumeRoleWithWebIdentityfrom unexpectedsubvalues. - OIDC does not cover everything: database passwords and third-party API keys still need Vaults and Secret Stores (OWASP).
Related
- Secrets Management
- Leaked Cloud Credentials · Vaults and Secret Stores · Credential Rotation and Revocation
- GitHub Actions Security · CI-CD Pipeline Attacks · OpenID Connect Security
Sources
- Elastic — We caught the agent-framework PyPI compromise six minutes after it published · original
- Wiz — Agentic Attacks: In The Wild · original
- OIDC Security Hardening for GitHub Actions · original
- Secretless GitHub Actions to AWS via OIDC · original
- AWS IAM Roles Anywhere Workload Identities · original
- SEC02-BP03 Store and use secrets securely · original
- The many ways to obtain credentials in AWS · original
- UNC6426 Exploits nx npm Supply-Chain Attack to Gain AWS Admin Access · original
- Code to Cloud Attacks: From GitHub PAT to Cloud Control Plane · original
- Secrets Management - OWASP Cheat Sheet Series · original
- Practical steps to minimize key exposure using AWS Security services · original