Skip to content

Conversation

leodido
Copy link

@leodido leodido commented Oct 10, 2025

Description

Fixes Sigstore signing failure caused by missing OIDC token provisioning.

Fixes Sigstore signing failure caused by missing OIDC token provisioning.

Problem: The sigstore-go library requires an explicit JWT token in CertificateProviderOptions.IDToken, but Leeway was passing an empty struct, assuming the library would auto-fetch from GitHub Actions environment variables.

Solution: Implemented fetchGitHubOIDCToken() to explicitly retrieve the OIDC token from GitHub Actions using the ACTIONS_ID_TOKEN_REQUEST_TOKEN and ACTIONS_ID_TOKEN_REQUEST_URL environment variables with audience=sigstore.

Changes:

  • Added fetchGitHubOIDCToken() function to fetch JWT from GitHub OIDC provider
  • Updated signSLSAAttestation() to call token fetching before Fulcio certificate request
  • Added comprehensive unit tests with mock HTTP server
  • Added error handling for token fetch failures

Related Issue(s)

Fixes https://linear.app/ona-team/issue/CLC-1959/create-leeway-signing-command

How to test

go test -v ./pkg/leeway/signing/... -run TestFetchGitHubOIDCToken

Documentation

No - Internal Leeway implementation fix, no user-facing documentation changes required.

Sigstore-go does not automatically fetch GitHub OIDC tokens from
environment variables. This commit adds explicit token fetching logic
to resolve signing failures in GitHub Actions.

Changes:
- Add fetchGitHubOIDCToken() to fetch token from GitHub OIDC endpoint
- Update signProvenanceWithSigstore() to use fetched token explicitly
- Add comprehensive unit tests for token fetching with error scenarios
- Use context-aware HTTP requests with 30s timeout

Fixes signing failures where Sigstore expected an explicit IDToken
instead of auto-discovering from ACTIONS_ID_TOKEN_REQUEST_* env vars.

Co-authored-by: Ona <no-reply@ona.com>
@leodido leodido self-assigned this Oct 10, 2025
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