Skip to content

chore: bootstrap trufflehog secrets scan [skip ci]#504

Merged
KooshaPari merged 1 commit into
mainfrom
chore/add-trufflehog-2026-05-02
May 2, 2026
Merged

chore: bootstrap trufflehog secrets scan [skip ci]#504
KooshaPari merged 1 commit into
mainfrom
chore/add-trufflehog-2026-05-02

Conversation

@KooshaPari
Copy link
Copy Markdown
Owner

@KooshaPari KooshaPari commented May 2, 2026

User description

Summary

  • Bootstrap TruffleHog OSS secrets scan workflow at .github/workflows/trufflehog.yml
  • Runs on all push and pull_request events to all branches

🤖 Generated by automated bootstrap 2026-05-02

Note

Medium Risk
Adds a new secrets-scanning GitHub Action that runs on every push/PR across all branches, which may increase CI load/noise and potentially duplicate existing scanning. It also pins trufflesecurity/trufflehog to @main with debug: true, which can introduce non-determinism and more verbose logs.

Overview
Adds a new GitHub Actions workflow, .github/workflows/trufflehog.yml, to run TruffleHog OSS on every push and pull request across all branches.

The workflow checks out full git history (fetch-depth: 0) and runs trufflesecurity/trufflehog@main with base_depth: 1 and debug: true.

Reviewed by Cursor Bugbot for commit f502a37. Bugbot is set up for automated code reviews on this repo. Configure here.


CodeAnt-AI Description

Add automatic secret scanning on pushes and pull requests

What Changed

  • A new security scan now runs on every push and pull request across all branches
  • The scan checks the full repository history, so it can catch secrets that were added earlier
  • Scan output includes more detail for reviewing findings

Impact

✅ Earlier secret leak detection
✅ Fewer accidental credential exposures
✅ Clearer security scan results

🔄 Retrigger CodeAnt AI Review

Details

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Copilot AI review requested due to automatic review settings May 2, 2026 15:17
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 2, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Warning

Rate limit exceeded

@KooshaPari has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 54 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ 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: ASSERTIVE

Plan: Pro

Run ID: 450205dd-56f7-4f81-9eb4-a87da46fb890

📥 Commits

Reviewing files that changed from the base of the PR and between 1b97a89 and f502a37.

📒 Files selected for processing (1)
  • .github/workflows/trufflehog.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/add-trufflehog-2026-05-02

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
Review rate limit: 0/1 reviews remaining, refill in 59 minutes and 54 seconds.

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

@KooshaPari KooshaPari merged commit cc59324 into main May 2, 2026
14 checks passed
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

Comment on lines +9 to +20
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
with:
path: ./
base_depth: 1
debug: true
@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label May 2, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because on-demand usage is turned off. To enable Bugbot Autofix, turn on on-demand usage and set a spend limit in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f502a37. Configure here.

with:
path: ./
base_depth: 1
debug: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Invalid action inputs silently ignored by workflow

Medium Severity

The base_depth and debug inputs are not valid parameters for the trufflesecurity/trufflehog action. The action only accepts path, base, head, extra_args, and version. GitHub Actions silently ignores unknown inputs, so these settings have no effect. If debug output is desired, it needs to go through extra_args: --debug.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f502a37. Configure here.

with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unpinned action ref creates supply chain risk

High Severity

The trufflesecurity/trufflehog action is referenced via @main instead of a pinned commit SHA. The existing secrets-scan.yml already pins this same action to a specific commit hash. Using a mutable branch reference allows a compromised upstream repository to execute arbitrary code in CI without any change to this repo.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f502a37. Configure here.

with:
path: ./
base_depth: 1
debug: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Duplicate secrets scan workflow already exists

Medium Severity

This workflow duplicates the existing secrets-scan.yml, which already runs TruffleHog with the same checkout and scan configuration. The new workflow actually broadens the trigger to all branches and runs on every push/PR, but uses a less secure (unpinned) action reference and invalid parameters. Having two overlapping TruffleHog workflows wastes CI resources and creates maintenance confusion.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f502a37. Configure here.

branches: ["**"]
jobs:
trufflehog:
runs-on: ubuntu-latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing permissions block grants overly broad token access

Medium Severity

