Skip to content

Security workflow's first execution: TruffleHog scans nothing on push:main, and the rollup reports 'found verified secrets' anyway #844

Closed

Description

@hyperpolymath

Summary

Security was one of the four workflows revived by #842 (450734e). Its first
real execution shows a secret-scanning gate that scans nothing on push: main
and then reports that it found secrets.
Both halves are defects, and the
second is the dangerous one: the rollup converts "the scanner could not run"
into "the scanner found verified secrets".

This is a first measurement, not a regression from #842. The workflow was
startup_failure (0 jobs) before that merge, so these jobs had never executed.

Measured — run 35772046*, Security @ 450734ea021167b2d9c2a85e9976bc6708deb379

14 jobs. 5 failed:

Conclusion Job
failure Secret Detection
failure Secret Detection (TruffleHog)
failure Container Security (Trivy) (deploy/Containerfile)
failure Container Security Scan
failure Security Audit Summary (rollup)

Rust Dependency Audit ×2, Secret Detection (Gitleaks), CodeQL Analysis,
CodeQL SAST, both SBOM jobs, both licence jobs and Security Status all
passed.

Fault 1 — TruffleHog scans zero bytes on a push to main

Secret Detection step 3 TruffleHog Secret Scan:

##[error]BASE and HEAD commits are the same. TruffleHog won't scan anything.
Please see documentation (https://github.com/trufflesecurity/trufflehog#octocat-trufflehog-github-action).

On a push to main the action is handed BASE == HEAD, so its diff range is
empty. Secret-scanning coverage on the default branch is currently zero —
the job is red for a configuration reason, not a finding, and no bytes were
examined.

Fault 2 — the rollup asserts a finding that does not exist

Security Audit Summary step 3 Check for failures emits:

##[error]TruffleHog found verified secrets
##[error]Security audit found critical issues
##[error]Process completed with exit code 1.

TruffleHog found no secrets. It found nothing because it read nothing. The
summary branches on the upstream job's result == 'failure' and prints a
message asserting a positive detection. The script also carries an
::error::Rust audit failed branch while Rust Dependency Audit succeeded
twice in the same run.

This is the guard/consumer mismatch pattern: the consumer asks a different
question
than the guard answers. failure means "this job did not complete
successfully"
; it does not mean "a secret was found". Conflating them is
harmful in both directions — it manufactures false alarms now, and the same
confusion is what lets a genuinely-broken scanner read as a clean one later.

Fault 3 — container scanning

Container Security Scan fails at step 5 Upload Trivy scan results, and
Container Security (Trivy) (deploy/Containerfile) fails separately. Not yet
localized; likely a missing/empty SARIF or a permissions issue on upload rather
than a finding. Needs its own diagnosis — do not assume it is a real
vulnerability report until the step is read.

Why this is not a merge blocker

Per the standing ruling that a newly surfaced finding is an issue with
acceptance criteria rather than a gate. main carries exactly one rule type,
required_status_checks, naming only abi-codegen-drift and
zig build test (FFI + wire contract) — both success on this commit
(ABI codegen drift ✅, Zig ✅). None of the five failing jobs is required.

Acceptance criteria

  1. TruffleHog examines a non-empty range on push: main. Either scan the
    full history/filesystem on main and keep the diff mode for
    pull_request, or skip the job on main explicitly — but a skip must be
    recorded as not scanned, never as a pass.
  2. The job prints its denominator: commits (or bytes/paths) actually
    scanned. A scanner that cannot state what it examined is not evidence.
    0 must fail.
  3. Security Audit Summary distinguishes errored from found. A failing
    upstream job produces <job> did not complete (see its log). The phrase
    "found verified secrets" may only be emitted when the scanner reports an
    actual detection count > 0. The Rust audit failed branch must not fire
    while Rust Dependency Audit is green.
  4. Mutant 1 (false-positive): with no secret anywhere in the tree, make
    TruffleHog error (e.g. an invalid arg). The summary must say the scan did
    not run
    , and must not claim a detection.
  5. Mutant 2 (true-positive): plant a detectable, verified-format dummy
    credential. The scan must go red with a detection count, and the summary
    must name it. Remove it; green returns.
  6. Container jobs: root-cause Upload Trivy scan results and either fix it
    or open a separate issue with its own ACs. State plainly whether Trivy
    reported findings or failed to report at all.

Context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions