Skip to content

Commit bd51715

Browse files
leodidoona-agent
andcommitted
docs(signing): clarify Fulcio's role in builder ID extraction
Add detailed comment explaining: - How Fulcio (Sigstore's CA) processes OIDC tokens - Why attestation builder ID must match certificate SAN - Uncertainty about GitHub's OIDC token structure - Rationale for trying both extraction approaches This helps future maintainers understand the critical relationship between OIDC token claims, Fulcio certificate generation, and SLSA attestation verification. Co-authored-by: Ona <[email protected]>
1 parent 7c393af commit bd51715

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pkg/leeway/signing/attestation.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,18 @@ func extractBuilderIDFromOIDC(ctx context.Context, githubCtx *GitHubContext) (st
420420
}
421421

422422
// Try to extract job_workflow_ref from the sub claim first
423-
// This is the format that Fulcio embeds in the certificate
423+
//
424+
// Context:
425+
// When we call sign.Bundle() with the OIDC token, the Sigstore library sends it to Fulcio (Sigstore's CA).
426+
// Fulcio extracts claims from the OIDC token and issues a short-lived certificate with the builder identity in the Subject Alternative Name (SAN).
427+
// For verification to succeed, our attestation's builder ID must match what Fulcio puts in the certificate SAN.
428+
//
429+
// TODO: Verify if GitHub embeds job_workflow_ref in the sub claim or only provides it as top-level.
430+
// GitHub docs show it as top-level, but we need to confirm what Fulcio actually uses. The current
431+
// implementation tries both approaches to ensure we match Fulcio's extraction logic.
424432
jobWorkflowRef := extractJobWorkflowRef(sub)
425433

426434
// If not found in sub, try the top-level job_workflow_ref claim
427-
// (GitHub provides both, but Fulcio uses the one from sub)
428435
if jobWorkflowRef == "" {
429436
if jwfRef, ok := claims["job_workflow_ref"].(string); ok && jwfRef != "" {
430437
jobWorkflowRef = jwfRef

0 commit comments

Comments
 (0)