GitHub Actions OIDC Hardening Cheat Sheet: AWS, Azure, and Google Cloud

GitHub Actions OIDC Hardening Cheat Sheet: AWS, Azure, and Google Cloud

A different kind of checklist from the storage sheets: how to give GitHub Actions workflows access to AWS, Azure, and Google Cloud without long-lived keys, and how to make sure only the right repository can use that access. Baseline as of October 2026.

A cloud key stored as a CI secret fails the way every standing credential does: it works for whoever holds it, it outlives the person who created it, and nobody notices when it's copied. OpenID Connect (OIDC) federation replaces the key with a short-lived token that each job requests, but the risk doesn't disappear. It moves to one place: the trust condition on the cloud side that decides which repositories may ask. This is a working checklist pulled from GitHub's and the three clouds' own documentation, not a substitute for reading it.

What changed recently

Four 2026 changes from GitHub and Microsoft are worth knowing:

Worth flagging: a trust policy that matches a repository by name trusts whoever owns that name next

GitHub's own OIDC reference now says the old name-based sub was vulnerable: after a namespace was recycled, a different owner could create a matching subject. The risk runs both ways. A condition written from a name can match a stranger who later claims the name. And a repository renamed or transferred after July 15 moves to the immutable format automatically, so a name-only condition stops matching and AWS returns "Not authorized."

A researcher at Boost Security Labs argues the transition itself was risky. By the researcher's account, the original hyphen-delimited prefix could collide with a lookalike organization name, which is why GitHub pulled the changelog post and moved to @. The researcher reports no evidence that anyone was compromised, and GitHub's republished post records only the delimiter change. The researcher's practical warning stands either way: wildcard subjects such as repo:org/* are the most dangerous place to paste a new prefix.

Trust conditions

Subject formats and migration

Workflows and credentials

Logging & monitoring

A note on scope and benchmarks

This sheet cites no CIS control numbers. The CIS benchmarks for each provider address long-lived access keys and credential rotation, but numbering shifts between versions and this piece spans three providers' benchmarks, so it cites the vendors' own documentation rather than controls that haven't been checked against each benchmark. The conditions described above are patterns from those documents, not drop-in policies: test them in a non-production account first. One extrapolation is worth stating plainly: Google's page prints the attribute-condition syntax only for the owner name (assertion.repository_owner=='ORGANIZATION'). The ID-based form uses the same shape with the mapped ID claims, but the page doesn't print an example, so verify it before relying on it.

Finding the keys you still have

You can't retire a long-lived key you haven't found. Gitleaks, covered in this pillar's OSS Spotlight, scans repository history for exactly these credentials. Run it across the repositories whose workflows you are migrating, and rotate anything it finds, since a key that was ever committed should be treated as exposed. Exposure isn't limited to commits, either: the credential behind the JadePuffer attack first appeared in a public GitHub issue.


Sources: GitHub Docs: OpenID Connect · GitHub Docs: OIDC reference · GitHub Docs: OIDC in AWS · GitHub Docs: OIDC in Azure · GitHub Docs: OIDC in Google Cloud · GitHub Changelog: Immutable subject claims · GitHub Changelog: Unvalidated npm trusted publishing configurations now expire · AWS: Create an OIDC identity provider in IAM · AWS: Logging IAM and AWS STS API calls with CloudTrail · aws-actions/configure-aws-credentials · Microsoft Learn: Create a trust relationship between an app and an external identity provider · Microsoft Learn: Migrate GitHub Actions federated credentials to immutable subjects · Microsoft Learn: Sign-in logs in Microsoft Entra ID · Google Cloud: Workload Identity Federation with deployment pipelines · Google Cloud: IAM audit logging · Boost Security Labs: Sleeper Squats (the researcher's account)

Marselis A. Reed

Marselis A. Reed

B.S. in Computer Science, with 10 years of production experience — including 5 years in healthcare information security.

Get the Next Issue

Cloud hardening, vendor watch, and OSS tooling — every week.