Skip to content

Test change - enable secret scan using TruffleHog#9055

Open
gmanal wants to merge 1 commit into
NVIDIA:mainfrom
gmanal:enable-secret-scan
Open

Test change - enable secret scan using TruffleHog#9055
gmanal wants to merge 1 commit into
NVIDIA:mainfrom
gmanal:enable-secret-scan

Conversation

@gmanal
Copy link
Copy Markdown

@gmanal gmanal commented May 18, 2026

Description

closes

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@gmanal gmanal requested a review from a team as a code owner May 18, 2026 14:51
@gmanal gmanal requested a review from alliepiper May 18, 2026 14:51
@github-project-automation github-project-automation Bot moved this to Todo in CCCL May 18, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL May 18, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Configured automated secret scanning in the CI/CD pipeline and local development environment using TruffleHog to enhance code security.

Walkthrough

This PR adds secret scanning to the repository using TruffleHog, integrated at both local pre-commit and CI stages. The pre-commit hook and GitHub Actions workflow both reference NVIDIA's centralized security-workflows, enabling consistent scanning across developer environments and automated pipeline checks.

Changes

Secret scanning infrastructure

Layer / File(s) Summary
Pre-commit hook configuration
.pre-commit-config.yaml
Adds secret-scan-trufflehog hook from NVIDIA's centralized security-workflows repository, pinned to main, placed at the start of the pre-commit hook list.
GitHub Actions secret scanning workflow
.github/workflows/secret-scan.yml
Defines Secret Scan (TruffleHog) workflow triggered on pushes to main and pull-request branches, plus manual dispatch. Sets read-only contents permissions, configures concurrency cancellation per ref, and invokes the centralized NVIDIA reusable workflow with repository-dependent runner selection (linux-amd64-cpu4 for NVIDIA/cccl, fallback to ubuntu-latest).

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2150ba70-f7a2-43bb-b4f8-fa11975c7330

📥 Commits

Reviewing files that changed from the base of the PR and between e054ac6 and 68d1dfb.

📒 Files selected for processing (2)
  • .github/workflows/secret-scan.yml
  • .pre-commit-config.yaml

# copy-pr-bot mirror branches; matches the trigger model used by
# ci-workflow-pull-request.yml so PR scans run in the same trust
# context as the rest of CI.
- "pull-request/[0-9]+"
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

GitHub Actions workflow syntax: for on.push.branches, does the pattern pull-request/[0-9]+behave as regex or glob? What pattern should match branches likepull-request/1234?

💡 Result:

In GitHub Actions workflow syntax, the on.push.branches and on.pull_request.branches filters use glob patterns, not regular expressions [1][2][3]. Because these filters use glob matching, the pattern pull-request/[0-9]+ will not behave as a regex. Instead, it will be interpreted literally as a glob pattern, meaning it will only match a branch named exactly "pull-request/[0-9]+". To match branches like pull-request/1234 using glob syntax, you should use the wildcard character * [1][3]. The pattern pull-request/* will match any branch that starts with pull-request/ followed by any characters (excluding a slash, depending on the specific glob implementation, though * is generally sufficient for this structure) [4][3]. If you need to ensure the remainder consists only of digits, glob patterns do not support character classes like [0-9]+ [1][2]. In such cases, you would need to either accept the broader glob match or perform the validation within a job step using a script (e.g., bash) to check the branch name against a regex [5][6].

Citations:


important: Line 25 uses pull-request/[0-9]+, but GitHub Actions branch filters use glob patterns, not regex. This pattern will not match branches like pull-request/1234. Use pull-request/* instead.

# template — verify the released tag's SHA at swap time):
#
# uses: NVIDIA/security-workflows/.github/workflows/secret-scan-trufflehog.yml@ab5558d84285152b16c190f57b79789e452b3f2b # v0.1.0
uses: NVIDIA/security-workflows/.github/workflows/secret-scan-trufflehog.yml@main
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify mutable reusable-workflow refs in GitHub workflows
rg -n 'uses:\s*[^@]+@(main|master|[A-Za-z0-9._/-]+)$' .github/workflows/*.yml

Repository: NVIDIA/cccl

Length of output: 5192


important: Pin reusable workflow uses: to a full 40-character commit SHA instead of @main to prevent unreviewed upstream changes from affecting CI security enforcement.

Comment thread .pre-commit-config.yaml
# TODO: switch `rev: main` to a release tag once NVIDIA/security-workflows
# ships its first release (v0.1.0).
- repo: https://github.com/NVIDIA/security-workflows
rev: main
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify mutable refs to NVIDIA/security-workflows in this PR surface
rg -n 'security-workflows|rev:\s*main|`@main`' .pre-commit-config.yaml .github/workflows/secret-scan.yml

Repository: NVIDIA/cccl

Length of output: 1336


important: Pin rev to an immutable commit SHA instead of main. Mutable branch refs in security-scanning hooks weaken supply-chain integrity; upstream changes can silently alter secret-scanning behavior. The existing TODO acknowledges this—v0.1.0 tag will enable proper pinning.

@github-actions
Copy link
Copy Markdown
Contributor

😬 CI Workflow Results

🟥 Finished in 3h 00m: Pass: 99%/501 | Total: 15d 23h | Max: 2h 31m | Hits: 41%/1659867

See results here.

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant