Skip to content

Superseded by #393 - #391

Closed
demandal25 wants to merge 2 commits into
amd-integrationfrom
rocm-repo-template-security-ci
Closed

demandal25 wants to merge 2 commits into
amd-integrationfrom
rocm-repo-template-security-ci

Conversation

@demandal25

@demandal25 demandal25 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Superseded by #393.

demandal25 and others added 2 commits October 20, 2026 15:07
Brings the governance half of ROCm/rocm-repo-template to this fork:

- SECURITY.md: the template's AMD PSIRT policy, covering inherited
  FlashInfer and AITER code too -- neither upstream has private
  vulnerability reporting enabled or a SECURITY.md.
- CODEOWNERS: replaces upstream's list. Every owner in it lacked access
  to this fork (305 "Unknown owner" errors from the codeowners/errors
  API), so it routed no reviews at all.
- README: Contributing, Security and Maintainers sections.
- CONTRIBUTING: security callout, developer policies (governance linked
  at TheRock; the template's ROCm/ROCm link lands on an archived stub),
  issue-report contents, and restoring .github/ wholesale on sync
  (git rm -r .github && git checkout HEAD -- .github, tested against
  UU, DU and added entries).
- Issue templates: both asked for upstream's CUDA-only collect_env
  (bug_report curled it from flashinfer-ai main); they now ask for the
  GPU, ROCm (/opt/rocm/.info/version -- torch.version.hip is HIP), OS,
  torch and AITER versions, matching CONTRIBUTING.
- .gitignore: the template entries not already covered, with out/
  anchored to the root; none matches a tracked file (git ls-files -ci is
  unchanged).

Deletes nine upstream workflows. Six were disabled_manually since
2026-03-10. The other three (pr-test, pr-api-doc-checks,
pr-api-doc-comment) only trigger for main, the deprecated stub branch,
and carry 15 zizmor HIGH findings, which would fail the full-tree scan
the follow-up security-scan PR runs. Of the three, only
pr-api-doc-comment is read from the default branch (workflow_run), so
its removal is what closes the PR-to-main chain into a job holding
pull-requests: write; PRs against main still read main's own files.

scripts/upstream_canary.py against upstream/main goes 113 -> 117
conflicts: CODEOWNERS, plus modify/delete on build-doc, release-ci-docker
and pr-api-doc-checks. release, nightly-release and pr-test already
conflicted and stay counted once. Every deletion resolves with git rm.

Licensing: the fork stays Apache-2.0 with upstream's LICENSE and NOTICE
untouched. Each upstream file edited here gains a one-line change notice
(Apache-2.0 sec. 4(b)); README and CONTRIBUTING already open by naming
this an AMD port. Text taken from the MIT template ships its licence as
licenses/LICENSE.rocm-repo-template.txt, which names the files it
governs; NOTICE's "see licenses/" already points there. The deleted workflows carried no copyright notices.

The template's MIT LICENSE, black, mdformat and *_test.py naming hook
are deliberately not adopted: this is an Apache-2.0 derivative, and the
rest conflict with ruff-format, markdownlint and upstream's test layout.

Co-Authored-By: Claude <noreply@anthropic.com>
Adopts the security half of ROCm/rocm-repo-template: 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.

Configs are the template'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
  template'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 template's `name: Run hooks` would orphan it. Its push
trigger moves from main (the deprecated stub) to amd-integration.

Adds the template'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 template'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>
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View 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
demandal25 force-pushed the rocm-repo-template-security-ci branch 2 times, most recently from de98549 to 8f1d92e Compare October 20, 2026 19:34
@demandal25 demandal25 changed the title Add ROCm repo-template security scanning Superseded by #393 Oct 20, 2026
@demandal25 demandal25 closed this Oct 20, 2026
@demandal25
demandal25 deleted the rocm-repo-template-security-ci branch October 20, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant