Skip to content

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

Merged
antonwolfy merged 9 commits into
masterfrom
ci/add-zizmor-security-scan
Sep 2, 2026
Merged

ci: add zizmor security scanning for GitHub Actions workflows#3053
antonwolfy merged 9 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/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
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev7=py314ha0e2e8e_20 ran successfully.
Passed: 1375
Failed: 0
Skipped: 7

@coveralls

coveralls commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 78.487% (-0.002%) from 78.489% — ci/add-zizmor-security-scan into master

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you @antonwolfy for adding this helpful workflow
Are you planning to do this for dpctl as well?

@antonwolfy

Copy link
Copy Markdown
Contributor Author

LGTM Thank you @antonwolfy for adding this helpful workflow Are you planning to do this for dpctl as well?

Yes, I'm planning to backport to all repos

antonwolfy and others added 2 commits September 2, 2026 12:49
The caller conda-package-cf.yml grants only 'contents: read', but this
reusable workflow declared 'permissions: read-all'. GitHub rejects a
called workflow that requests more scopes than the caller grants, which
made conda-package-cf.yml an invalid workflow file. The jobs here only
checkout, build and up/download artifacts, so contents: read suffices.
@antonwolfy
antonwolfy merged commit 1bfd8e6 into master Sep 2, 2026
121 of 130 checks passed
@antonwolfy
antonwolfy deleted the ci/add-zizmor-security-scan branch September 2, 2026 17:13
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
Adds a CI job that runs the [zizmor](https://docs.zizmor.sh) 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. 1bfd8e6
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.

3 participants