feat: implement issue #547 — Compliance: secret_scan_ci_job_present - #550
Conversation
|
Warning Review limit reached
More reviews will be available in 59 minutes and 50 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds two new tests to tests/test_push_protection.bats to verify that the CI workflow uses the gitleaks/gitleaks-action and has the security-events: write permission. The reviewer pointed out that the current implementation is fragile because it assumes the tests are run from the repository root and uses exact string matching with grep which can fail on minor YAML formatting variations. A suggestion was provided to resolve the absolute path to the workflow file and use regular expressions for more robust matching.
There was a problem hiding this comment.
Pull request overview
Implements compliance requirement secret_scan_ci_job_present (Issue #547) by updating this repo’s CI workflow to run secret scanning with the gitleaks/gitleaks-action and adding regression tests that assert the workflow contains the required action and permissions.
Changes:
- Update
.github/workflows/ci.ymlsecret-scan job to usegitleaks/gitleaks-actionand grantsecurity-events: write. - Add Bats tests to assert CI includes the required
gitleaksaction usage and permissions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Switch secret scanning to gitleaks/gitleaks-action and add required security-events: write permission for code scanning uploads. |
tests/test_push_protection.bats |
Add tests that validate the CI workflow contains the required secret-scan configuration. |
Dev-Lead — review-changes (applied)Changes committed and pushed. |
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
|
Note @don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
Superseded by automated re-review at
|
|
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 3bb538e85d2fa83c990a1e02f1dedf8f075bd19a
Review mode: triage-approved (single reviewer)
Summary
Switches the ci.yml secret-scan job from a hand-rolled gitleaks CLI invocation to the SHA-pinned gitleaks/gitleaks-action@ff98106 (v2.3.9), adds a scoped security-events: write permission, and adds two bats tests asserting compliance. Brings the repo into compliance with the org push-protection standard (issue #547). Small (2 files, +26/-15), well-scoped, and CI-green.
Linked issue analysis
Closes #547 — a push-protection compliance `error` (`secret_scan_ci_job_present`) requiring the secret-scan job to use `gitleaks/gitleaks-action`. The PR adopts the action and adds tests mirroring the org check, so the finding is substantively resolved. The change reverts a previously documented decision (a code comment citing #408 about gitleaks-action behavior changes causing spurious failures); however, that risk is directly mitigated here because the action is pinned to a specific SHA (behavior is frozen) and the secret-scan job ran SUCCESS on this PR's head commit.
Findings
- Compliance / correctness: Adopts `gitleaks/gitleaks-action` SHA-pinned per the Action Pinning Policy, with a refresh comment. Good practice. ✓
- Permissions: Adds `security-events: write` scoped to the single secret-scan job (needed for SARIF upload). Minimal and appropriate — no over-broad grant. ✓
- Tests: Two new bats tests verify the action is used and that the write permission is present. They resolve paths via `$BATS_TEST_FILENAME` and match with tolerant `grep -qE` regexes — this addresses gemini-code-assist's MEDIUM feedback about path dependency and fragile YAML matching. ✓
- #408 regression risk (verified non-issue): Reverting to the action could in principle reintroduce the spurious failures the removed comment warned about, but the SHA pin freezes action behavior and the job passed green here. No action needed.
- No security smells, no secret handling beyond the standard `GITHUB_TOKEN`/`GITLEAKS_LICENSE` env wiring the action expects.
CI status
All substantive checks green (CodeQL, gitleaks Secret scan, shellcheck, bats, unit-tests, SonarCloud, agent-shield, etc.). Two checks report CANCELLED — `dev-lead / dispatch` and `dev-lead / ci-relay` — which are the known benign concurrency-cancellation case (issues #608/#609), not failures. SonarCloud Quality Gate passed with 0 new issues.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.



Closes #547
Implemented by dev-lead agent. Please review.