Skip to content

ci(security): run gitleaks CLI instead of the license-gated action - #84

Merged
shairevivo merged 2 commits into
mainfrom
ci/gitleaks-cli-scan
Nov 13, 2026
Merged

shairevivo merged 2 commits into
mainfrom
ci/gitleaks-cli-scan

Conversation

@shairevivo

Copy link
Copy Markdown
Collaborator

Problem

The Secret scan (gitleaks) job fails on every run — PR, push and the weekly schedule — before scanning anything:

fullsend-ai is an organization. License key is required.
##[error]🛑 missing gitleaks license. Go grab one at gitleaks.io and store it as a GitHub Secret named GITLEAKS_LICENSE.

gitleaks-action v3 requires a paid GITLEAKS_LICENSE for organization-owned repositories. The check is in the action wrapper only — the gitleaks engine itself is MIT-licensed and needs no key. This blocks every PR on the repo, including dependabot ones (#83).

Fix

Replace the action with the pinned, checksum-verified gitleaks release binary and call it directly:

  • Version pinned in env (GITLEAKS_VERSION: 8.30.1); tarball verified against the release's own sha256sum manifest before extraction, so a tampered or truncated download fails loudly.
  • gitleaks git . --redact --no-banner --exit-code 1 scans the full history already fetched by fetch-depth: 0.
  • Same default rule set, same redaction, same fail-on-finding behavior as before.
  • pull-requests: read permission dropped — nothing uses the API any more.

Side benefit: the action capped pull-request scans at the first 30 commits (merges skipped). The CLI scans all of it, so a long PR is now fully covered on every run rather than only by the Monday schedule.

Verification

  • Workflow YAML parses; secret-scan has the expected steps and only contents: read.
  • Ran the identical command against the repo: 1 commits scanned … no leaks found, exit 0.
  • No .gitleaks.toml exists, so both old and new paths use the default rule set — no change in what counts as a finding.

Not fixed here

The dispatch / Review job fails separately with Error: validating Google STS exchange failed (exit 1). That is the Fullsend OIDC → Google Workload Identity Federation handshake, not repo configuration — it needs a look on the harness/platform side.

🤖 Generated with Claude Code

gitleaks-action v3 refuses to run for organization-owned repositories
without GITLEAKS_LICENSE, so the secret-scan job failed before scanning a
single commit. The license check lives in the action wrapper only;
gitleaks itself is MIT-licensed.

Invoke the pinned release binary directly — checksum-verified — and scan
the full history that fetch-depth: 0 already provides. This also drops the
action's 30-commit cap on pull requests, so long PRs are covered on every
run instead of only by the weekly schedule.

Signed-off-by: Shai Revivo <srevivo@redhat.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Run checksum-verified gitleaks CLI in the security workflow

🐞 Bug fix ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Replace the license-gated action so organization-owned repository scans can run.
• Verify a pinned gitleaks binary and scan full Git history on every trigger.
• Remove the unused pull-request permission.
Diagram

graph TD
  History["Git history"] --> Checkout["Full checkout"] --> Scan["Gitleaks CLI"] --> Decision{"Leaks found?"} -->|Yes| Fail["Fail check"]
  Release["Pinned release"] --> Verify["SHA-256 check"] --> Scan
  Decision -->|No| Pass["Pass check"]
Loading
High-Level Assessment

Use the direct CLI invocation: it avoids the action wrapper's license gate while retaining a pinned, checksum-checked download and covering the full fetched history. A package-manager install would offer less explicit version and artifact control.

Files changed (1) +18 / -8

Bug fix (1) +18 / -8
security.ymlReplace license-gated secret-scanning action with verified CLI +18/-8

Replace license-gated secret-scanning action with verified CLI

• Downloads gitleaks 8.30.1, verifies its archive against the release checksum manifest, and scans the full fetched history with redacted output and failure on findings. Removes the action's token and the job's unused pull-request permission.

.github/workflows/security.yml

@qodo-code-review

qodo-code-review Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. A replaced scanner can pass verification ✓ Resolved

Resolving commit: e91352a

Resolution reason
The workflow now pins the expected SHA-256 digest of the gitleaks tarball in GITLEAKS_SHA256 and
verifies the download against that pinned value, no longer fetching the checksum file from the same
release. A replaced release asset therefore fails verification.
Description
The checksum check reads its expected hash from the same release that supplies the gitleaks
executable, rather than from an independently pinned value. If that release’s assets are replaced
together, the check succeeds and the workflow executes the replacement on every scan run.


Informational

2. The security policy understates PR scans ✓ Resolved

Resolving commit: e91352a

Resolution reason
SECURITY.md now says every push, pull request and scheduled run scans full history, replacing the
old first-30-commits description, so the policy matches the workflow's behavior.
Description
SECURITY.md still says pull requests scan only their first 30 commits and that only the weekly run
scans full history. The new gitleaks git . invocation uses the full-history checkout on
pull-request runs too, leaving readers with an incorrect account of when commits are checked.

Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #83
✅ Web pages:
  +15 more
Review mode: Auto: ⚖️ Balanced: Security workflow changes involve supply-chain verification and scan behavior.

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread .github/workflows/security.yml Resolved
Comment thread .github/workflows/security.yml Resolved
Review feedback on the CLI swap:

- The expected sha256 now lives in the workflow instead of being read from
  the release's checksums asset. Both came from the same mutable release, so
  replacing the tarball and its manifest together would have satisfied its
  own verification. Verified against the published v8.30.1 linux_x64 asset:
  551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
- SECURITY.md still described the old 30-commit cap on pull-request scans.
  Every push, pull request and scheduled run now scans the full history.

Signed-off-by: Shai Revivo <srevivo@redhat.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
@shairevivo

Copy link
Copy Markdown
Collaborator Author

Both Qodo findings addressed in e91352a:

  1. Medium — mutable checksum source. Correct: the tarball and its checksums.txt came from the same release, so a replaced pair verified itself. The expected sha256 is now pinned in the workflow (GITLEAKS_SHA256) and the manifest download is gone. Confirmed against the published gitleaks_8.30.1_linux_x64.tar.gz: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb. Version and digest must be bumped together.

  2. Low — SECURITY.md understated PR scans. Correct. Updated to say every push, pull request and scheduled run scans the full history.

On the linked reports that 8.30.1 "detects nothing": not reproducible here. A commit containing a canonical ghp_ PAT → leaks found: 1, exit 1; the repo as it stands → no leaks found, exit 0. The gate still fails on a real finding.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:23 PM UTC · Completed 3:33 PM UTC

Commit: e91352a · View workflow run →

Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $3.83

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 13, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Small CI-only PR (2 files, 36 lines) with one protected-path touch and a CI workflow change driving the Tier 1 score above 1; git history shows low churn, stable files, no fix/revert patterns, and no dependency changes.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

High

  • [protected-path] .github/workflows/security.yml — This PR modifies a protected governance/infrastructure path (.github/). There is no linked issue authorizing a change to CI security infrastructure; the PR body explains the motivation (license-gated gitleaks-action failing every run), but human approval is always required for protected-path changes.
    Remediation: Link an issue that authorizes replacing gitleaks-action with the CLI, and have a maintainer with authority over CI/security workflows review and approve this change.

Medium / Low

  • [edge-case] (medium) .github/workflows/security.yml:61 — gitleaks git . runs without --log-opts, so gitleaks falls back to git log -p -U0 --full-history --all. With fetch-depth: 0 (line 39) checkout fetches every branch and tag, so every PR and push run scans all refs in the repo, not just history reachable from the commit under test. A secret on any unrelated branch (even one later removed) now fails the gate for every PR and push to main, and there is no .gitleaksignore/.gitleaks.toml baseline to acknowledge a rotated historical finding. The comments and SECURITY.md call this "full history", but it is all refs. Separately, the command omits --verbose/--report-path: gitleaks-action ran verbose with a SARIF report, while the CLI without -v prints only a leaks found: N summary — a failing job no longer says which file, commit or rule triggered.
    Remediation: Restrict the scan to the commit under test, e.g. --log-opts="--full-history HEAD" (or origin/${{ github.base_ref }}..HEAD for pull requests, keeping full history for the schedule), and consider a .gitleaksignore baseline. Add --verbose (output stays redacted via --redact), optionally with --report-format sarif --report-path gitleaks.sarif and an upload step.

  • [edge-case] (low) SECURITY.md:31 — The new text claims every run "scans the full history, so a long pull request is covered in full" and drops the previous "merge commits excluded" caveat. gitleaks' default git log -p passes no -m/--diff-merges, so content introduced only in a merge commit (e.g. a conflict resolution) is still not scanned.
    Remediation: Restore a merge-commit caveat, or pass log options that include merge diffs (e.g. --log-opts="--full-history -m HEAD") if merge content should be covered.

  • [missing-authorization] (low) .github/workflows/security.yml — Non-trivial CI security change with no linked issue; PR chore(deps-dev): bump @testing-library/user-event from 14.6.8 to 14.6.9 in the dev-minor-patch group #83 is cited only as a blocked example. No repo policy explicitly requires an issue, so this is advisory.
    Remediation: Optionally open and link an issue describing the license problem and the chosen fix.


Labels: PR changes a GitHub Actions workflow (security.yml secret-scan job).


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

@fullsend-ai-review fullsend-ai-review Bot 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.

See the review comment for full details.

Comment thread .github/workflows/security.yml Resolved
Comment thread SECURITY.md Resolved
@fullsend-ai-review fullsend-ai-review Bot added the github_actions Pull requests that update GitHub Actions code label Nov 13, 2026
@shairevivo
shairevivo merged commit 2123067 into main Nov 13, 2026
53 of 54 checks passed
@shairevivo
shairevivo deleted the ci/gitleaks-cli-scan branch November 13, 2026 15:39
@fullsend-ai-retro

fullsend-ai-retro Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 3:40 PM UTC · Completed 3:50 PM UTC

Commit: e91352a · View workflow run →

Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $3.17

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #84 (gitleaks CLI in place of the license-gated action)

Outcome: a human-authored CI fix was merged 40 minutes after it was opened. The Qodo bot's two findings (the checksum came from the same release as the binary; SECURITY.md was out of date) were both valid. The author fixed both in e91352a, before the fullsend review even ran. The fullsend review (run 43448974767, attempt 2, about $3.83, roughly 8 minutes of agent time) returned CHANGES_REQUESTED. The PR was merged 6 minutes later with no reply.

What I found:

  • The review failed twice on credential setup. On the first commit and on e91352a, dispatch / Review failed at Vertex credential setup with validating Google STS exchange failed. Neither failure posted anything on the PR. The author noticed, mentioned it in the PR body, and re-ran the job by hand at 15:22. That accounts for about 16 of the 34 minutes between the push and the review.
  • The protected-path finding drove the verdict. The only High was [protected-path], raised because .github/ changed and no issue was linked. The orchestrator itself named it as the reason for blocking. A low [missing-authorization] finding repeated the same no-linked-issue point. The orchestrator applied pr-review SKILL.md step 6e as written: no linked issue means High, even though the PR body explained the motivation in detail and the challenger had downgraded the matching intent finding. §6e-1 reconciliation would not have changed this, because it only accepts config, policy or linked-issue evidence. The rule is the gap, not the agent's adherence to it. In this repo the same thing happened on ci(deps): label npm Dependabot PRs for the fullsend fix agent #68, chore: upgrade fullsend to v0.55.0 #80 and ci(security): run gitleaks CLI instead of the license-gated action #84: protected-path was the only High on a human PR. Humans merged over a standing CHANGES_REQUESTED on 4 of the 5 human PRs reviewed (chore(security): harden dependencies, CI, headers and container #25, chore: upgrade fullsend to v0.55.0 #80, feat: connect fullsend to Jira project TSTAPP #82, ci(security): run gitleaks CLI instead of the license-gated action #84).
  • The substantive finding was plausible but unverified. The Medium finding said that gitleaks git . with no --log-opts scans all refs, and that without --verbose it prints no detail on a failure. That is plausible and useful, but neither point was checked against the source or the binary. The sub-agents' curl calls to github.com failed because the sandbox has no network, and the findings were not marked as unverified. The author did not respond, so I can't tell whether this was a real catch or noise.
  • The label survey hit a missing model. It first tried claude-haiku-4-5@20251001 ("may not exist" on Vertex), then retried on Sonnet.

No new proposals. Every improvement I found is already tracked in an open issue. New evidence from this PR:

Note: the retro run's own log was not readable yet, so the agents repo comes from the review run log (fullsend-ai/agents@v0.55.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant