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

未關閉
#212 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
git, go
領域
devtools, security

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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

主要語言
Go
星號
0
分支
1
平均合併
8 小時 14 分鐘
30 天內合併 PR
3

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/Spackle 的其他 Issue

查看 TMHSDigital/Spackle 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。