Skip to content

Security linting of GHA workflows#2560

Merged
VeckoTheGecko merged 5 commits intoParcels-code:mainfrom
VeckoTheGecko:zizmor
Apr 2, 2026
Merged

Security linting of GHA workflows#2560
VeckoTheGecko merged 5 commits intoParcels-code:mainfrom
VeckoTheGecko:zizmor

Conversation

@VeckoTheGecko
Copy link
Copy Markdown
Contributor

@VeckoTheGecko VeckoTheGecko commented Mar 31, 2026

This PR introduces Zizmor as a precommit hook.

zizmor is a static analysis tool for GitHub Actions. It can find and fix many common security issues in typical GitHub Actions CI/CD setups.

Given the recent waves of AI powered supply chain attacks, I think its important that we have this.

  • Closes None

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
    • Describe how you used it (e.g., by pasting your prompt):
      • Mainly just in a loop asking claude to work through based on the output of zizmor . . I have checked everything (including that all the hashes match the versions - by running uv run https://gist.github.com/VeckoTheGecko/734b10cc78742b354c01055660ddf625 .

VeckoTheGecko and others added 4 commits March 31, 2026 16:12
- Pin all action references to commit SHAs
- Add persist-credentials: false to all checkout steps
- Add explicit permissions blocks (workflow-level and per-job)
- Add environment for test-pypi job to scope secret access
- Add Dependabot cooldown configuration
- Suppress secrets-outside-env for CODECOV_TOKEN and PREFIX_API_KEY
- Suppress use-trusted-publishing info finding

Co-authored-by: Claude <noreply@anthropic.com>
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The main reason we need this is because tags in git are mutable. Someone can push the v5 tag to a commit with malicious code, hence getting arbitrary code execution. Setting these to SHAs prevents this. Dependabot autoupdates these, so we don't really need to worry about it (just when adding new actions, we use the SHA instead of the version)

This also stems from the fact GitHub Actions is bad

schedule:
interval: "monthly"
cooldown:
default-days: 7
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This means that dependabot updates won't consider packages that have been released in the last 7 days

https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will also have this for Pixi when prefix-dev/pixi#5786 gets merged and released

Copy link
Copy Markdown
Member

@erikvansebille erikvansebille left a comment

Choose a reason for hiding this comment

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

Looks good; thanks for implementing this extra layer of security. The blog on why Github Actions is bad was an eye-opener...

@VeckoTheGecko VeckoTheGecko merged commit 285acf8 into Parcels-code:main Apr 2, 2026
1 of 2 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in Parcels development Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants