verify turns a baseline-accepted finding back to open

未关闭
#193 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
cli, security

调研方向

Read internal/engine/verify.go at the listed Verify locations, then check how baselines are applied in internal/finding/baseline.go and internal/engine/run.go. Add a test for verifying a baseline accepted finding whose proof still succeeds; run make test-short and confirm the finding remains accepted and its SARIF suppression is retained.

由索引模型根据 Issue 内容生成。

描述

bug severity: low

Summary

spackle verify on a run made with a baseline moves every accepted finding whose proof still reproduces back to open.

Where

  • internal/engine/verify.go:151, :172, :277 (Verify sets StatusOpen unconditionally)
  • internal/finding/baseline.go:144
  • internal/engine/run.go:666 (baseline applied after the proof)

Details

A scan applies the baseline when it writes a finding, after the proof ran, so a finding can be accepted and still have a demonstrated proof and a stored manifest. Verify selects jobs by proof status only and, when the proof still succeeds, sets f.Status = finding.StatusOpen. Verify never loads the baseline, and the accept reason is left on the now-open finding. Read from the code; not executed.

Impact

The report shows the finding as open with an "Accepted because" line, the SARIF suppression is dropped, and gates or comparisons that read the stored run count it again.

Steps to reproduce

  1. Agentic scan with a container runtime and a baseline entry matching a finding that the prover demonstrates; the run stores it as accepted.
  2. Run spackle verify <run> without changing the code.
  3. The stored status becomes open.

Suggested fix

In Verify, keep the accepted status when the proof still succeeds (only update the proof result), or clear the accept reason and re-apply the configured baseline before appending. Decide separately whether an accepted finding whose proof no longer succeeds should become fixed.

Acceptance criteria

  • A test verifies a run with an accepted, demonstrated finding and asserts the status stays accepted
  • The SARIF suppression is still present after verify

Related: #81

Getting started

  • Relevant files: internal/engine/run.go, internal/engine/verify.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: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: bug|internal/engine/verify.go|Verify-accepted-status

主要语言
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 摘要。