Repository navigation
chore(security+team): 密钥扫描 CI、忽略数据库导出、审计波模板 - #535
Merged
Merged
Conversation
按团队体检结论落地四项优化: 1) .github/workflows/secrets.yml —— gitleaks 8.30.1(固定版本 + sha256 校验),只扫描 本次变更范围(push: before..sha;PR: base..head;新分支退化为 -1),职责是拦住**新增**密钥。 因历史未清洗(全历史 138 处命中),不做全历史扫描。 2) .gitignore —— 增加 backend/*.sql、backend/sql/**/*.sql、*.dump(历史里多次误提交数据库导出, 导出内含用户会话令牌与第三方凭据;种子数据仍用 backend/sql/*.json)。 3) TEAM-PLAYBOOK.md —— 新增 §7「审计波模板」:7 角色 + 7 只读报告任务的可复制计划, 并注明 maxMembers=8 的余量与调大方式。 4) AUDIT-REPORT.md —— 记录密钥扫描 CI 与全历史密钥清单(138 处 / 15 提交,集中在仅存于历史的 sql 导出与旧 .env、旧私钥;当前 HEAD 无真实密钥,audit-security.md:242 为误报), 新增「曾存入存储源/接口密钥的第三方凭据」与 TEAM-PLAYBOOK 索引。 本地验证:gitleaks 干净提交 exit 0;插入 ghp_ 令牌 exit 1;before 全 0 退化分支正常;YAML 解析通过。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
按团队体检结论落地的四项优化(纯 CI / 文档 / 忽略规则,无业务代码改动):
1. 密钥扫描 CI(新增
.github/workflows/secrets.yml)before..sha、PR 用base..head;新分支首次推送(before全 0)退化为-1.env),清洗历史前必然红2.
.gitignore忽略数据库导出backend/*.sql、backend/sql/**/*.sql、*.dump。历史上这些导出被多次提交,内含用户会话令牌(gitleaksjwt97 处)与第三方凭据形态(generic-api-key38 处)。种子数据仍用backend/sql/*.json。3.
TEAM-PLAYBOOK.md新增「审计波模板」7 角色 + 7 个只读报告任务的可复制计划(插件不提供预置队形,模板省掉每次手工列角色),并注明
maxMembers: 8的余量与调大方式。4.
AUDIT-REPORT.md记录结论backend/audit-security.md:242经核实为误报——长标识符非密钥).env.prod中,可解密旧密文)TEAM-PLAYBOOK.md本地验证
gitleaks干净提交no leaks found(exit 0);临时插入ghp_令牌 → 命中github-pat(exit 1);before全 0 的退化分支正常;secrets.ymlYAML 解析通过;本次提交本身用 CI 同款命令扫描为no leaks found。