Skip to content

fix(rekor-monitor): raise scan-window timeout for large backlogs - #1900

Merged
mchmarny merged 1 commit into
mainfrom
fix/rekor-monitor-scan-timeout
Jul 23, 2026
Merged

mchmarny merged 1 commit into
mainfrom
fix/rekor-monitor-scan-timeout

Conversation

@lockwobr

Copy link
Copy Markdown
Contributor

Summary

Raise the Rekor monitor's per-pass scan timeout so a large backlog window (from a wedged checkpoint or a multi-hour upstream outage) can be scanned in a single pass and let the cursor advance, and fold in the three post-merge CodeRabbit nits from #1897.

Motivation / Context

The first scheduled run after #1897 merged hit the 15-minute per-pass timeout during the identity scan: the checkpoint had been wedged since ~14:30, so the scan window had grown to ~380k entries. The tool classified the timeout as operational (correct: no security page, just a calm degraded issue), but a window that large cannot finish inside 15m, so the cursor never advances and the monitor cannot catch up. This raises the timeout so one pass clears the backlog; afterward the hourly windows are minutes again.

Follow-up to #1897.
Related: #1898, #1899

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Documentation update
  • Build/CI/tooling

Component(s) Affected

  • Docs/examples (docs/, examples/)
  • Other: tools/rekor-monitor + .github/workflows/rekor-monitor.yaml + .github/scripts/

Implementation Notes

  • Tool defaultTimeout 15m -> 45m; workflow timeout-minutes 20 -> 50 (the job backstop must exceed the tool's per-pass deadline so the tool's own deadline, which classifies as operational, fires first rather than a hard job kill). Sized for a several-hundred-thousand-entry backlog with headroom, since the window keeps growing (~70k/hour) while wedged; also a durable resilience buffer.
  • CodeRabbit nit (dedup): extracted the duplicated gh_api_retry helper into .github/scripts/gh-api-retry.sh (repo's existing .github/scripts/*.sh convention), invoked by both fetch steps so the two copies cannot drift.
  • CodeRabbit nit (docs, security precision): README now distinguishes a set-but-missing --known-tags-file (hard error, exit 2) from an empty file (disables suppression), matching maintaining.md.
  • CodeRabbit nit (docs): README + doc.go clarify the CLASSIFICATION= line prints for a completed run (exit 0/1/3), not the exit-2 argument-error path.
  • No change to the classification logic, the security/operational gating, or the known-tags correlation.

Testing

GOFLAGS="-mod=vendor" go test -race ./tools/rekor-monitor/...   # ok
golangci-lint run -c .golangci.yaml ./tools/rekor-monitor/...   # 0 issues
shellcheck .github/scripts/gh-api-retry.sh                      # clean
yamllint .github/workflows/rekor-monitor.yaml                   # 0 issues
actionlint .github/workflows/rekor-monitor.yaml                 # clean

TestParseFlags references the defaultTimeout constant (not a literal), so the bump needs no test change. Full make qualify (e2e + scan) relies on CI.

Risk Assessment

  • Low — A timeout increase plus a helper extraction and doc precision; no change to the security/operational classification or correlation logic. Easy to revert.

Rollout notes: On merge, the next scheduled (or a dispatched) run scans the full backlog within 45m, advances the checkpoint, and the workflow's clean-run close step auto-closes #1898 and #1899. Future windows are small again. If the backlog has grown past what 45m allows, the fallback is a one-time checkpoint re-baseline.

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S)

@lockwobr
lockwobr requested review from a team as code owners July 23, 2026 20:03
@lockwobr lockwobr added area/ci theme/supply-chain SLSA, SBOM, Sigstore, and provenance verification labels Jul 23, 2026
@lockwobr lockwobr self-assigned this Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 7df6c68c-f4d9-4d5c-8830-a81b13546d2f

📥 Commits

Reviewing files that changed from the base of the PR and between aebb7f6 and 5769834.

📒 Files selected for processing (5)
  • .github/scripts/gh-api-retry.sh
  • .github/workflows/rekor-monitor.yaml
  • tools/rekor-monitor/README.md
  • tools/rekor-monitor/doc.go
  • tools/rekor-monitor/main.go

📝 Walkthrough

Walkthrough

