-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Should Fulcio put the critical bit on its OIDC extensions? #981
Comments
I like this idea quite a bit, TBH, and would be open to that being the only action we take from this issue, even if it'll take a bit longer. But I'm not opposed to calling these other extensions critical for now (though I worry this might break clients, even the ones that are parsing these extensions.) |
One concern is how ASN1 parsers handle structs with unknown fields. I’m thinking about the case where we add new claims to the certificate. I’d like to avoid having to make a new major release of fulcio to support this. Changing the critical bit would be a breaking change, so this would be tackled as part of the next major release of fulcio at the earliest. |
Making sure I understand: is the concern here that, with a single extension instead of multiple, we'd be causing problems for some ASN.1 parsers by adding/removing fields that would otherwise be fine as standalone extensions? If so, I think a reasonable definition would be this (inspired by X.509's own Claims ::= SET OF Claim
Claim ::= SEQUENCE {
id OBJECT IDENTIFIER,
value ANY DEFINED BY id,
} where Edit: 100% agreed this would be a breaking change; just wanted to make sure I understood! |
I thought that in general parsers should gracefully ignore unknown extensions? And that's the point of the "critical" bit—to mark an extension as not-to-be-ignored. So IIUC adding new extensions is fine even if they have new structs; marking critical is the thing to be careful about.
Agreed it's breaking and we need to do it safely, but I'm a little concerned about "wait for a major version and then breaking changes are okay" as a strategy. While technically it complies with our versioning guarantees, I worry about difficulties in adoption. We don't really control all the clients. I think something like what @woodruffw is proposing we could achieve something like:
|
I like that approach! That would give us a very graceful transition period on |
I was thinking that you'd unmarshal to a struct with each claim specified, but what you suggested makes sense. It is a little strange to me though that the extension would be marked as critical but a client could ignore some of the OIDs within the extension if they aren't known. I would prefer we keep the current approach of an extension per value (each extension being critical), rather than encode all in a single extension. These seem pretty similar to me, so unless there's a motivation to switch, I'd prefer to keep what we've been doing.
Yep, that's totally reasonable for doing breaking changes. |
Yeah, that's a good point. It's not clear to me which is more idiomatic:
|
Actually, it might be an issue if every extension is critical if a client doesn’t care about some values, say, the custom OIDs set for CI. If it’s marked as critical, a client should know how to deal with the extension. This might be why most extensions for web PKI certs are marked as non critical, not sure though. |
Also if any new extensions are added, then a client wouldn’t yet know of them, so I don’t think you can mark them as critical. |
Closing due to the above |
Sorry for the necropost here! FWIW, I think there's still a part of this issue that's worth considering (the part not related to the critical bit): #981 (comment) would be a refactoring of the claims layout to make it more flexible/extensible in the future, while also giving us the flexibility to add "non-authenticated" extensions (i.e. ones derived from the user's request, rather than from the OIDC identity). Should I open a separate issue for that, or should we reuse this one? |
Yeah, I'd like to see a separate issue for that. But it's a good idea :) |
Sounds good! I'll break it out. |
Happy to discuss it more in a separate issue, but we won't want to break clients this significantly with a V2 unless there's good motivation to do so. |
As discussed in the Sigstore Slack: the certificates currently issued by Fulcio don't include critical bits on any OIDC extensions, even when those extensions are essential to the conceptual policy or identity being verified.
So, the question: should we include the critical bit on these extensions?
Pros:
Cons:
In this situation, I believe that the pros (weakly) outweigh the cons -- Sigstore can specify in documentation that the critical bit on its extensions really means that some but the empty subset of extensions must be verified.
Longer term, I wonder if this impedance mismatch might be a good reason to re-think how Fulcio embeds OIDC claims as extensions -- we're already planning to change the current extensions to use ASN.1 types per #900 and #974, so perhaps it makes sense to change from
N
extensions forN
claims to a single (critical) extension that uses an ASN.1SEQUENCE
structure to lay out all claims internally?cc @znewman01 @haydentherapper @SantiagoTorres
The text was updated successfully, but these errors were encountered: