spackle baseline cannot accept one finding or set an expiry

Ouverte
#191 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
58/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
go
Domaine
cli, security

Piste de recherche

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.

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

Description

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

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.