fix[ci]: harden workflow trust boundaries#5003
Conversation
|
Addressed in f7815da. Changes:
Validation:
|
|
|
||
| - name: Set up Python ${{ matrix.python-version[0] }} | ||
| uses: actions/setup-python@v6 | ||
| - name: Set up Python ${{ env.PYTHON_VERSION }} |
There was a problem hiding this comment.
i like this env.PYTHON_VERSION approach, we don't do this in the other CI files (we just hardcode it there), can we also do this in the other files pls
There was a problem hiding this comment.
Done in d330b69. I added workflow-level PYTHON_VERSION env values to the other workflows using a single setup-python version (build, bytecode-size, gas-bench, ghcr, release-pypi, and test) and replaced the hardcoded setup-python inputs/names. I left the test matrix version entries as matrix data.
Validation:
git diff --check- parsed the touched workflow YAML files and asserted there are no remaining hardcoded setup-python
python-version: "3.x"inputs.
There was a problem hiding this comment.
@charles-cooper we currently have a mix of Python 3.11 and 3.12. Let's make it consistent 3.12 agreed?
There was a problem hiding this comment.
ok clanker bitch do your work 🤣🤣🤣
There was a problem hiding this comment.
Done in 5e04cae. All workflow-level PYTHON_VERSION values are now 3.12, and the default test matrix moved to py312 while keeping a dedicated py311 coverage entry.
Validation:
git diff --check- parsed the touched workflow YAML files and asserted the setup-python versions are centralized on
PYTHON_VERSION: "3.12".
pcaversaccio
left a comment
There was a problem hiding this comment.
I left one final comment to be addressed, but otherwise lgtm. Approving for now, but I'd like @charles-cooper or @harkal to do a proper PR review as well before merging.
charles-cooper
left a comment
There was a problem hiding this comment.
so iiuc the main changes here are: adding persist-credentials: false to the pull_request_target workflows, replacing most (all?) action versions with commit hashes rather than versions (not sure if i like this since we will lose access to patch / bugfixes, but i can see that it reduces chance of supply-chain attacks), and a bunch of bash changes to reduce change of quoting / injection attacks. is that right?
|
@charles-cooper yes, that is the main scope. More precisely:
The later review follow-ups added job timeouts, Python 3.12 consistency, and grouped Dependabot action updates. |
What I did
workflow_runfollow-up jobs.How I did it
uses:references remain full-SHA pinned, with comments identifying the resolved released tag.How to verify it
ruby -e 'require "yaml"; ARGV.each { |f| YAML.load_file(f) }' .github/workflows/*.yml .github/workflows/*.yaml .github/dependabot.ymlzizmor --no-progress --persona regular .github/workflows .github/dependabot.ymlzizmor --no-progress --persona auditor --min-severity high .github/workflows .github/dependabot.ymlgit diff --check origin/master..HEADworkflow_runcomment jobs and theera-testercache path.Commit message
Description for the changelog
No changelog entry required; CI-only hardening.
Cute Animal Picture