Skip to content

Only request the CI token for the configured OIDC audience - #247

Merged
ericmj merged 1 commit into
mainfrom
pin-oidc-audience
Oct 20, 2026
Merged

ericmj merged 1 commit into
mainfrom
pin-oidc-audience

Conversation

@ericmj

@ericmj ericmj commented Oct 20, 2026

Copy link
Copy Markdown
Member

Workload Identity asked GitHub for an OIDC token with whatever audience GET /api/oidc/audience returned. GitHub issues a token for any audience, so a configured API that isn't Hex.pm, or anyone in the middle of a plain HTTP one, could pick the audience of another service that trusts the job, such as sts.amazonaws.com, and receive a token that service accepts.

The new workload_identity_audience config option, hexpm by default, is the only audience hex_core requests a token for. An API that advertises another one gets {error, {oidc_audience_not_allowed, Audience}} before any token is requested. Hex vendors hex_core, so it picks this up the next time scripts/vendor_hex_core.sh runs.

Workload Identity asked the CI provider for a token with whatever
audience GET /oidc/audience returned. The provider issues a token for any
audience, so a configured API that isn't Hex.pm, or anyone in the middle
of a plain HTTP one, could choose the audience of another service that
trusts the job, such as sts.amazonaws.com, and receive a token that
service accepts.

The new workload_identity_audience config option, hexpm by default, is
the only audience requested. An API advertising another one gets
{error, {oidc_audience_not_allowed, Audience}}.
@ericmj
ericmj marked this pull request as ready for review October 20, 2026 14:43
@ericmj
ericmj merged commit 9390b3f into main Oct 20, 2026
10 checks passed
@ericmj
ericmj deleted the pin-oidc-audience branch October 20, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant