Update SigningConfig to specify API version and validity periods#539
Update SigningConfig to specify API version and validity periods#539Hayden-IO merged 2 commits intosigstore:mainfrom
Conversation
|
A few things to note:
|
protos/sigstore_trustroot.proto
Outdated
| // Clients must select only Service with the highest API version | ||
| // that the client is compatible with and that is within its | ||
| // validity period. Clients should select the first Service | ||
| // that meets this requirement. |
There was a problem hiding this comment.
If the sort order is the same as for TrustedRoot
protobuf-specs/protos/sigstore_trustroot.proto
Lines 108 to 109 in e943ce1
There was a problem hiding this comment.
Good call out. I've added the following:
// All listed Services SHOULD be sorted by the `valid_for` window in
// descending order, with the newest instance first.
With the newest instance first, this should limit how far into the list clients need to search to find a valid instance. Typically a client will just select the first from the list. With a sharding, a client will select the second (old shard) until the first in the list (new shard) becomes valid. For API changes, a client may have to search further into the list, but major API changes will be infrequent.
protos/sigstore_trustroot.proto
Outdated
| // These URL **MUST** be the "base" URLs for the transparency logs, | ||
| // which clients should construct appropriate API endpoints on top of. | ||
| // | ||
| // Clients must select ALL Services with the highest API version |
There was a problem hiding this comment.
This seems like a big change, as clients don't currently upload entries to multiple logs at once, and may not always want to. Could this be changed to ANY?
There was a problem hiding this comment.
Originally, I was going to say that since this is for signing, I would expect that a user provide all the logs that they want to contact. Thinking more on this, Certificate Transparency has a similar concept with log lists, and doesn't require its clients to write to all logs, only a subset.
I'm proposing now that we include a configuration for how clients should select Rekor and TSA instances (we don't need a configuration for Fulcio and the OIDC provider because the bundle only supports one certificate). The config will specify a selection of ANY, ALL, or EXACT, with another field count when EXACT is specified (like CAs writing to 2 logs based on browser requirements).
We need to decide on what we as the PGI operator will set. I think ANY is fine since I expect we'll only ship one log for now.
Thanks for this idea!
protos/sigstore_trustroot.proto
Outdated
| // that the client is compatible with and that is within its | ||
| // validity period. Clients should select the first Service | ||
| // that meets this requirement. | ||
| repeated Service certificate_authority_urls = 6; |
There was a problem hiding this comment.
I wish the new field names were more meaningfully different from the old names but I don't have a great suggestion.
There was a problem hiding this comment.
With the removal of the old fields, I've renamed them to the abbreviated service names
protos/sigstore_trustroot.proto
Outdated
| // MUST be application/vnd.dev.sigstore.signingconfig.v0.1+json or | ||
| // application/vnd.dev.sigstore.signingconfig.v0.2+json |
There was a problem hiding this comment.
This seems a bit unclear: after this PR this message documents v0.2 only but that's not said anywhere. Do we allow v0.1 to be used in future as well?
Bundle uses this language:
// MUST be application/vnd.dev.sigstore.bundle.v0.3+json when encoded as JSON. // Clients must to be able to accept media type using the previously defined formats: // [list follows]
Of course situation here is a bit different: we should document
- what we expect the instance to serve
- I'd like to say "MUST serve v0.2" but obviously there's a migration period here
- what we expect clients to handle
- MUST handle v0.2, SHOULD handle v0.1
There was a problem hiding this comment.
Updated to serve only v0.2, and say clients can optionally handle v0.1. In practice, I assume all will drop support.
protos/sigstore_trustroot.proto
Outdated
| // application/vnd.dev.sigstore.signingconfig.v0.2+json | ||
| string media_type = 5; | ||
|
|
||
| // Deprecated: Use certificate_authority_urls |
There was a problem hiding this comment.
Can you explain the way these deprecations are useful (compared to just removing the fields):
- if a service does not want to support the new fields, I would expect them to just keep serving signingconfig v0.1?
- if a client supports signingvonfig v0.2 then they need to support the new fields so won't need these
Maybe I'm missing a case?
There was a problem hiding this comment.
is the idea that clients have an easier time supporting v0.2 if they can just update version number and keep doing what they are doing now?
There was a problem hiding this comment.
I was aiming to concurrently support both to avoid a breaking change, but you're right, this isn't necessary.
Also, only sigstore-python and -go support signing configs and I'm fairly certain no one is using them for the Go client, so making this breaking change is likely to have no impact.
|
I guess one option to make the transition to new SigningConfig as easy as possible is to not replace the old one but just offer a new one:
This would be a way to avoid a flag day for SigningConfig |
pretty sure sigstore-python will not parse the new data without code changes since the signingconfig version number changes |
I'll have a better look at this again this week as I feel there is something to this idea -- we may be mistakenly combining the two problem cases (backwards incompatible service migration and plain log instance rotation), the right solutions to each might actually be different |
|
Okay, I couldn't actually make experiments with sigstore-python because of an ongoing protobuf-specs incompatibility, but I have tried to fully understand this and here's my current thinking: On versioning SigningConfig itself
Let's consider this approach:
I think that might be best of both worlds: avoids a flag day but still makes it clear the API actually changes (and allows us to see from CDN logs how much the old signing_config.json is still used). The counter argument could be that only sigstore-python is using signing_config.json so there's no point in considering this a real API change... but in that case I guess we can just remove the deprecated fields and not care about compatibility? comments @haydentherapper? On Service.major_api_versionIt's really hard to say if this will actually be a mechanism that works in cases that are not this specific upgrade (rekor v1->v2) but I can't figure out anything smarter. LGTM |
|
@jku Thanks for the review and suggestions. I've updated this PR to remove the old fields. This is cleaner, it likely doesn't affect any clients or users, and for all the reasons you've stated, this should be fine if we version the signing config. Given that no clients are using the public-good-instance-provided signing config at the moment, I would suggest we simply update the existing signing config. I like this idea for versioning configs and so we should document this to use this in the future for the next time we make a breaking change that removes fields. |
In order to faciliate clients gracefully handling breaking API changes, the SigningConfig will now include API versions for each of the service URLs so that clients can determine what services they are compatible with. Additionally, we've included validity periods which will be used to faciliate Rekor log sharding, when we spin up new log shards and distribute new key material. Fixes sigstore#474 Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>
Signed-off-by: Hayden B <8418760+haydentherapper@users.noreply.github.com>
In order to faciliate clients gracefully handling breaking API changes, the SigningConfig will now include API versions for each of the service URLs so that clients can determine what services they are compatible with. Additionally, we've included validity periods which will be used to faciliate Rekor log sharding, when we spin up new log shards and distribute new key material.
Fixes #474
Summary
Release Note
Documentation