Skip to content

ci(security): harden CI/CD supply chain with SHA pinning and least-privilege permissions#650

Merged
theskumar merged 1 commit into
mainfrom
ci/harden-supply-chain
May 30, 2026
Merged

ci(security): harden CI/CD supply chain with SHA pinning and least-privilege permissions#650
theskumar merged 1 commit into
mainfrom
ci/harden-supply-chain

Conversation

@theskumar
Copy link
Copy Markdown
Owner

What changed

Action pinning

All GitHub Actions SHA-pinned to full 40-char commits with # vX.Y.Z comments, preventing tag-hijacking attacks:

Action Before After
actions/checkout @v6 @de0fac2... (v6)
actions/setup-python @v6 @a309ff8... (v6)
pypa/gh-action-pypi-publish @release/v1 @cef2210... (v1.14.0)
peaceiris/actions-gh-pages @v4 @4f9cc66... (v4)

Least-privilege permissions

  • test.yml: Added top-level permissions: { contents: read } (previously defaulted to broad read/write).
  • release.yml: Top-level permissions: { contents: read }; write permissions granted only at the publish job level where needed.

Dependabot

  • Added pip ecosystem tracking (weekly).
  • Added commit-message prefixes (ci/chore) and labels for easier triage.
  • Added open-pull-requests-limit to both ecosystems.

Why

Supply-chain attacks on GitHub Actions (e.g., codecov, tj-actions) exploit mutable tags and overly broad tokens. SHA pinning + least privilege are the standard mitigations recommended by GitHub and OpenSSF.

…ivilege permissions

- Pin all GitHub Actions to full SHA with version comments
- Add top-level permissions: contents: read to test.yml
- Add top-level permissions: contents: read to release.yml (write only at job level)
- Upgrade pypa/gh-action-pypi-publish from release/v1 tag to v1.14.0 SHA
- Add pip ecosystem tracking to dependabot
- Add commit-message prefixes and labels to dependabot config
@theskumar theskumar force-pushed the ci/harden-supply-chain branch from 7ee5423 to b2b3275 Compare May 30, 2026 06:44
@theskumar theskumar merged commit 078325e into main May 30, 2026
9 checks passed
@theskumar theskumar deleted the ci/harden-supply-chain branch May 30, 2026 06:45
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.

1 participant