-
Notifications
You must be signed in to change notification settings - Fork 312
feat(security): onboard pre-commit and Pulse secret scanning #2405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c5c2cf8
bc302de
b0d89d5
ff758ac
3e7b711
94851cd
7001fc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # CI secret-scan enforcement via NVIDIA/security-workflows (Pulse). | ||
| # Runs on Linux nv-gha-runners (Pulse Docker image + OIDC/Vault) — Linux-only by design. | ||
| # The local secret-scan-trufflehog pre-commit hook is cross-platform (Linux/macOS/Windows via Git Bash). | ||
| # Pinned to a reviewed commit SHA; bump when NVIDIA/security-workflows consolidates. | ||
|
|
||
| name: Secret Scan (Pulse) | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - ctk-next | ||
| # copy-pr-bot mirror branches — trusted PR execution context | ||
| - "pull-request/[0-9]+" | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-on-${{ github.event_name }}-from-${{ github.ref_name }} | ||
| cancel-in-progress: true | ||
|
|
||
| # Caller must grant at least every permission the reusable workflow declares | ||
| # (a reusable workflow requesting more than the caller allows fails at load time). | ||
| permissions: | ||
| contents: read | ||
| id-token: write # OIDC -> Vault -> nvcr.io image pull | ||
| security-events: write # publish redacted SARIF to code scanning | ||
| actions: read # reusable workflow declares actions: read (upload-sarif) | ||
|
|
||
| jobs: | ||
| secret-scan: | ||
| name: Secret Scan | ||
| # Pulse needs nv-gha-runners + Vault/nvcr vars; skip on forks. | ||
| if: github.repository == 'NVIDIA/cuda-python' | ||
| uses: NVIDIA/security-workflows/.github/workflows/secret-scan-pulse.yml@69032f641c3c34e0c0b46f636b54ed2b101b7aa4 | ||
| with: | ||
| runs-on: linux-amd64-cpu4 | ||
| # Set failure_policy explicitly so enforcement can't drift with upstream defaults. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the Linux-only execution context intentional? The called workflow relies on POSIX shell syntax,
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| # unverified — fail on verified/live secrets (183); warn on unverified (185) [default] | ||
| # strict — fail on any finding (verified or unverified) | ||
| # all — warn only; never fail the job on findings | ||
| failure_policy: unverified | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVIDIA/cuda-pythonis public. GitHub documentsactions: readas required byupload-sarifonly for private repositories; this workflow otherwise needscontents: read,id-token: write, andsecurity-events: write. Could we dropactions: readhere to keep the caller token at the minimum scope?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction to my earlier "done" — I reverted this;
actions: readis required here after all, though not for the private-repo reason.The mechanism is reusable-workflow permission validation, not an intersection. The called workflow (
NVIDIA/security-workflows/.github/workflows/secret-scan-pulse.yml, SHA-pinned) declaresactions: readin its ownpermissions:block, and GitHub requires the caller to grant at least every permission the reusable workflow declares. Withactions: readremoved, the caller offeredactions: noneand the run failed at load time:Dropping it from the caller would only be valid if we also dropped it from the reusable definition — but that workflow is generic and also consumed by private repos, where
upload-sarifgenuinely needsactions: read. So the reusable correctly keeps declaring it, and public callers grant it (harmless on public). Restored in 94851cd.