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:

  1. 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.
  2. The cloud verifies issuer + claims against a trust policy and returns STS session credentials (sts:AssumeRoleWithWebIdentity / CreateSession).
  3. 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-1

Relevant 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 conditionProblem
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 verifiedcodecentric 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/DNS for 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 at 169.254.170.23 with AWS_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-CloudFormation role through the GitHub→AWS OIDC trust, then deployed a stack with CAPABILITY_NAMED_IAM to create an admin role — full AWS compromise in 72h. Federation removed static keys but the role’s blast radius was unchanged.
  • agent-framework .pth stealer (Nov 2026) — code running inside a pipeline can mint federation tokens itself. Inside Azure DevOps it POSTed to SYSTEM_OIDCREQUESTURI with SYSTEM_ACCESSTOKEN for api://AzureADTokenExchange (without the serviceConnectionId Microsoft’s flow uses, so usefulness is unclear); in GitHub Actions (1.26.2) it called ACTIONS_ID_TOKEN_REQUEST_URL with audiences api://AzureADTokenExchange and https://management.azure.com/; on Azure hosts it requested managed-identity tokens from IDENTITY_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 sub to owner/repo and a protected environment or branch; prefer ID-based subjects.
  • Require GitHub environments with reviewers for prod roles; treat pull_request_target and fork PRs as untrusted (Pwn Requests).
  • Log and alert on AssumeRoleWithWebIdentity from unexpected sub values.
  • OIDC does not cover everything: database passwords and third-party API keys still need Vaults and Secret Stores (OWASP).

Sources