# 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 ```yaml 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 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/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. - **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). ## 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 - [[raw/docs.github.com/oidc-security-hardening-for-github-actions-4060|OIDC Security Hardening for GitHub Actions]] - [[raw/codecentric.de/secretless-github-actions-to-aws-via-oidc-4059|Secretless GitHub Actions to AWS via OIDC]] - [[raw/docs.aws.amazon.com/aws-iam-roles-anywhere-workload-identities-4054|AWS IAM Roles Anywhere Workload Identities]] - [[raw/docs.aws.amazon.com/sec02-bp03-store-and-use-secrets-securely-aws-well-architected-4493|SEC02-BP03 Store and use secrets securely]] - [[raw/wiz.io/the-many-ways-to-obtain-credentials-in-aws-9488|The many ways to obtain credentials in AWS]] - [[raw/thehackernews.com/unc6426-exploits-nx-npm-supply-chain-attack-to-gain-aws-admin-access-i-4935|UNC6426 Exploits nx npm Supply-Chain Attack to Gain AWS Admin Access]] - [[raw/wiz.io/code-to-cloud-attacks-from-github-pat-to-cloud-control-plane-9098|Code to Cloud Attacks: From GitHub PAT to Cloud Control Plane]] - [[raw/cheatsheetseries.owasp.org/secrets-management-owasp-cheat-sheet-series-2716|Secrets Management - OWASP Cheat Sheet Series]] - [[raw/aws.amazon.com/practical-steps-to-minimize-key-exposure-using-aws-security-aws-4495|Practical steps to minimize key exposure using AWS Security services]]