Repository navigation
Adopt the AMD repository baseline: security scanning - #393
Merged
Merged
Conversation
Closed
Security scan found no critical or high findings on lines changed by this pull requestView the security scan run for complete reports. “New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta. |
demandal25
force-pushed
the
security-scan-baseline
branch
2 times, most recently
from
October 21, 2026 03:54
640f444 to
e61ff63
Compare
demandal25
marked this pull request as ready for review
October 21, 2026 13:30
There was a problem hiding this comment.
🔵 Needs a closer look
Scanner suppressions and delegated workflow permissions warrant final maintainer validation.
No open issues 🎉
What changed in this PR
Adds AMD’s security-scanning baseline to the ROCm fork, building on the governance changes in #392 without changing runtime or kernel code.
Changes:
- Adds PR and weekly security scans with repository-specific scanner configurations.
- Hardens workflows with SHA pins and limited permissions; adds Dependabot and validation hooks.
- Adds a workflow-set guard to prevent upstream automation returning during syncs.
| File | Description |
|---|---|
| tests/rocm/test_repo_workflows.py | Enforces the fork-owned workflow set. |
| tests/rocm/test_redistribution_licences.py | Updates comments about upstream workflows. |
| SECURITY.md | Defines private vulnerability reporting and scope. |
| README.md | Adds contributing and security sections. |
| CONTRIBUTING.md | Documents governance, reporting, and fork-owned sync rules. |
| .pre-commit-config.yaml | Adds YAML, JSON, and Actions validation. |
| .github/workflows/weekly-security-scan.yml | Adds scheduled scans and SARIF uploads. |
| .github/workflows/update-codeowners.yml | Removes upstream ownership automation. |
| .github/workflows/release.yml | Removes upstream release automation. |
| .github/workflows/release-ci-docker.yml | Removes upstream CUDA image publishing. |
| .github/workflows/pre-commit.yml | Pins actions and hardens permissions and triggers. |
| .github/workflows/pr-test.yml | Removes upstream NVIDIA test automation. |
| .github/workflows/pr-security-scan.yml | Adds PR security scans and reports. |
| .github/workflows/pr-api-doc-comment.yml | Removes upstream documentation reporting. |
| .github/workflows/pr-api-doc-checks.yml | Removes upstream documentation checks. |
| .github/workflows/nightly-release.yml | Removes upstream nightly publishing. |
| .github/workflows/new-issue.yml | Removes upstream issue triage automation. |
| .github/workflows/build-doc.yml | Removes upstream documentation deployment. |
| .github/workflows/arch-caps-conformance.yml | Hardens actions and runs the workflow-set guard. |
| .github/scan_tools_configs/zizmor.yml | Adds workflow-security scanner configuration. |
| .github/scan_tools_configs/trivy.yml | Excludes unused upstream CUDA Dockerfiles. |
| .github/scan_tools_configs/gitleaks.toml | Tunes secret-scanning allowlists. |
| .github/scan_tools_configs/bandit.yml | Configures exclusions and test-assert handling. |
| .github/ISSUE_TEMPLATE/feature_request.yml | Requests ROCm environment details. |
| .github/ISSUE_TEMPLATE/bug_report.yml | Replaces CUDA diagnostics with ROCm details. |
| .github/dependabot.yml | Adds grouped Actions dependency updates. |
| .github/CODEOWNERS | Routes ownership to the fork maintainer. |
| .claude/skills/code-coverage/SKILL.md | Updates documentation about CPU-only CI. |
Review effort: Balanced
Adopts the security half of AMD's standard repository baseline: PR and weekly scans
through ROCm/rocm-security-gh's security-baseline workflow (bandit,
gitleaks, trivy, zizmor, CodeQL) at v1.0.6, its per-tool configs, and
dependabot for GitHub Actions.
The baseline files are relicensed to Apache-2.0 (AMD holds their
copyright), so everything this commit adds matches the fork's licence.
Configs are the baseline's, tuned against the pinned scanner versions
(bandit 1.9.4, gitleaks 8.30.1, trivy 0.70.0, zizmor 1.30.0). Adding
them widens bandit/trivy/zizmor to the whole tree on this PR, and HIGH
fails the job:
scanner base tree tuned
zizmor 78 HIGH in 11 workflows 0 findings
bandit 4 HIGH, 9,883 total 0 HIGH, 1,697 total
trivy 5 HIGH 0 HIGH
gitleaks 2,013 (all refs incl. 0
upstream/main)
- zizmor: no tuning. The previous commit deleted nine upstream
workflows; this one SHA-pins pre-commit.yml and
arch-caps-conformance.yml and drops their persisted credentials.
- bandit: skip B101 under tests only (~8,300 pytest asserts would bury
the weekly code-scanning upload; the 1,223 library asserts stay) and exclude four upstream files whose HIGH
findings are false positives and which take no `# nosec` here. The
baseline's exclude_dirs are rewritten as */dir/* globs: bandit also
matches each entry as a bare substring, so `build` silently dropped
build_backend_rocm.py and 16 other files (1,537 -> 1,554 scanned).
- trivy: skip upstream's four CUDA Dockerfiles; Dockerfile.rocm stays
scanned. A/B with the untuned config: 5 HIGH -> 0.
- gitleaks: every hit is generic-api-key on a kernel name next to
"token"/"key" (float8_e4m3fn, cutlass_nvfp4, *_sha256 digests,
kwargs). Allowlists are scoped to that rule: two exact value classes
(dtype names, kwargs), a sha256-field line rule, and kernel-vocabulary
stopwords. A segment-shape regex was tried first and rejected -- it
passed 37-61% of random prod_<12>_<12> keys. No stopword is all hex
(bf16 was dropped for that), and they suppress ~0.01% of random
32-char keys, and a fake-secret probe file is flagged
identically (6/6) by the tuned and default configs. Upstream's range
is covered so the next sync and the weekly full-history scan stay
green.
tests/rocm/test_repo_workflows.py pins the workflow set: an upstream
sync merges a newly added upstream workflow without a conflict, and
upstream/main already carries seven (claude-code-review, issue-claim,
pull_request_target labelers, ...). A/B: passes on this tree, fails with
claude-code-review.yml added or pre-commit.yml removed. Runs in the
arch-caps conformance lane.
pre-commit.yml keeps job id `pre-commit`, the ruleset's required check
context; the baseline's `name: Run hooks` would orphan it. Its push
trigger moves from main (the deprecated stub) to amd-integration.
Adds the baseline's check-yaml, check-json and actionlint hooks as a
separate entry, SHA-pinned, so upstream's pre-commit-hooks block still
merges. actionlint runs without the baseline's -shellcheck= and
unknown-label suppressions: the workflows pass with shellcheck, and a
probe file fails it. pre-commit cancels superseded runs on PRs only, so
every commit on amd-integration keeps its own result.
Co-Authored-By: Claude <noreply@anthropic.com>
demandal25
force-pushed
the
security-scan-baseline
branch
from
October 21, 2026 19:23
e61ff63 to
1b27a2e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopts the security half of AMD's standard repository baseline: PR and weekly scans through
ROCm/rocm-security-gh's security-baseline workflow (bandit, gitleaks, trivy, zizmor, CodeQL), per-tool configs tuned for this fork, Dependabot for Actions, SHA-pinned workflows, and the baseline's YAML/JSON/actionlint hooks. The baseline files are relicensed to Apache-2.0 (AMD holds their copyright), matching the fork.What changed
.github/workflows/pr-security-scan.yml,weekly-security-scan.yml— baseline verbatim, pinned torocm-security-ghv1.0.6..github/scan_tools_configs/*— baseline configs plus the tuning below..github/dependabot.yml— baseline verbatim (github-actions)..github/workflows/pre-commit.yml,arch-caps-conformance.yml— SHA pins,persist-credentials: false,contents: read. pre-commit's push trigger moves frommain(the deprecated stub) toamd-integration, and its job id stayspre-commit, the ruleset's required check context..pre-commit-config.yaml—check-yaml,check-json,actionlintas a separate SHA-pinned entry, so upstream'spre-commit-hooksblock still merges. actionlint runs with shellcheck; the baseline disables it.tests/rocm/test_repo_workflows.py— pins the workflow set. A sync merges a newly added upstream workflow without a conflict;upstream/mainalready carries seven, includingpull_request_targetones.Architecture / design notes
Adding the configs widens bandit, trivy and zizmor to the whole tree on this PR, and a HIGH finding fails it. Measured at the pinned scanner versions:
Dockerfile.rocmstays scannedupstream/main)*_sha256line rule, kernel-vocabulary stopwords — all scoped togeneric-api-keyTwo baseline defects fixed along the way: bandit matches
exclude_dirsentries as bare substrings, so the baseline'sbuildsilently droppedbuild_backend_rocm.pyand 16 other files; and the baseline's digest allowlist suppressed every gitleaks rule on a matching line.The gitleaks tuning is words, not shapes: a segment-shape regex was tried first and passed 37–61% of random
prod_<12>_<12>keys. The stopwords suppress ~0.01% of random 32-char keys, and a fake-secret probe file is flagged 6/6 by both the tuned and the default config.Test plan
pre-commit run -a(incl. actionlint with shellcheck; a probe workflow fails it)test_repo_workflows.pyA/B: passes on this tree, fails withclaude-code-review.ymladded orpre-commit.ymlremoved (run directly; host has no pytest — CI runs it in the conformance lane)Security scan / Security scanners,pre-commit,conformancegreen; the findings bot reports no critical/high findings.cufiles are classified as Cuda and never analysed; only.h/.cppreach the c-cpp leg