Repository navigation
allow configuring the artifact transparency log threshold - #39
Conversation
tonistiigi
left a comment
There was a problem hiding this comment.
This looks fine, but it should not be related to the actual cause of the linked issue. Threshold validation already exists using existing libarary and this seems to be configuration error in github builder.
8c422d5 to
09a42a0
Compare
| } | ||
| // A zero threshold allows absent logs, but present entries must still be | ||
| // verified so their timestamps remain available for certificate verification. | ||
| if opts.TlogThreshold > 0 || len(b.GetVerificationMaterial().GetTlogEntries()) > 0 { |
There was a problem hiding this comment.
I'm not sure about the defaults here. I think the default that would make sense would be
- If not explicity threshold then count tlog and set their count as threshold. Return all tlog with signinfo
- If explicit, then this is set as the threshold. Still need to make sure we don't return any unverified tlog with siginfo.
There was a problem hiding this comment.
Updated so now the default counts distinct log IDs, and explicit thresholds, including zero, are honored. Optional logs are still verified, with only verified timestamps returned in SignatureInfo and used for certificate verification.
09a42a0 to
fcd41cd
Compare
| tlogThreshold = *opts.TlogThreshold | ||
| } | ||
| if tlogThreshold == 0 && len(logIDs) > 0 { | ||
| // WithTransparencyLog rejects zero. Verify optional entries first, then |
There was a problem hiding this comment.
This seems to be the case where user explicitly sets 0. Why are we verifying in this case?
There was a problem hiding this comment.
Ah I thought you wanted to preserve optional log timestamps even with an explicit zero. I will change that.
Add WithTlogThreshold to set an explicit minimum number of verified logs. When omitted, derive the threshold from the distinct log IDs in the bundle. Reject negative thresholds. Explicit zero skips log verification and returns no log timestamps, so a verified TSA timestamp is required. Positive thresholds preserve verified log timestamps for certificate verification and SignatureInfo. Keep certificate, artifact signature, and observer timestamp checks enabled. Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
fcd41cd to
eae1be5
Compare
relates to docker/github-builder#318.
Add
WithTlogThresholdso callers can set the minimum number of verified transparency logs. When omitted, derive the threshold from the distinct log IDs in the bundle. Explicit zero skips log verification and returns no log timestamps inSignatureInfo, requiring a verified TSA timestamp instead. This supports private-repository cache signatures without Rekor entries while preserving certificate, artifact signature, and observer timestamp checks.