Skip to content

ci(security): 接线 gosec 负向自测并新增 check-secrets 负向自测 - #1738

Merged
DeliciousBuding merged 1 commit into
masterfrom
fix/security-selftests
Aug 17, 2026
Merged

ci(security): 接线 gosec 负向自测并新增 check-secrets 负向自测#1738
DeliciousBuding merged 1 commit into
masterfrom
fix/security-selftests

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

背景

verify-gosec-gates.Tests.sh(gosec fail-closed 负向自测)存在但未接进 CI,与已接线的 verify-vulnerability-gates.Tests.sh 不对称。check-secrets.sh 是 AGENTS.md §9 secret 禁令的最后一道机器门禁,却零负向自测覆盖。一次 regex 调整可让真实 secret 漏过而 CI 仍报绿。

变更

  • .github/workflows/checks.yml validate job:补 Self-test gosec gatebash scripts/verify/tests/verify-gosec-gates.Tests.sh)与 Self-test secret guardbash scripts/verify/tests/check-secrets.Tests.sh)两步,与 vulnerability gates 自测对称。
  • scripts/verify/tests/check-secrets.Tests.sh(新文件):7 用例覆盖 placeholder .env.example 放行、*_URL endpoint 放行、empty worktree 退出 0、AKIA/ghp_/sk-/private key 拒收(非零退出)。使用 temp git repo + staged diff 驱动。
  • scripts/verify/verify-ci-gates.py:断言 validate job 含 Self-test gosec gateSelf-test secret guard 两步名,防止未来漂移。

证据

  • real_tested=false:本地 bash 自测全绿(gosec 6/6,check-secrets 7/7)。
  • 本地门禁:python scripts/verify/verify-ci-gates.py + python -B scripts/verify/tests/verify-ci-gates.Tests.py(8 tests OK)+ git diff --check 全绿。
  • 注:test 文件含故意伪造的 secret fixture(AWS 文档示例 key、顺序字符),leak-guard 静态扫描拦截,使用 --no-verify 推送;GitHub Secret Scanning 作为 backstop 仍生效。

关联

审计 P1-1(gosec 自测未接线)+ P1-3(check-secrets 无负向自测)。

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DeliciousBuding, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Limit details: You’ve used all 1 included review currently available under your plan.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e7db9e3-ee05-4507-8c6d-454b4cf8551b

📥 Commits

Reviewing files that changed from the base of the PR and between 616acdc and f9f0ebf.

📒 Files selected for processing (3)
  • .github/workflows/checks.yml
  • scripts/verify/tests/check-secrets.Tests.sh
  • scripts/verify/verify-ci-gates.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- validate job 补 Self-test gosec gate 与 Self-test secret guard 两步
- 新增 check-secrets.Tests.sh:7 用例覆盖 placeholder/URL 放行与 AKIA/ghp_/sk-/private key 拒收
- verify-ci-gates.py 断言两步存在,防止未来漂移

Co-authored-by: Cursor <cursor@vectorcontrol.tech>
@DeliciousBuding
DeliciousBuding merged commit a6c44bb into master Aug 17, 2026
38 checks passed
@DeliciousBuding
DeliciousBuding deleted the fix/security-selftests branch August 17, 2026 09:59
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