The workflow lacks a top-level permissions block, so it inherits the repository's default GITHUB_TOKEN permissions, which may include write access to contents, pull requests, packages, and more. The existing secrets-scan.yml correctly restricts this to permissions: contents: read. Combined with the unpinned action reference and the broad trigger on all branches (including fork PRs), this unnecessarily widens the attack surface.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f502a37. Configure here.

with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 Architect Review — HIGH

The workflow uses trufflesecurity/trufflehog@main, which reintroduces a floating reference for the same action that is pinned to a specific commit in secrets-scan.yml (with a comment noting it "was: @main"), making scan behavior non-deterministic and weakening supply-chain control relative to the repo's established pinning practice.

Suggestion: Pin trufflesecurity/trufflehog to an immutable commit SHA (or tightly controlled release tag), aligning with secrets-scan.yml and other workflows, and update it via explicit dependency maintenance.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is an **Architect / Logical Review** comment left during a code review. These reviews are first-class, important findings — not optional suggestions. Do NOT dismiss this as a 'big architectural change' just because the title says architect review; most of these can be resolved with a small, localized fix once the intent is understood.

**Path:** .github/workflows/trufflehog.yml
**Line:** 16:16
**Comment:**
	*HIGH: The workflow uses `trufflesecurity/trufflehog@main`, which reintroduces a floating reference for the same action that is pinned to a specific commit in `secrets-scan.yml` (with a comment noting it "was: @main"), making scan behavior non-deterministic and weakening supply-chain control relative to the repo's established pinning practice.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
If a suggested approach is provided above, use it as the authoritative instruction. If no explicit code suggestion is given, you MUST still draft and apply your own minimal, localized fix — do not punt back with 'no suggestion provided, review manually'. Keep the change as small as possible: add a guard clause, gate on a loading state, reorder an await, wrap in a conditional, etc. Do not refactor surrounding code or expand scope beyond the finding.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 2, 2026

CodeAnt AI finished reviewing your PR.

@KooshaPari KooshaPari review requested due to automatic review settings May 2, 2026 15:38
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 2, 2026

Code Review Summary

Status: 5 Issues Found | Recommendation: Request Changes - Do Not Merge

Overview

Severity Count
CRITICAL 3
WARNING 2
Issue Details (click to expand)

CRITICAL

File Line Issue
.github/workflows/trufflehog.yml 1-20 Duplicate workflow - A secrets-scan.yml already exists with identical TruffleHog scanning. This PR adds redundant duplicate workflow.
.github/workflows/trufflehog.yml 16 Unpinned action - Uses trufflesecurity/trufflehog@main. Supply chain risk. Pin to a specific commit SHA like the existing workflow: 3fc0c2aa6648d54242e4af6fbfde0701796e4fb0.
.github/workflows/trufflehog.yml 9 Missing permissions block - No permissions: section. GitHub grants overly broad default token access. Must declare permissions: contents: read minimum.

WARNING

File Line Issue
.github/workflows/trufflehog.yml 18-19 Invalid action inputs - base_depth and debug are not valid TruffleHog action inputs. They will be silently ignored. Use extra_args to pass CLI flags instead.
.github/workflows/trufflehog.yml 4,6 Overly broad branch patterns - branches: ["**"] triggers on every branch. Use [main] like the existing workflow to run scans only on primary branch.
Other Observations (not in diff)

Existing Correct Implementation

The repository already has a properly configured secrets-scan.yml (.github/workflows/secrets-scan.yml) that:

  • Pins the TruffleHog action to a specific commit
  • Declares permissions: contents: read
  • Uses extra_args: --only-verified for additional filtering
  • Runs only on main branch
  • Includes a weekly schedule via cron

This new PR workflow is inferior to the existing one and adds no value.

Recommended Action

Close/decline this PR and rely on the existing .github/workflows/secrets-scan.yml. If modifications are needed to the secrets scan, update that file directly.

Files Reviewed (1 file)
  • .github/workflows/trufflehog.yml (added)

Reviewed by step-3.5-flash · 96,382 tokens

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 8, 2026

CodeAnt AI is running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:S This PR changes 10-29 lines, ignoring generated files and removed size:S This PR changes 10-29 lines, ignoring generated files labels May 8, 2026
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 8, 2026

Sequence Diagram

This PR adds a GitHub Actions workflow that runs a TruffleHog secrets scan on every push and pull request, checking the repository history and reporting results back to GitHub.

