ci: add security scanners to Quartz - #90
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
HereThereBeDragons
left a comment
There was a problem hiding this comment.
can you add a little bit more details to the pr description? how often the scanner run and on what files etc. or somewhere else? could also become a new readme. maybe also how to update them or if they are automatically updated by dependabot.
other than the the real fix needed is the rename of release-nightly/ -> nightly and prerealeases/ -> prerelease/
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
concurrency block?
| # anything it doesn't list. See the PR-time counterpart | ||
| # (security_scan_pr.yml) for the human-readable, non-elevated variant. | ||
|
|
||
| name: Weekly security scan |
There was a problem hiding this comment.
one comment but i guess this is what we want.
claude:
2. No per-merge SARIF refresh (Major tradeoff — worth a question)
This is the real behavioral regression. #36 ran bandit/zizmor/codeql/gitleaks on push: [main, develop], so the Security tab refreshed on every merge. #90 only has PR-time (report_formats: human, no SARIF) + weekly (scan_mode: all, SARIF). Net effect: code-scanning results on main update only once a week. A vuln fixed and merged Monday still shows "open" on the Security tab until Saturday's run; a newly-introduced issue isn't recorded until then either. Is weekly-only intentional, or do you want a push-to-main SARIF job (or moving the scheduled one to also trigger on push to main) to keep the Security tab current?
Minor/low-priority: #36's CodeQL skipped draft PRs (pull_request.draft == false) and path-filtered to /*.py + .github/; #90 relies on scan_mode: changed instead, which is a reasonable substitute — not worth raising unless draft-PR scan noise bothers the team.
There was a problem hiding this comment.
Keeping it repo agnostic. Monorepos can't run post merge the scanners, so we went for weekly
Co-authored-by: Laura Promberger <laura.promberger@amd.com>
…artz into users/cgoea/sec_scanners
- Strip trailing whitespace in bandit.yml (pre-commit failure). - Merging develop pulled in #100's stricter workflow-partition test; register the new security_scan_pr.yml / security_scan_weekly.yml workflows in _EXCLUDED_WORKFLOWS since they are Quartz-local CI plumbing, not TheRock/rockrel producer workflows that report to notify_quartz.
8a0990e to
2d02a29
Compare
HereThereBeDragons
left a comment
There was a problem hiding this comment.
please fix naming problem and clarify more way the description talks about code ql but i dont see it here anywhere in the code
otherwise lgtm
| # online are picked up here without touching this file. | ||
|
|
||
| name: Security scan (PR) | ||
| name: PR security scan |
There was a problem hiding this comment.
please keep the naming uniform between pr and and weekly? now the naming just got reversed
Security scan (PR) -> PR security scan
Weekly security scan -> Security scan (Weekly)
|
|
||
| ```bash | ||
| # Secrets, over the full git history (installed separately, see gitleaks docs). | ||
| gitleaks detect --source . --config gitleaks.toml --redact --verbose --no-banner |
There was a problem hiding this comment.
maybe switch this in the order with the preferred scanner? maybe put "recommended" or something in the front of the comment
| > in particular reports pre-existing findings that the pull request check does | ||
| > not. | ||
|
|
||
| CodeQL is not in the list above: it runs in CI only, against the org-wide |
There was a problem hiding this comment.
we dont have any codeql yet?
There was a problem hiding this comment.
we don't. it will come with the scanners.
Motivation
Add security scanners to Quartz:
Add a config file for each scanner (
bandit.yml,gitleaks.toml,trivy.yml,zizmor.ymlat the repo root; CodeQL uses the org-wide default, no local override) so Quartz's exclusions (.venv,release-nightly,prerelease,nightly, etc.) replace the scanner's org-wide defaults instead of stacking on top of them.JIRA ID: ROCM-28051
Technical Details
Adds two workflows that both call
ROCm/rocm-security-gh/.github/workflows/security-baseline.yml, pinned to a fixed commit (not a mutable tag), and differ only in when they run and how they report:security_scan_pr.yml— runs on every pull request, scoped to what that PR changed (scan_mode: changed, the reusable workflow's default). Reports as a job summary + build artifact (report_formats: human).security_scan_weekly.yml— runs on a schedule (Saturdays, 10:00 UTC) plusworkflow_dispatch, scoped to the whole repo (scan_mode: all), and uploads SARIF (report_formats: sarif) to the repository's Security tab.Also included:
create-github-app-tokencalls innotify_quartz/action.yml,receive_therock_data.yml, andsync_develop_to_main.ymlto the specific permissions they actually use (permission-actions: write/permission-contents: write), fixing zizmor's "dangerous use of GitHub App tokens" high findings instead of inheriting the app's full installation permissions.therock_workflow_registry_test.py's_EXCLUDED_WORKFLOWSset — they're Quartz's own CI plumbing.SECURITY.md(what each one looks for, how the PR vs. weekly workflows differ, "a finding is not a vulnerability report") and inCONTRIBUTING.md(copy-paste commands to run every scanner locally against the same config CI uses).Submission Checklist