Fix cache poisoning vulnerability in GitHub Actions#679
Merged
Conversation
Zizmor raised an error because of [cache poisoning](https://docs.zizmor.sh/audits/#cache-poisoning), which is where an atacker can hide a malicious payload to cached data and gain access to other workflows when the cache is restored. This could be used to corrupt a release artifact when the release workflow uses caching. We did this in our docs workflow. We also uploaded artifacts of the docs and PyPI distributions and then restored them. Seems like this should also be vulnerable to similar atacks. To avoid all of this, redo the way we deploy in Actions. Add a separate `publish` workflow that only runs on pushes to `main` and releases. It builds the docs and wheels, then publishes them to GitHub pages and PyPI/TestPyPI all in the same job without using caching or artifacts. The `docs` workflow only builds the docs and doesn't deploy them anymore. The `pypi` workflow was removed, with the check of the built packages living in the `test` workflow now.
Member
Author
|
Updated the PyPI and TestPyPI publishing config to match. |
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.
Zizmor raised an error because of cache poisoning, which is where an atacker can hide a malicious payload to cached data and gain access to other workflows when the cache is restored. This could be used to corrupt a release artifact when the release workflow uses caching. We did this in our docs workflow. We also uploaded artifacts of the docs and PyPI distributions and then restored them. Seems like this should also be vulnerable to similar atacks. To avoid all of this, redo the way we deploy in Actions. Add a separate
publishworkflow that only runs on pushes tomainand releases. It builds the docs and wheels, then publishes them to GitHub pages and PyPI/TestPyPI all in the same job without using caching or artifacts. Thedocsworkflow only builds the docs and doesn't deploy them anymore. Thepypiworkflow was removed, with the check of the built packages living in thetestworkflow now.Relevant issues/PRs: Related to fatiando/bordado#115