← Back to Pull requests

Add --rekor-threshold and --timestamp-threshold verify flags #5230

Open
codysoyland opened this pull request with 401 lines diff across 19 files
View on GitHub
codysoyland codysoyland commented on Nov 19, 2026 19:39 UTC
Author

Fixes #5229

Adds --rekor-threshold=n and --timestamp-threshold=n to the verify commands, both defaulting to 1, mapped to sigstore-go's WithTransparencyLog(n) and WithSignedTimestamps(n). --insecure-ignore-tlog and --use-signed-timestamps are deprecated in favor of --rekor-threshold=0 and --timestamp-threshold=1; the deprecated --private-infrastructure now points to --rekor-threshold=0.

Behavior:

  • Without --timestamp-threshold, verification is unchanged: a signed timestamp is required only for Rekor v2-only bundles.

  • CheckOpts.RekorThreshold and CheckOpts.TimestampThreshold of 0 keep existing behavior for library callers.

  • CheckOpts.TimestampThreshold > 0 enables signed timestamp verification even without UseSignedTimestamps.

  • manifest verify and dockerfile verify now honor --private-infrastructure; it was registered on those commands but ignored.
  • Earlier revisions also tightened the non-bundle verification path; that code was removed upstream in #5146, so this PR now only touches sigstore-go bundle verification.

    The integrated-timestamp requirement stays at 1 regardless of --rekor-threshold, since it only provides a trusted time for certificate validation and mixed v1/v2 bundles may have a single v1 entry.

    AI disclosure: written with Claude Code (Claude Opus 5.5). An earlier revision was reviewed by Codex (gpt-6-astra); the issue text was drafted with Codex.

    🤖 Generated with Claude Code

    Diff: 401 lines (+374 / -27) across 19 files Reviewer: Hayden-IO Review duration: 17341m
    All Vouch review confidence checks passed
    Residual risk 0.08 = Change Risk (0.67) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.67 · 401 lines diff across 19 files
    0.67
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.88 · 3 substantive comment(s)
    0.88
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    88%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.359
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    5 items
    codecov[bot] codecov[bot] commented on Nov 19, 2026 19:43 UTC
    Bot

    Codecov Report


    :x: Patch coverage is 66.21622% with 25 lines in your changes missing coverage. Please review.
    :white_check_mark: Project coverage is 48.59%. Comparing base (2ef6022) to head (3c59efa).
    :warning: Report is 944 commits behind head on main.

    | Files with missing lines | Patch % | Lines |
    |---|---|---|
    | cmd/cosign/cli/verify.go | 0.00% | 16 Missing :warning: |
    | cmd/cosign/cli/dockerfile.go | 0.00% | 4 Missing :warning: |
    | cmd/cosign/cli/manifest.go | 0.00% | 4 Missing :warning: |
    | cmd/conformance/main.go | 0.00% | 1 Missing :warning: |

    <details><summary>Additional details and impacted files</summary>

    @@            Coverage Diff             @@
    ##             main    #5230      +/-   ##
    ==========================================
    + Coverage   40.10%   48.59%   +8.48%     
    ==========================================
      Files         155      202      +47     
      Lines       10044    10131      +87     
    ==========================================
    + Hits         4028     4923     +895     
    + Misses       5530     5208     -322     
    + Partials      486        0     -486     
    

    </details>

    :umbrella: View full report in Codecov by Harness.
    :loudspeaker: Have feedback on the report? Share it here.
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • </details>

    Hayden-IO Hayden-IO commented on Nov 20, 2026 23:38 UTC
    Contributor

    +1, this is a good path forward to no longer needing an "insecure tlog verify" flag.

    codysoyland codysoyland commented on Nov 25, 2026 17:30 UTC
    Author

    On naming, I considered --tlog-threshold and --tsa-threshold. I chose --rekor-threshold because I've seen tlog be conflated with the Fulcio CT log, and IMO tsa is not as clear as timestamp to people new to the project. However, I'm fine changing either of these if anyone disagrees.

    Hayden-IO Hayden-IO commented on Nov 27, 2026 03:36 UTC
    Reviewer

    LGTM, I think this fits in nicely with the future policy work. Would like @steiza’s take as well since this is adding more flags.

    Is this something you’d want to land in V3 or V4? If the latter, we could just remove the deprecated flags rather than keep them around, which would also simplify some of the logic around the various checkopts fields.

    Reviewers
    Assignees
    codysoyland codysoyland
    Labels
    risk: low confidence: 88.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 67.4% (HIGH) · Higher = larger blast radius
    67.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 88.6% · Lower = rushed or shallow review
    88.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 7.7% · Safe to merge
    7.7%