A secret added and removed inside the diff range is never reported

Offen
#212 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
git, go
Bereich
devtools, security

Rechercherichtung

Start with the documented entry points in internal/gitx/gitx.go, internal/seed/secrets.go, and internal/seed/external.go, then read docs/findings.md, docs/comparison.md, and docs/config.md to understand current scan scope and configuration. The acceptance criteria require documenting history coverage and, with an opt-in, reporting secrets added and removed within the range with the commit and redacted value; the issue leaves whole-history behavior and finding status open.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement severity: low

Summary

A --since scan reads the current content of the files that differ between the merge base and HEAD. A credential committed in one commit of a pull request and deleted in a later commit of the same pull request is seen by neither the built-in secret scan nor gitleaks, although it is in the pushed history. Proposal: an opt-in scan of added lines per commit, and at minimum a sentence in the docs.

Where

  • internal/gitx/gitx.go:641-646, :740 (two-point diff for --since)
  • internal/seed/secrets.go:46 (scan over walked files)
  • internal/seed/external.go:216 (gitleaks in directory mode)

Details

The same holds for any secret that was removed from the tree before the first scan. The docs do not mention history as covered or not covered.

Impact

Teams that rely on the pull request gate or a pre-push scan to catch leaked keys. A secret removed in a fixup commit is a common kind of leak, and it still has to be rotated.

Suggested fix

For --since scans, add an opt-in (for example [scan] secrets_history = true or --secrets-history) that runs the built-in secret patterns over the added lines of each commit in <merge-base>..HEAD (with the same --no-textconv --no-ext-diff hardening, bounded by commit count and bytes) and reports a match that is absent from the current tree as a finding located at <commit>:<path>:<line>, with remediation "rotate the credential; removing the line does not remove it from history". Redact the value exactly as the tree scan does. Open questions: whether to offer a whole-history mode for full scans, and how such a finding gets a fingerprint and a status once the branch is squashed. At minimum, state in docs/findings.md or docs/comparison.md that history is not scanned.

Acceptance criteria

  • The docs state whether history is scanned
  • With the opt-in, a secret added and removed within the range is reported with its commit
  • The value is redacted in every output

Getting started

  • Relevant files: internal/gitx/gitx.go, internal/seed/external.go, internal/seed/secrets.go
  • How to run tests: make test-short (Unix) or .\make.ps1 test-short (Windows PowerShell); make lint before you call it done
  • Related docs: docs/findings.md, docs/comparison.md, docs/config.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: M. audit-key: enhancement|internal/seed/secrets.go|secretsSeeder-history

Vorherrschende Sprache
Go
Sterne
0
Forks
1
Ø Merge
8 Std. 14 Min.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TMHSDigital/Spackle

Alle Issues in TMHSDigital/Spackle

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.