Skip to content

allow configuring the artifact transparency log threshold - #39

Merged
tonistiigi merged 1 commit into
moby:mainfrom
crazy-max:artifact-tlog-threshold
Oct 22, 2026
Merged

tonistiigi merged 1 commit into
moby:mainfrom
crazy-max:artifact-tlog-threshold

Conversation

@crazy-max

@crazy-max crazy-max commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

relates to docker/github-builder#318.

Add WithTlogThreshold so 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 in SignatureInfo, requiring a verified TSA timestamp instead. This supports private-repository cache signatures without Rekor entries while preserving certificate, artifact signature, and observer timestamp checks.

@tonistiigi tonistiigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@crazy-max
crazy-max force-pushed the artifact-tlog-threshold branch from 8c422d5 to 09a42a0 Compare October 21, 2026 15:21
Comment thread verifier.go Outdated
}
// 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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@crazy-max
crazy-max force-pushed the artifact-tlog-threshold branch from 09a42a0 to fcd41cd Compare October 21, 2026 16:25
Comment thread verifier.go Outdated
tlogThreshold = *opts.TlogThreshold
}
if tlogThreshold == 0 && len(logIDs) > 0 {
// WithTransparencyLog rejects zero. Verify optional entries first, then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to be the case where user explicitly sets 0. Why are we verifying in this case?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah I thought you wanted to preserve optional log timestamps even with an explicit zero. I will change that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

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>
@crazy-max
crazy-max force-pushed the artifact-tlog-threshold branch from fcd41cd to eae1be5 Compare October 22, 2026 08:33
@crazy-max
crazy-max requested a review from tonistiigi October 22, 2026 08:35
@tonistiigi
tonistiigi merged commit 485a1be into moby:main Oct 22, 2026
20 checks passed
@crazy-max
crazy-max deleted the artifact-tlog-threshold branch October 22, 2026 15:29
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.

2 participants