Skip to content

fix(security): a gitleaks list scan keeps its start and end times in sarif #916

Closed

Description

@dan-petty

Problem

_merge_outcomes (security/gitleaks.py:189-197) builds a new ScanOutcome(status, findings, reasons) for a list target and drops the per-file started_utc and ended_utc that BaseSecurityScanner.scan sets (security/base.py:323-325). A list-target Gitleaks scan therefore has no startTimeUtc or endTimeUtc in its SARIF invocation (security/sarif.py:157-163, :211), although #708 says every scanner that ran reports its start and end times. A directory target is unaffected, because it goes through base.scan once.

Copilot's re-review of release PR #905 mentioned this in its summary, without a thread. P3: SARIF 2.1.0 makes these fields optional.

Acceptance criteria

  • The merged outcome takes the earliest started_utc and the latest ended_utc of the per-file outcomes.
  • A test with no real Gitleaks binary scans a two-file list and asserts that the SARIF invocation for gitleaks has both times, with start no later than end.
  • uv run devops ci passes.

Update 2026-10-08: refinement

The fix shipped (v0.2.25): merge_outcomes keeps the earliest start and latest end (security/base.py:115-130). No test pins it.

  • A two-file list scan with no real Gitleaks asserts the SARIF times, start no later than end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p3-lowscope/securitytype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions