Skip to content

ci: add gitleaks secret-scan job to ci.yml - #124

Merged
don-petry merged 13 commits into
mainfrom
claude/issue-96-20260419-1649
May 21, 2026
Merged

ci: add gitleaks secret-scan job to ci.yml#124
don-petry merged 13 commits into
mainfrom
claude/issue-96-20260419-1649

Conversation

@don-petry

Copy link
Copy Markdown
Contributor

Summary

  • Adds the required secret-scan job to ci.yml per the push-protection standard
  • Uses gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 (v2.3.9), SHA-pinned per Action Pinning Policy
  • fetch-depth: 0 to scan full git history; --redact to keep secrets out of logs; --exit-code 1 to fail the build on findings
  • Adds .gitleaksignore with fingerprints for 7 confirmed false-positive findings in historical commit 865de69b (documentation paths containing "api-key" substring, not real credentials)

Why previous PRs did not close the issue

Test plan

  • CI secret-scan job passes (gitleaks finds no real secrets)
  • .gitleaksignore suppresses the 7 known false positives from commit 865de69b
  • Compliance audit check secret_scan_ci_job_present passes on next run

Closes #96

Generated with Claude Code

Adds the required `secret-scan` job per the push-protection standard
(petry-projects/.github/standards/push-protection.md#required-ci-job).

- Uses `gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7` (v2.3.9)
  — compliance audit checks for `uses: gitleaks/gitleaks-action@` pattern
- SHA-pinned per Action Pinning Policy (ci-standards.md)
- `fetch-depth: 0` to scan full git history
- `--redact` to prevent leaked values appearing in workflow logs
- `--exit-code 1` to fail the build on any finding
- Adds `.gitleaksignore` with fingerprints for 7 confirmed false-positive
  findings in commit 865de69 (documentation paths containing "api-key")

Closes #96

Co-authored-by: don-petry <don-petry@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 19, 2026 16:53
@coderabbitai

coderabbitai Bot commented Apr 19, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 58 minutes and 57 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2a053491-96b8-4e27-be17-d2469c885e56

📥 Commits

Reviewing files that changed from the base of the PR and between 37467e5 and 96a9270.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .gitleaksignore
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-96-20260419-1649

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 and usage tips.

gitleaks-action v2 requires GITLEAKS_LICENSE for organization repos.
Add it as a secret reference so the job passes once the secret is
configured at org or repo level.

Co-authored-by: don-petry <don-petry@users.noreply.github.com>
@don-petry

Copy link
Copy Markdown
Contributor Author

CI Status: Action Required

The secret-scan job fails because gitleaks-action v2 requires a GITLEAKS_LICENSE key for organization repos.

What's needed

Set the GITLEAKS_LICENSE secret at the org level (preferred, so all repos benefit) or at the repo level:

  1. Get a free license at gitleaks.io — it's free for open-source/personal-use org repos
  2. Add it as a GitHub secret named GITLEAKS_LICENSE:
    • Org level: Settings → Secrets and variables → Actions → New organization secret
    • Repo level: Settings → Secrets and variables → Actions → New repository secret

What this PR does

  • Adds secret-scan job to ci.yml using gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 (v2.3.9, SHA-pinned)
  • Adds .gitleaksignore with fingerprints for 7 confirmed false-positive findings in commit 865de69b
  • The compliance audit check secret_scan_ci_job_present will pass once this PR is merged (it looks for the uses: gitleaks/gitleaks-action@ pattern in ci.yml)

Once GITLEAKS_LICENSE is configured, re-running the CI job will pass.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a required CI secret-scanning job to bring the repository in line with the org push-protection standard and suppresses known historical false positives.

Changes:

  • Added a new secret-scan job in CI using SHA-pinned gitleaks/gitleaks-action and full-history checkout.
  • Added .gitleaksignore entries to suppress 7 reviewed false positives from a historical commit.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/ci.yml Introduces the secret-scan job running gitleaks in CI (full history, fail on findings).
.gitleaksignore Adds fingerprints to ignore known false-positive matches in historical content.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
@github-actions

Copy link
Copy Markdown
Contributor

Auto-rebase blocked — the base branch contains .github/workflows/ changes that require the workflows permission to merge into this branch, but the auto-rebase workflow's token does not have that permission.

Please rebase this branch manually:

git fetch origin
git rebase origin/main
git push --force-with-lease

@don-petry
don-petry enabled auto-merge (squash) April 25, 2026 18:15
@don-petry

Copy link
Copy Markdown
Contributor Author

@claude Please address all open review comments on this PR from CodeRabbit and Copilot.

@claude

claude Bot commented May 6, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: c9e7d0d07f5fc73ce1d04e99150c8daab9e45fa6
Review mode: triage-approved (single reviewer)

Summary

Adds a secret-scan job to ci.yml using gitleaks/gitleaks-action@ff98106e (v2.3.9, SHA-pinned per org policy). The job runs with scoped permissions (contents: read, security-events: write), full-history checkout, and --redact to prevent secret values from appearing in logs. A .gitleaksignore file suppresses 7 confirmed false-positive generic-api-key findings from historical commit 865de69b — all are documentation file paths containing the substring "api-key", not actual credentials.

Linked issue analysis

Closes #96 (secret_scan_ci_job_present compliance finding). The PR adds exactly the required gitleaks/gitleaks-action@ pattern that the compliance audit checks for. The PR body also documents why two prior attempts (#107, #119) did not close the issue.

Findings

Security

  • Action is SHA-pinned ✓
  • Permissions are scoped to minimum required ✓
  • --redact flag prevents secret leakage in logs ✓
  • GITHUB_TOKEN and GITLEAKS_LICENSE are referenced via secrets context (not hardcoded) ✓
  • .gitleaksignore entries are all from a single historical commit on documentation files — confirmed false positives ✓

Minor note (non-blocking)

  • Copilot flagged that the inline comment ci-standards.md#action-pinning-policy references a path that doesn't exist in this repo. Consider using the full URL to the org-level doc: https://github.com/petry-projects/.github/blob/main/ci-standards.md#action-pinning-policy. This is a documentation-comment quality issue, not a functional concern.

CI status

All checks passed:

  • Secret scan (gitleaks): ✓ SUCCESS
  • CodeQL (actions): ✓ SUCCESS
  • SonarCloud: ✓ SUCCESS (0 new issues, Quality Gate passed)
  • AgentShield: ✓ SUCCESS
  • CodeRabbit: ✓ SUCCESS
  • All other checks: ✓ SUCCESS or SKIPPED (expected)

Reviewed automatically by the don-petry PR-review agent (single-reviewer). Reply with @don-petry if you need a human.

@don-petry
don-petry requested a review from a team as a code owner May 19, 2026 05:07
@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Contributor Author

@dev-lead - please fix this PR

@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit 720424f into main May 21, 2026
19 of 20 checks passed
@don-petry
don-petry deleted the claude/issue-96-20260419-1649 branch May 21, 2026 14:15
don-petry added a commit that referenced this pull request Jun 19, 2026
* ci: add gitleaks secret-scan job to ci.yml

Adds the required `secret-scan` job per the push-protection standard
(petry-projects/.github/standards/push-protection.md#required-ci-job).

- Uses `gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7` (v2.3.9)
  — compliance audit checks for `uses: gitleaks/gitleaks-action@` pattern
- SHA-pinned per Action Pinning Policy (ci-standards.md)
- `fetch-depth: 0` to scan full git history
- `--redact` to prevent leaked values appearing in workflow logs
- `--exit-code 1` to fail the build on any finding
- Adds `.gitleaksignore` with fingerprints for 7 confirmed false-positive
  findings in commit 865de69 (documentation paths containing "api-key")

Closes #96

Co-authored-by: don-petry <don-petry@users.noreply.github.com>

* ci: add GITLEAKS_LICENSE env var to secret-scan job

gitleaks-action v2 requires GITLEAKS_LICENSE for organization repos.
Add it as a secret reference so the job passes once the secret is
configured at org or repo level.

Co-authored-by: don-petry <don-petry@users.noreply.github.com>

* test: verify gitleaks with license secret

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: don-petry <don-petry@users.noreply.github.com>
Co-authored-by: Claude <claude@anthropic.com>
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.

Compliance: secret_scan_ci_job_present

4 participants