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

Ouverte
#212 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
git, go
Domaine
devtools, security

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
Go
Étoiles
0
Forks
1
Merge moyen
8 h 14 min
PR mergées (30 j)
3

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/Spackle

Toutes les issues de TMHSDigital/Spackle

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.