Skip to content

ci: add zizmor security scanning for GitHub Actions workflows - #3053

Open
antonwolfy wants to merge 7 commits into
masterfrom
ci/add-zizmor-security-scan
Open

ci: add zizmor security scanning for GitHub Actions workflows#3053
antonwolfy wants to merge 7 commits into
masterfrom
ci/add-zizmor-security-scan

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Adds a CI job that runs the zizmor static analyzer over the workflow files under .github/.

zizmor audits GitHub Actions workflows for supply-chain and privilege-escalation weaknesses — unpinned action references, credential persistence through the checkout token, template injection via ${{ ... }} expansion in run: blocks, and overly broad GITHUB_TOKEN permissions.

This is a CI/configuration-only change; no library code, tests, or documentation are affected.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@antonwolfy antonwolfy self-assigned this Sep 1, 2026
@antonwolfy antonwolfy added this to the 0.21.0 release milestone Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/3053/index.html

Add a CI job that runs the zizmor static analyzer over the workflow
files under .github/ to catch supply-chain and privilege-escalation
weaknesses (unpinned actions, credential persistence, template
injection, overly broad permissions).

The job runs on pull requests and pushes to master with least-privilege
permissions and reports findings as inline annotations.
Replace top-level 'permissions: read-all' with the minimal
'contents: read' in check-onemath, conda-package and conda-package-cf;
jobs needing more (actions: write to cancel prior runs, pull-requests:
write to comment) already declare their own job-level permissions.
Correct the version comments so they match the pinned commit SHAs
(addresses zizmor's mismatched/missing version comment finding);
the SHAs themselves are unchanged and already correct:

- mshick/add-pr-comment: garbled 'v3.12.0.8.3.12.0' -> 'v3.12.0'
  in build-sphinx and conda-package.
- oprypin/find-latest-tag: '1.1.3' -> 'v1.1.3' in cron-run-tests
  so the ref resolves.
Set 'cooldown: default-days: 7' on the github-actions, pip, conda and
pre-commit update entries so Dependabot waits a week after a release
before opening an update PR (Dependabot's implicit default is 3 days).
Addresses zizmor's dependabot-cooldown finding and reduces exposure to
freshly published malicious or broken versions.
Add 'persist-credentials: false' to the actions/checkout steps so the
GITHUB_TOKEN is not persisted in .git/config for later steps
(addresses zizmor's artipacked finding). The only credential-pushing
steps use explicit tokens (a tokened remote in build-sphinx, the
peter-evans/create-pull-request token input in bump-sycl-deps) rather
than the persisted checkout credential, so they are unaffected.
Move the inputs.channels-list, inputs.recipe-dir and env.python-conda-spec
expansions in the conda-build/rebuild steps into step-level env vars and
reference them as shell variables (addresses zizmor's high-severity
template-injection findings). CHANNELS_LIST stays unquoted so it splits
into separate -c CHANNEL args, with a scoped shellcheck disable; RECIPE_DIR
is quoted.
Set min-severity: medium on the zizmor action so the job fails only on
medium and high findings. The remaining low/informational template-injection
notes come from internally-defined env/matrix values (no external input),
so they are still surfaced as annotations but do not block CI.
@antonwolfy
antonwolfy force-pushed the ci/add-zizmor-security-scan branch from 7cbbde2 to ba9d668 Compare September 1, 2026 11:00
@antonwolfy
antonwolfy marked this pull request as ready for review September 1, 2026 11:02
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