Repository navigation
ci: fix zizmor/CodeQL/Trivy/Bandit findings in workflows, Dockerfiles and examples - #556
Merged
Merged
Conversation
- Add workflow-level `permissions: contents: read` to the build and
linting workflows that had none.
- Set `persist-credentials: false` on all checkouts; promotion.yml keeps
credentials explicitly since it pushes.
- Move `${{ }}` expressions out of run scripts into step `env:` to avoid
template injection.
- Drop `secrets: inherit` from the reusable-workflow callers; the
reusable workflow uses no secrets.
- Add a 7-day Dependabot cooldown for github-actions updates.
Co-Authored-By: Claude <noreply@anthropic.com>
Trivy DS-0013 flags `RUN cd ...` in the FFmpeg (AlmaLinux 8, SLES 15.7) and elfutils (SLES 15.7) source builds. Switch to WORKDIR with `tar --strip-components=1` and reset WORKDIR afterwards. Co-Authored-By: Claude <noreply@anthropic.com>
Bandit B101 (assert_used) flags 50 asserts in code adapted from upstream (CK tile fmha codegen, llama3.c); skip only that check for those directories so they don't diverge from their sources. In the YOLO26 example, replace the GPU-residency assert with an explicit raise so the check survives `python -O`. Co-Authored-By: Claude <noreply@anthropic.com>
zichguan-amd
marked this pull request as ready for review
October 26, 2026 16:05
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.
Motivation
Fix the code-scanning alerts reported by the weekly security scan (CodeQL, zizmor, Trivy and Bandit) in the CI workflows, Dockerfiles and Python examples.
Technical Details
permissions: contents: readon 17 build workflows +linting.yml(CodeQLactions/missing-workflow-permissions, zizmorexcessive-permissions).persist-credentials: falseon all checkouts;promotion.ymlexplicitly setstruefor itsgit push(zizmorartipacked).run:moved to stepenv:in the VS/portable-solution workflows,build_docker.yml,build_libraries.yml,build-rocm-examples-reusable.ymlandquartz_test.yml(zizmortemplate-injection).secrets: inheritfromci_nightly.yml,ci_therock.ymlandquartz_test.yml.build-rocm-examples-reusable.ymlhas never referenced a secret, and the called workflow still gets its ownGITHUB_TOKEN(zizmorsecrets-inherit).cooldown: default-days: 7(zizmordependabot-cooldown).self-repository(3). The$/syntax it asks for is rejected by actionlint v1.7.12 (Support the new$/self-repositoryuses:syntax rhysd/actionlint#711, Support "$/" inuses:(reusable workflow and action at the running workflow's own repository and commit) rhysd/actionlint#760).actions/unpinned-tag,rocm-docs-core@develop) was dismissed as intentional.RUN cdwithWORKDIRin the FFmpeg (AlmaLinux 8, SLES 15.7) and elfutils (SLES 15.7) source builds (Trivy DS-0013).bandit.yml: skip only B101 (assert_used) for code adapted from upstream (Libraries/ComposableKernel/attention/fmha, from ROCm/composable_kernelexample/ck_tile/01_fmha;Libraries/hipThreads/llama3c, from jameswdelancey/llama3.c), so it doesn't diverge from its sources. All other Bandit checks still run there.AI/MIGraphX/gpu_resident_yolo26_pipeline/main.py: GPU-residencyassertreplaced with an explicitraise RuntimeError, so the check survivespython -O(Bandit B101).Test Plan
pre-commit runon the changed files (actionlint).Dockerfiles/.bandit.yml, run the same way as the security baseline.Test Result
self-repositoryremains).libavcodec.so.58is in the ldconfig cache,/tmpis empty, and the working directory is still/workspace.export.pyB614/B615,Scripts/VisualStudio/check_vs_files.pyB405/B314).main.pycompiles; the YOLO26 example itself was not run.Added/Updated documentation?
Included Visual Studio files?
Submission Checklist
🤖 Generated with Claude Code