Hardening: release workflow supply-chain and robustness #18
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type: hardening. Found by security audit run 3 (commit
01195c8) in.forgejo/workflows/release.ymland.forgejo/workflows/ci.yml. No lower-trust principal of this project can currently influence a release (only tag pushers trigger it), so these are not vulnerabilities.release.yml:16-18downloadswp-cli.pharfromraw.githubusercontent.com/wp-cli/builds/gh-pageswith no version pin or checksum, then runs it to build the published zip. Pin a versioned release URL (github.com/wp-cli/wp-cli/releases/download/vX.Y.Z/wp-cli-X.Y.Z.phar) and verify a SHA-512 committed in the workflow (sha512sum -c), or build withgit archive+.gitattributes export-ignoreso no third-party executable is in the release path.actions/checkout@v4andshivammathur/setup-php@v2(release.yml:13,ci.yml:13-14,34-35) are pinned to tags. Pin to full commit SHAs (keeping the full-URL form Forgejo needs) and setpersist-credentials: falseon the release checkout so later steps cannot read the job token from.git/config.v*tag on any commit is built and published. Consider Forgejo protected tags forv*, and a step that checks the tagged commit is onmain(git merge-base --is-ancestor) and that${TAG#v}matches the plugin headerVersion,MULTI_DOMAIN_REDUX_VERSIONandreadme.txtStable tag.release.yml:31-41interpolatesTAGinto a JSON body and API path in the shell. Build the JSON with an encoder (e.g.python3 -c 'import json,os;print(json.dumps({"tag_name":os.environ["TAG"],"name":os.environ["TAG"][1:]}))') and URL-encodeTAG.wp dist-archive .may write the zip to the parent directory by default, soZIP=$(ls multi-domain-redux.*.zip)(release.yml:28) could find nothing. Pass an explicit target (wp dist-archive . ./) and addset -euo pipefail.composer.lockis gitignored, so CI resolves dev dependencies fresh each run. Committing it makes CI inputs reviewable (no effect on the shipped zip, which excludesvendor/).ci.ymlruns contributor code onpull_request. If outside forks can open PRs, require maintainer approval for fork workflow runs and make sure job containers cannot reach the DinD daemon the release job also uses.Resolved in
4bbe64d.191e78a). No third-party binary builds the zip, payloads go through json.dumps, and every step uses set -euo pipefail.Rationale recorded in CLAUDE.md.