Adds a shared GitHub API retry script with atomic output publication and wires it into the Rekor monitoring workflow for artifact, checkpoint, and tag fetches. The workflow job timeout increases to 90 minutes, while the monitor’s single-pass timeout increases to 45 minutes. Documentation now specifies known-tag suppression behavior and when CLASSIFICATION output is emitted.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: area/docs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: increasing the Rekor monitor scan-window timeout for backlog recovery.
Description check ✅ Passed The description is directly related to the timeout/backlog fix and supporting docs/helper changes.
Linked Issues check ✅ Passed Raising the monitor timeout lets the failed scan complete, which aligns with the issue's clean-run auto-close path.
Out of Scope Changes check ✅ Passed The helper extraction and docs updates stay within the monitor timeout fix and do not add unrelated behavior.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rekor-monitor-scan-timeout

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/scripts/gh-api-retry.sh:
- Around line 1-14: Add the standard repository license header immediately after
the shebang in gh-api-retry.sh, preserving the existing script comments and
behavior. Run the repository license check to verify the header meets the
required format.
- Around line 19-30: Update the retry script around the gh api loop to register
an EXIT trap that removes both ${out} and ${out}.part, ensuring no output file
remains after any failure, including a failed mv. Clear or disable the trap only
after mv successfully publishes ${out}, while preserving the successful exit
path and existing retry behavior.
- Around line 19-25: Update the retry loop in gh-api-retry.sh so each gh api
invocation is wrapped with timeout and has a finite limit comfortably below the
overall job budget. Preserve the existing partial-output handling, retry
warnings, backoff, and fallback behavior while ensuring stalled requests return
control to the loop.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: b77471ea-6e85-443f-b8bd-a869ab6ce35f

📥 Commits

Reviewing files that changed from the base of the PR and between 0dec317 and 06a211e.

📒 Files selected for processing (5)
  • .github/scripts/gh-api-retry.sh
  • .github/workflows/rekor-monitor.yaml
  • tools/rekor-monitor/README.md
  • tools/rekor-monitor/doc.go
  • tools/rekor-monitor/main.go

Comment thread .github/scripts/gh-api-retry.sh Resolved
Comment thread .github/scripts/gh-api-retry.sh Resolved
Comment thread .github/scripts/gh-api-retry.sh Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report ✅

