spackle baseline cannot accept one finding or set an expiry

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli, security

調査の方向性

Start with internal/cli/baseline.go and internal/finding/baseline.go, then read the baseline section of docs/ci.md and inspect how report --finding validates IDs. Check how baseline rewriting handles diff scans and existing entries. Done means the acceptance criteria pass, including documentation updates; the issue suggests running make test-short and make lint.

索引モデルが issue の本文から書いたものです。

説明

enhancement severity: medium

Summary

spackle baseline always accepts every open finding of a run and rewrites the file. Accepting a single false positive, or giving an entry an expiry date, means editing JSON by hand. Proposal: --finding <id> and --expires <date>.

Where

  • internal/cli/baseline.go:22-23 (flags --out and --reason only)
  • internal/cli/baseline.go:51, :87 (file built from every open finding; old entries dropped)
  • internal/finding/baseline.go:39-56, :68-80 (Expires is enforced but nothing writes it)
  • docs/ci.md:182 (tells the user to edit the JSON)

Details

The command builds the file from every open or patch-available finding of the run, so it accepts everything at once. To accept one false positive from a later scan, the user must hand-write an entry with the right id and fingerprint, or rerun spackle baseline, which also accepts every other new finding. The rewrite also drops old entries that match nothing in the run, and nothing checks whether the run was a --since, --changed or --staged scan, where most accepted findings are simply out of scope.

Impact

Teams using the CI gate, which is the documented adoption path. Day-to-day triage is one finding at a time ("this one is a false positive, accept it for 90 days"). Today the easy path accepts real new findings along with the false positive.

Suggested fix

Add --finding <id> (repeatable, same id check as report --finding) and --expires <YYYY-MM-DD>. With --finding, load the existing --out file, add or update only the named entries (with --reason and --expires), and keep every other entry untouched. Without --finding, keep today's behavior, but refuse or warn when the run is a diff scan, since rewriting would drop the entries the diff did not cover.

Acceptance criteria

  • spackle baseline --finding F-... --reason ... --expires 2027-03-01 adds one entry and keeps the rest
  • An unknown finding id is refused with the ids of the run
  • A full rewrite from a diff-scan run warns or refuses
  • docs/ci.md documents both flags

Related: #81

Getting started

  • Relevant files: docs/ci.md, internal/cli/baseline.go, internal/finding/baseline.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/ci.md (baseline section)

Filed by repo-audit/full-audit at 50e92ec. Severity: medium. Effort: S. audit-key: enhancement|internal/cli/baseline.go|runBaseline-finding-expires

主要言語
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 を短くまとめたダイジェスト。