Skip to content

ci: harden workflows and add security policy - #825

Merged
ewhauser merged 2 commits into
mainfrom
ci/harden-workflows
Apr 10, 2026
Merged

ewhauser merged 2 commits into
mainfrom
ci/harden-workflows

Conversation

@ewhauser

@ewhauser ewhauser commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Summary

Applies open-source security best practices from Astral's recommendations:

  • Pin cachix/install-nix-action to SHA — was the only action using a mutable tag instead of a commit digest
  • Replace pull_request_target with push trigger in release.yml — eliminates a dangerous trigger class; the resolve job now uses the GitHub API (commits/{sha}/pulls) to look up the merged PR and validates the same 4 gates (repo match, release/v* branch, release label, github-actions[bot] author)
  • Scope permissions per-job — sets permissions: {} at workflow level in release.yml, compat.yml, fuzz-full.yml, publish-custom-gcl.yml, and prepare-release.yml; each job declares only what it needs
  • Disable caching during releases — prevents cache poisoning from compromising shipped artifacts (cache: false on setup-go, removed pnpm cache)
  • Add 3-day dependency update cooldown — minimumReleaseAge in Renovate config avoids adopting freshly-published compromised packages
  • Add SECURITY.md — vulnerability disclosure policy pointing to GitHub private advisory reporting

Test plan

  • Verify CI passes on this PR (the push trigger change to release.yml won't fire since this targets main and the resolve job exits early for non-release commits)
  • Confirm actionlint reports no new issues (pre-existing shellcheck style warnings only)
  • After merge, verify the next make release cycle still triggers the publish workflow correctly via the push-to-main path

Apply open-source security best practices from Astral's recommendations:

- Pin cachix/install-nix-action to commit SHA (was the only unpinned action)
- Replace pull_request_target with push trigger in release.yml to eliminate
  a dangerous trigger class; the resolve job now uses the GitHub API to look
  up the merged PR and validates the same gates (repo, branch, label, author)
- Set permissions: {} at workflow level and grant per-job in release.yml,
  compat.yml, fuzz-full.yml, publish-custom-gcl.yml, prepare-release.yml
- Disable Go and pnpm caching during releases to prevent cache poisoning
- Add minimumReleaseAge of 3 days to Renovate config
- Add SECURITY.md with vulnerability disclosure policy

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bf5199266

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Add pull-requests: read permission to the resolve job so the
commits-to-PR lookup has the required token scope. Remove || true
so API failures surface as errors instead of silently skipping
the release.
@ewhauser
ewhauser enabled auto-merge (squash) April 10, 2026 02:35
@ewhauser
ewhauser merged commit 3d211b6 into main Apr 10, 2026
16 checks passed
@ewhauser
ewhauser deleted the ci/harden-workflows branch April 10, 2026 02:38
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