Metric Value
Coverage 80.6%
Threshold 80%
Status Pass
Coverage Badge
![Coverage](https://img.shields.io/badge/coverage-80.6%25-brightgreen)

Coverage unchanged by this PR.

@lockwobr
lockwobr force-pushed the fix/rekor-monitor-scan-timeout branch from 06a211e to 6667f22 Compare July 23, 2026 20:14

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/rekor-monitor.yaml:
- Around line 115-119: Increase the workflow job’s timeout-minutes from 50 to at
least 80, ensuring the three API fetch retry budget, the monitor’s 45-minute
deadline, and setup overhead fit within the job limit. Keep the existing timeout
rationale and monitor behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: c7e8e6c6-7e12-4979-9e7f-af957131bc42

📥 Commits

Reviewing files that changed from the base of the PR and between 06a211e and 6667f22.

📒 Files selected for processing (5)
  • .github/scripts/gh-api-retry.sh
  • .github/workflows/rekor-monitor.yaml
  • tools/rekor-monitor/README.md
  • tools/rekor-monitor/doc.go
  • tools/rekor-monitor/main.go

Comment thread .github/workflows/rekor-monitor.yaml Resolved
@lockwobr
lockwobr force-pushed the fix/rekor-monitor-scan-timeout branch from 6667f22 to 46051bb Compare July 23, 2026 20:25

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/rekor-monitor/doc.go`:
- Around line 54-58: Document in tools/rekor-monitor/doc.go lines 54-58 that
argument parsing or known-tags-file loading errors return before the run and
print no CLASSIFICATION= line. Update tools/rekor-monitor/README.md lines 84-89
to include known-tags-file loading errors in the exit-status exception alongside
argument errors.

In `@tools/rekor-monitor/main.go`:
- Around line 33-43: Move the 45-minute timeout default from the local
defaultTimeout constant in the rekor monitor to a named constant in
pkg/defaults, then reference that shared constant from main.go. Remove the
standalone local literal while preserving the current timeout behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: b36b559c-a359-4938-802b-67c73f9f7237

📥 Commits

Reviewing files that changed from the base of the PR and between 6667f22 and 46051bb.

📒 Files selected for processing (5)
  • .github/scripts/gh-api-retry.sh
  • .github/workflows/rekor-monitor.yaml
  • tools/rekor-monitor/README.md
  • tools/rekor-monitor/doc.go
  • tools/rekor-monitor/main.go

Comment thread tools/rekor-monitor/doc.go Resolved
Comment thread tools/rekor-monitor/main.go Resolved
@lockwobr
lockwobr force-pushed the fix/rekor-monitor-scan-timeout branch from 46051bb to 559edaa Compare July 23, 2026 20:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/rekor-monitor.yaml:
- Around line 115-122: Update the timeout configuration around the workflow’s
timeout-minutes setting to reserve explicit time for post-monitor failure
handling, including issue creation, Slack delivery, degraded-run checks, and
cleanup. Either bound those gh/curl operations and include their maximum
duration in the documented budget, or increase timeout-minutes with explicit
headroom so follow-up processing completes before the job is killed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 2366031b-f529-42cd-ab30-a642ecaa39a8

📥 Commits

Reviewing files that changed from the base of the PR and between 46051bb and 559edaa.

📒 Files selected for processing (5)
  • .github/scripts/gh-api-retry.sh
  • .github/workflows/rekor-monitor.yaml
  • tools/rekor-monitor/README.md
  • tools/rekor-monitor/doc.go
  • tools/rekor-monitor/main.go

Comment thread .github/workflows/rekor-monitor.yaml Resolved
@lockwobr
lockwobr force-pushed the fix/rekor-monitor-scan-timeout branch from 559edaa to aebb7f6 Compare July 23, 2026 20:51
@lockwobr

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/scripts/gh-api-retry.sh:
- Around line 41-45: Update the cleanup trap and publish step in the retry loop
to pass `--` to both rm and mv before the caller-supplied out paths. Preserve
the existing temporary-file cleanup and successful publish behavior while
ensuring paths beginning with "-" are treated as filenames.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 33c86bd2-5d38-4c15-ad7e-c275ae69c520

📥 Commits

Reviewing files that changed from the base of the PR and between 559edaa and aebb7f6.

📒 Files selected for processing (5)
  • .github/scripts/gh-api-retry.sh
  • .github/workflows/rekor-monitor.yaml
  • tools/rekor-monitor/README.md
  • tools/rekor-monitor/doc.go
  • tools/rekor-monitor/main.go

Comment thread .github/scripts/gh-api-retry.sh Resolved
The first scheduled run after #1897 hit the 15-minute per-pass timeout in
the identity scan: the checkpoint had been wedged for hours, so the scan
window had grown to roughly 380k entries. The tool classified the timeout
as operational (correct: no security page, a calm degraded issue), but a
window that large cannot finish inside 15m, so the cursor never advances
and the monitor cannot catch up.

Raise the per-pass timeout (defaultTimeout) from 15m to 45m and the job
backstop (timeout-minutes) from 20m to 50m so a single pass can scan a
large backlog (a multi-hour Sigstore/TUF outage, or an untriaged finding
that deliberately holds the cursor) and advance, after which the hourly
windows return to a few minutes. This doubles as a durable resilience
buffer against future large-window conditions.

Also fold in the post-merge CodeRabbit review nits from #1897:
- Extract the duplicated gh_api_retry helper into
  .github/scripts/gh-api-retry.sh, invoked by both fetch steps, so the
  two copies cannot drift.
- Clarify in the tool README and doc.go that a set-but-missing
  --known-tags-file is a hard error (exit 2), distinct from an empty
  file (disables suppression), and that the CLASSIFICATION line is
  printed for a completed run (exit 0/1/3) but not the exit-2
  argument-error path.

Follow-up to #1897.
Related #1898
Related #1899

Signed-off-by: Brian Lockwood <[email protected]>
@lockwobr
lockwobr force-pushed the fix/rekor-monitor-scan-timeout branch from aebb7f6 to 5769834 Compare July 23, 2026 21:27
@lockwobr

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mchmarny mchmarny 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.

APPROVED — no merge blockers found. Reviewed the timeout and retry-helper changes at the exact head, including failure cleanup and workflow budgets. Focused race tests, affected-package lint, bash and shell validation, actionlint, and yamllint all passed; all live checks are complete with no failures.

@mchmarny
mchmarny merged commit 5a671a9 into main Jul 23, 2026
37 checks passed
@mchmarny
mchmarny deleted the fix/rekor-monitor-scan-timeout branch July 23, 2026 21:51
lockwobr added a commit that referenced this pull request Jul 27, 2026
The identity scan is linear in the window size, so a window that has not
advanced for a while (a multi-hour Sigstore/TUF outage, or a finding that
deliberately holds the cursor) can grow past what one run can scan inside
the 45m pass deadline. On 2026-07-24 the window reached ~1.17M entries and
timed out (operational) every run; the monitor could not self-heal without
a re-baseline, which skips the backlog (a coverage gap).

Make the scan resumable. Split the signed checkpoint (the consistency
anchor, advanced only once the scan reaches head) from a new scannedTo
cursor persisted in a <checkpoint>.scan companion carried in the same
artifact. Each run scans a bounded slice (maxScanEntriesPerRun, in
scanChunkSize chunks), persists progress after each clean chunk, and
resumes there next run. A large backlog is caught up over several hourly
runs, each within budget, with no coverage gap and no re-baseline. A
partial catch-up pass is a clean (exit 0) run; a finding still halts at its
chunk and is re-detected until triaged (so a partial-clean pass never
coexists with an open finding alert). The consistency proof stays O(log n),
so it is never the bottleneck.

Also re-enable the scheduled cron (commented out on 2026-07-24 to pause the
wedged monitor) and upload the progress companion alongside the checkpoint.
An artifact without the companion (a run before this shipped, or one that
did not scan) resumes from 0, i.e. the prior full-window behavior.

Follows #1897 / #1900 / #1903.

Signed-off-by: Brian Lockwood <[email protected]>
lockwobr added a commit that referenced this pull request Jul 28, 2026
The identity scan is linear in the window size, so a window that has not
advanced for a while (a multi-hour Sigstore/TUF outage, or a finding that
deliberately holds the cursor) can grow past what one run can scan inside
the 45m pass deadline. On 2026-07-24 the window reached ~1.17M entries and
timed out (operational) every run; the monitor could not self-heal without
a re-baseline, which skips the backlog (a coverage gap).

Make the scan resumable. Split the signed checkpoint (the consistency
anchor, advanced only once the scan reaches head) from a new scannedTo
cursor persisted in a <checkpoint>.scan companion carried in the same
artifact. Each run scans a bounded slice (maxScanEntriesPerRun, in
scanChunkSize chunks), persists progress after each clean chunk, and
resumes there next run. A large backlog is caught up over several hourly
runs, each within budget, with no coverage gap and no re-baseline. A
partial catch-up pass is a clean (exit 0) run; a finding still halts at its
chunk and is re-detected until triaged (so a partial-clean pass never
coexists with an open finding alert). The consistency proof stays O(log n),
so it is never the bottleneck.

Also re-enable the scheduled cron (commented out on 2026-07-24 to pause the
wedged monitor) and upload the progress companion alongside the checkpoint.
An artifact without the companion (a run before this shipped, or one that
did not scan) resumes from 0, i.e. the prior full-window behavior.

Follows #1897 / #1900 / #1903.

Signed-off-by: Brian Lockwood <[email protected]>
lockwobr added a commit that referenced this pull request Jul 28, 2026
The identity scan is linear in the window size, so a window that has not
advanced for a while (a multi-hour Sigstore/TUF outage, or a finding that
deliberately holds the cursor) can grow past what one run can scan inside
the 45m pass deadline. On 2026-07-24 the window reached ~1.17M entries and
timed out (operational) every run; the monitor could not self-heal without
a re-baseline, which skips the backlog (a coverage gap).

Make the scan resumable. Split the signed checkpoint (the consistency
anchor, advanced only once the scan reaches head) from a new scannedTo
cursor persisted in a <checkpoint>.scan companion carried in the same
artifact. Each run scans a bounded slice (maxScanEntriesPerRun, in
scanChunkSize chunks), persists progress after each clean chunk, and
resumes there next run. A large backlog is caught up over several hourly
runs, each within budget, with no coverage gap and no re-baseline. A
partial catch-up pass is a clean (exit 0) run; a finding still halts at its
chunk and is re-detected until triaged (so a partial-clean pass never
coexists with an open finding alert). The consistency proof stays O(log n),
so it is never the bottleneck.

Also re-enable the scheduled cron (commented out on 2026-07-24 to pause the
wedged monitor) and upload the progress companion alongside the checkpoint.
An artifact without the companion (a run before this shipped, or one that
did not scan) resumes from 0, i.e. the prior full-window behavior.

Follows #1897 / #1900 / #1903.

Signed-off-by: Brian Lockwood <[email protected]>
lockwobr added a commit that referenced this pull request Jul 28, 2026
The identity scan is linear in the window size, so a window that has not
advanced for a while (a multi-hour Sigstore/TUF outage, or a finding that
deliberately holds the cursor) can grow past what one run can scan inside
the 45m pass deadline. On 2026-07-24 the window reached ~1.17M entries and
timed out (operational) every run; the monitor could not self-heal without
a re-baseline, which skips the backlog (a coverage gap).

Make the scan resumable. Split the signed checkpoint (the consistency
anchor, advanced only once the scan reaches head) from a new scannedTo
cursor persisted in a <checkpoint>.scan companion carried in the same
artifact. Each run scans a bounded slice (maxScanEntriesPerRun, in
scanChunkSize chunks), persists progress after each clean chunk, and
resumes there next run. A large backlog is caught up over several hourly
runs, each within budget, with no coverage gap and no re-baseline. A
partial catch-up pass is a clean (exit 0) run; a finding still halts at its
chunk and is re-detected until triaged (so a partial-clean pass never
coexists with an open finding alert). The consistency proof stays O(log n),
so it is never the bottleneck.

Also re-enable the scheduled cron (commented out on 2026-07-24 to pause the
wedged monitor) and upload the progress companion alongside the checkpoint.
An artifact without the companion (a run before this shipped, or one that
did not scan) resumes from 0, i.e. the prior full-window behavior.

Follows #1897 / #1900 / #1903.

Signed-off-by: Brian Lockwood <[email protected]>
lockwobr added a commit that referenced this pull request Jul 28, 2026
The identity scan is linear in the window size, so a window that has not
advanced for a while (a multi-hour Sigstore/TUF outage, or a finding that
deliberately holds the cursor) can grow past what one run can scan inside
the 45m pass deadline. On 2026-07-24 the window reached ~1.17M entries and
timed out (operational) every run; the monitor could not self-heal without
a re-baseline, which skips the backlog (a coverage gap).

Make the scan resumable. Split the signed checkpoint (the consistency
anchor, advanced only once the scan reaches head) from a new scannedTo
cursor persisted in a <checkpoint>.scan companion carried in the same
artifact. Each run scans a bounded slice (maxScanEntriesPerRun, in
scanChunkSize chunks), persists progress after each clean chunk, and
resumes there next run. A large backlog is caught up over several hourly
runs, each within budget, with no coverage gap and no re-baseline. A
partial catch-up pass is a clean (exit 0) run; a finding still halts at its
chunk and is re-detected until triaged (so a partial-clean pass never
coexists with an open finding alert). The consistency proof stays O(log n),
so it is never the bottleneck.

Also re-enable the scheduled cron (commented out on 2026-07-24 to pause the
wedged monitor) and upload the progress companion alongside the checkpoint.
An artifact without the companion (a run before this shipped, or one that
did not scan) resumes from 0, i.e. the prior full-window behavior.

Follows #1897 / #1900 / #1903.

Signed-off-by: Brian Lockwood <[email protected]>
lockwobr added a commit that referenced this pull request Jul 28, 2026
The identity scan is linear in the window size, so a window that has not
advanced for a while (a multi-hour Sigstore/TUF outage, or a finding that
deliberately holds the cursor) can grow past what one run can scan inside
the 45m pass deadline. On 2026-07-24 the window reached ~1.17M entries and
timed out (operational) every run; the monitor could not self-heal without
a re-baseline, which skips the backlog (a coverage gap).

Make the scan resumable. Split the signed checkpoint (the consistency
anchor, advanced only once the scan reaches head) from a new scannedTo
cursor persisted in a <checkpoint>.scan companion carried in the same
artifact. Each run scans a bounded slice (maxScanEntriesPerRun, in
scanChunkSize chunks), persists progress after each clean chunk, and
resumes there next run. A large backlog is caught up over several hourly
runs, each within budget, with no coverage gap and no re-baseline. A
partial catch-up pass is a clean (exit 0) run; a finding still halts at its
chunk and is re-detected until triaged (so a partial-clean pass never
coexists with an open finding alert). The consistency proof stays O(log n),
so it is never the bottleneck.

Also re-enable the scheduled cron (commented out on 2026-07-24 to pause the
wedged monitor) and upload the progress companion alongside the checkpoint.
An artifact without the companion (a run before this shipped, or one that
did not scan) resumes from 0, i.e. the prior full-window behavior.

Follows #1897 / #1900 / #1903.

Signed-off-by: Brian Lockwood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci size/M theme/supply-chain SLSA, SBOM, Sigstore, and provenance verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rekor v2 monitor: release identity / log consistency alert

2 participants