sequenceDiagram
    participant Developer
    participant GitHub
    participant Workflow
    participant Repository
    participant TruffleHog

    Developer->>GitHub: Push code or open pull request
    GitHub->>Workflow: Trigger TruffleHog secrets scan job
    Workflow->>Repository: Checkout code with full history
    Workflow->>TruffleHog: Run secrets scan with configured depth
    TruffleHog-->>Workflow: Return scan findings
    Workflow-->>GitHub: Publish secrets scan status and logs
Loading

Generated by CodeAnt AI

Comment on lines +12 to +16
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 Architect Review — HIGH

The new TruffleHog workflow omits an explicit permissions block and uses floating action refs (actions/checkout@v4 and trufflesecurity/trufflehog@main), which is inconsistent with this repo's established workflow-hardening pattern of declaring least-privilege permissions and pinning actions (e.g., secrets-scan.yml:9-10 and secrets-scan.yml:16,19 where TruffleHog was explicitly pinned away from @main).

Suggestion: Align this workflow with existing security conventions by adding an explicit minimal permissions block and pinning actions/checkout and trufflesecurity/trufflehog to vetted SHAs or stable tags consistent with secrets-scan.yml and other workflows.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is an **Architect / Logical Review** comment left during a code review. These reviews are first-class, important findings — not optional suggestions. Do NOT dismiss this as a 'big architectural change' just because the title says architect review; most of these can be resolved with a small, localized fix once the intent is understood.

**Path:** .github/workflows/trufflehog.yml
**Line:** 12:16
**Comment:**
	*HIGH: The new TruffleHog workflow omits an explicit `permissions` block and uses floating action refs (`actions/checkout@v4` and `trufflesecurity/trufflehog@main`), which is inconsistent with this repo's established workflow-hardening pattern of declaring least-privilege permissions and pinning actions (e.g., `secrets-scan.yml:9-10` and `secrets-scan.yml:16,19` where TruffleHog was explicitly pinned away from `@main`).

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
If a suggested approach is provided above, use it as the authoritative instruction. If no explicit code suggestion is given, you MUST still draft and apply your own minimal, localized fix — do not punt back with 'no suggestion provided, review manually'. Keep the change as small as possible: add a guard clause, gate on a loading state, reorder an await, wrap in a conditional, etc. Do not refactor surrounding code or expand scope beyond the finding.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 8, 2026

CodeAnt AI finished running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 8, 2026

CodeAnt AI is running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:S This PR changes 10-29 lines, ignoring generated files and removed size:S This PR changes 10-29 lines, ignoring generated files labels May 8, 2026
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 8, 2026

Sequence Diagram

This PR adds a GitHub Actions workflow that runs a TruffleHog secrets scan on every push and pull request, checking full git history and reporting findings in the GitHub checks UI.

sequenceDiagram
    participant Developer
    participant GitHub
    participant Workflow
    participant Repo
    participant TruffleHog

    Developer->>GitHub: Push commit or open pull request
    GitHub->>Workflow: Trigger TruffleHog Secrets Scan workflow
    Workflow->>Repo: Checkout code with full git history
    Workflow->>TruffleHog: Run secrets scan with configured options
    TruffleHog-->>Workflow: Return scan findings
    Workflow-->>GitHub: Publish secrets scan results for the change
Loading

Generated by CodeAnt AI

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 8, 2026

CodeAnt AI finished running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 9, 2026

CodeAnt AI is running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added size:S This PR changes 10-29 lines, ignoring generated files and removed size:S This PR changes 10-29 lines, ignoring generated files labels May 9, 2026
@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 9, 2026

Sequence Diagram

This PR adds a GitHub Actions workflow that runs a TruffleHog OSS secrets scan on every push and pull request across all branches using the full git history.

sequenceDiagram
    participant Developer
    participant GitHub
    participant CheckoutAction
    participant TruffleHog

    Developer->>GitHub: Push or open pull request
    GitHub->>CheckoutAction: Run checkout with full history
    CheckoutAction-->>GitHub: Repository code
    GitHub->>TruffleHog: Run secrets scan with base depth 1
    TruffleHog-->>GitHub: Return secrets scan results
Loading

Generated by CodeAnt AI

@codeant-ai
Copy link
Copy Markdown

codeant-ai Bot commented May 9, 2026

CodeAnt AI finished running the review.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

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

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants