Let the config choose which external scanners run and which Semgrep rules they use
还没有人认领这个 Issue。
评估
调研方向
Start at internal/engine/run.go:174-180, where seed.All() is narrowed only for --offline, and copy how offlineSeeders reports a skip. Then read internal/seed/external.go:106 and :172 for the Semgrep invocation and the stale error text, and add the new keys beside exclude/include/disable_rules in internal/config/config.go:121-130, mirroring them in internal/cli/doctor.go:122 and docs/config.md. Done when go test ./internal/seed ./internal/config ./internal/engine passes and skipped scanners appear as disabled in the report and doctor output.
由索引模型根据 Issue 内容生成。
描述
Summary
A scan runs every external scanner it finds on PATH, and Semgrep always runs the p/default registry pack. There is no setting to choose which scanners run, and no way to point Semgrep at the repository's own rules. One error message even tells the user to "remove it from the seeder list", but no such list exists.
Where
internal/engine/run.go:174-180(seed.All(), narrowed only for--offline)internal/seed/external.go:106("--config", "p/default")internal/seed/external.go:172("remove it from the seeder list")internal/config/config.go:121-130([scan]hasexclude,includeanddisable_rulesonly)internal/cli/doctor.go:122
Details
seeders := opts.Seeders
if seeders == nil {
seeders = seed.All()
}
if opts.Config.Offline {
seeders = offlineSeeders(seeders)
}
disable_rules drops leads only after a scanner has run and spent its wall time.
Impact
Today the only way to drop a scanner is to take it off PATH or go fully --offline. That hurts a team that wants gitleaks but not Trivy's database download, or a team whose Trivy is slow on a monorepo. Teams with their own Semgrep rules, which is common, get the generic pack instead, so Spackle repeats generic coverage and misses their project-specific rules.
Suggested fix
- Add
[scan] scanners = [...](an allowlist; empty means every available scanner) and/orskip_scanners. Filterseedersinrun.gobeforeRunAll, and report a skipped scanner as "not run: disabled by configuration", the wayofflineSeederreports its skip. - Add
[scan.semgrep] config = ["p/default"], accepting registry packs or repository-relative paths resolved withwalk.Resolveso a path cannot leave the target. A local path also makes Semgrep usable offline. - Reword
external.go:172to name the real setting. - Mirror the selection in
doctorand the dry-run seeder list.
Open question: whether target-relative Semgrep rule paths should be allowed by default, since the target is untrusted content.
Acceptance criteria
- A config key limits which external scanners run, and skipped ones show as disabled in the report and
doctor. - Semgrep can run a configured pack or a rules path inside the target.
- The "not on PATH" error names a setting that exists.
Getting started
- Relevant files:
internal/engine/run.go,internal/seed/external.go,internal/config/config.go,docs/config.md - How to run tests:
go test ./internal/seed ./internal/config ./internal/engine - Related docs:
docs/config.md
Filed by repo-audit/full-audit at fffef43. Severity: medium. Effort: M. audit-key: enhancement|internal/engine/run.go|seed.All
- 主要语言
- Go
- 星标
- 0
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/Spackle 的其他 Issue
-
enhancement good first issue severity: low
难度 2/5 半天 新手友好度 72/100
TMHSDigital/Spackle#139 ·
-
enhancement good first issue severity: low
难度 2/5 1-3 小时 新手友好度 72/100
TMHSDigital/Spackle#138 ·
-
documentation good first issue severity: low
难度 2/5 1-3 小时 新手友好度 78/100
TMHSDigital/Spackle#135 ·
-
bug good first issue severity: low
难度 2/5 1-3 小时 新手友好度 72/100
TMHSDigital/Spackle#131 ·
-
bug good first issue severity: low
难度 2/5 1-3 小时 新手友好度 78/100
TMHSDigital/Spackle#129 ·
查看 TMHSDigital/Spackle 的全部 Issue
相似的 Issue
-
bug raised-by:reviewer
难度 2/5 1-3 小时 新手友好度 66/100
medici-finance/assay#7655 ·
维护者通常 1 天内回复
-
helm chart: make DaemonSet pod affinity configurable via values.yaml可能已有人在做 @Young-Zen 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
flannel-io/flannel#2632 ·
维护者通常 6 天内回复
-
go-vulnerability security-scan
难度 1/5 1 小时以内 新手友好度 72/100
teslashibe/agent-go#36 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
nwverse/persona#15194 · 1 条评论 ·
维护者通常 1 天内回复
-
bug flaky-test
难度 2/5 1-3 小时 新手友好度 78/100
rosskukulinski/tailworks#411 ·
维护者通常 1 天内回复