Skip to content

Include raw subject in certificates#2307

Merged
Hayden-IO merged 2 commits into
sigstore:mainfrom
wlynch:fulcio-cert-subject
Mar 31, 2026
Merged

Include raw subject in certificates#2307
Hayden-IO merged 2 commits into
sigstore:mainfrom
wlynch:fulcio-cert-subject

Conversation

@wlynch

@wlynch wlynch commented Mar 27, 2026

Copy link
Copy Markdown
Member

Summary

Sometimes identities have a different identifier that isn't captured by existing certificates, usually because the identifier isn't useful as a human friendly reference. For example - GCP accounts have an opaque numerical identifier.

That said, subject is particularly useful to preserve since OIDC spec requires (issuer, subject) to be the canonical representation for an identity, and sometimes these opaque identifiers can be difficult to otherwise resolve.

This change preserves the incoming subject as-is. While this may result in some duplicative data for some providers, this helps give a consistent reference point across OIDC issuers.

Fixes #973

Release Note

  • Adds sub as a new OID extension in issued certificates, which contains the token subject as-is

Documentation

Will need some assistance reserving the OID value upstream.

@wlynch wlynch requested a review from a team as a code owner March 27, 2026 19:47
@wlynch wlynch force-pushed the fulcio-cert-subject branch from ce25008 to b475c7c Compare March 27, 2026 19:47
@codecov

codecov Bot commented Mar 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.10%. Comparing base (cf238ac) to head (31e0d52).
⚠️ Report is 567 commits behind head on main.

Files with missing lines Patch % Lines
pkg/certificate/extensions.go 63.63% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2307       +/-   ##
===========================================
- Coverage   57.93%   45.10%   -12.84%     
===========================================
  Files          50       72       +22     
  Lines        3119     4705     +1586     
===========================================
+ Hits         1807     2122      +315     
- Misses       1154     2344     +1190     
- Partials      158      239       +81     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wlynch wlynch force-pushed the fulcio-cert-subject branch from b475c7c to 59bcaa4 Compare March 27, 2026 19:57
Sometimes identities have a different identifier that isn't captured by existing certificates, usually
because the identifier isn't useful as a human friendly reference. For example - GCP accounts have
an opaque numerical identifier.

That said, subject is particularly useful to preserve since OIDC spec requires
(issuer, subject) to be the canonical representation for an identity, and sometimes
these opaque identifiers can be difficult to otherwise resolve.

This change preserves the incoming subject as-is. While this may result in some duplicative
data for some providers, this helps give a consistent reference point across OIDC issuers.

Signed-off-by: Billy Lynch <billy@chainguard.dev>
@wlynch wlynch force-pushed the fulcio-cert-subject branch from 59bcaa4 to f300592 Compare March 27, 2026 19:59

@Hayden-IO Hayden-IO left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good! No concerns from me with including subject in a custom extension!

Can you update e2e tests in https://github.com/sigstore/fulcio/blob/main/pkg/server/grpc_server_test.go as well?

@wlynch

wlynch commented Mar 31, 2026

Copy link
Copy Markdown
Member Author

Done!

@wlynch wlynch requested a review from Hayden-IO March 31, 2026 14:41
Signed-off-by: Billy Lynch <billy@chainguard.dev>
@wlynch wlynch force-pushed the fulcio-cert-subject branch from e730ebe to 31e0d52 Compare March 31, 2026 14:41

@Hayden-IO Hayden-IO left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Hayden-IO Hayden-IO merged commit 39b48e6 into sigstore:main Mar 31, 2026
14 checks passed
@wlynch

wlynch commented Mar 31, 2026

Copy link
Copy Markdown
Member Author

@Hayden-IO thanks! anything else I need to do on my end to help set up the oid-info documentation?

@Hayden-IO

Copy link
Copy Markdown
Contributor

Nope, the doc update here LGTM! We'll just need to cut a new release.

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.

Email claims: store unique user id in addition to email

2 participants