Skip to content

Review finding: the nightly secret scan's history range is empty #370

Open

Description

@kiwidream

Summary

The nightly scanner run's history scan covers an empty range, so the nightly gitleaks history scan checks no commits.

Severity: medium. It's a coverage gap in the secret scan, not a false positive. Found while reviewing the signed-commit rollout; it predates that work.

Observed

Confidence: from reading the workflow; the run's own output wasn't checked.

  • .github/workflows/ci-nightly-heavy.yml runs on schedule (the default branch, main) and on workflow_dispatch.
  • Its "Run scanner evidence" step sets source_commit="$(git rev-parse HEAD)" and history_diff_base_ref="origin/main".
  • ci/scanners/run-scanners.py's history_scope() turns that into merge-base(source, origin/main)..source.
  • On a scheduled run, HEAD is main's tip, so the range is main..main, which is empty.

Expected

The nightly history scan covers a meaningful range. That might be the whole history (no --history-diff-base-ref, so --all), or the commits since the last scanned commit, with the coverage gap recorded when it can't be computed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions