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

オープン
#212 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
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分
マージ済み PR(30日)
3

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/Spackle のほかの issue

TMHSDigital/Spackle の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。