Skip to content

chore(gitleaks): 放行 vault 单测占位凭据的历史误报 - #18

Merged
jamiesun merged 2 commits into
mainfrom
fix/gitleaksignore-vault-fixture
Jul 9, 2026
Merged

jamiesun merged 2 commits into
mainfrom
fix/gitleaksignore-vault-fixture

Conversation

@jamiesun

@jamiesun jamiesun commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

问题

CI 的 gitleaks 任务用 fetch-depth: 0 拉全仓库历史("全历史"扫描是既有设计意图),
但副作用是:扫描任意分支时都会连带拉到其它分支专属的历史 commit

feat/state-inspect-delete#17)新增的内核单测里有一个占位凭据
vault-secret-C0FFEE-99crates/scootlens-kernel/tests/dispatch_p3.rs
用于验证 state.write/state.delete/redaction 生命周期,非真实密钥),
命中 gitleaks 的 generic-api-key 规则。该分支自身已经用
.gitleaksignore 放行,但由于 fetch-depth:0 的连带效应,其它 PR
(如 #15)在这之后重新触发 CI 时也会扫到同一个 commit 并失败——即使
那些 PR 自己的分支上从未出现过这个字符串。

修复

main 上也加同一条 .gitleaksignore(按 commit+file+rule+line 的
fingerprint 精确匹配,不放宽其它扫描覆盖)。任何以 main 为基础重新拉取
历史的 CI 运行都能读到这条放行记录,避免被这个已核实无害的历史 commit
连累。

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

jamiesun and others added 2 commits July 9, 2026 15:02
fetch-depth: 0 令 gitleaks 在扫描任意分支时都会拉到全仓库历史提交
(含其它分支专属的 commit),feat/state-inspect-delete 上的占位凭据
vault-secret-C0FFEE-99(非真实密钥,用于验证 state.write/state.delete/
redaction 生命周期)因而会在其它 PR 的 gitleaks 检查里被重复命中。
按 fingerprint 放行,覆盖所有以 main 为基础拉取历史的 CI 运行。

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jamiesun
jamiesun merged commit ce36e84 into main Jul 9, 2026
11 checks passed
@jamiesun
jamiesun deleted the fix/gitleaksignore-vault-fixture branch July 9, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant