Skip to content

security: Harden release workflow (repo guard + SHA256SUMS)#42

Merged
williajm merged 3 commits into
mainfrom
security/release-hardening
Apr 14, 2026
Merged

security: Harden release workflow (repo guard + SHA256SUMS)#42
williajm merged 3 commits into
mainfrom
security/release-hardening

Conversation

@williajm
Copy link
Copy Markdown
Owner

Summary

  • Restrict release.yml jobs to the upstream repo via if: github.repository == 'williajm/mcp_kafka'
  • Generate SHA256SUMS.txt during build, upload to the GitHub release for artifact verification
  • Add checksum section + verification snippet to the step summary

Context

Aligns this repo with the security baseline in williajm/mcp_docker. Sister PRs:

Also added a v* tag deployment policy to the pypi environment (done out-of-band via the GitHub API).

Test plan

  • CI passes
  • Next release uploads SHA256SUMS.txt alongside the existing artifacts
  • sha256sum --ignore-missing -c SHA256SUMS.txt verifies downloaded artifacts

🤖 Generated with Claude Code

Align with the security baseline used in williajm/mcp_docker:

- Add `if: github.repository == 'williajm/mcp_kafka'` guard to both
  build-and-sign and publish-pypi jobs so forks can't run the release
  workflow (belt-and-suspenders with the trusted-publisher binding
  and the pypi environment's branch/tag policy).
- Generate SHA256SUMS.txt during build, exclude it from the PyPI
  upload artifact, and upload it to the GitHub release so consumers
  can verify artifacts with `sha256sum -c SHA256SUMS.txt`.
- Add SHA256 section + verification snippet to the workflow step
  summary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes CVE-2026-39892 (cryptography buffer overflow in Hash.update on
non-contiguous Python buffers) and CVE-2025-71176 (pytest /tmp dir
permissions allow local DoS / privilege escalation).

cryptography is a transitive dep (via authlib / pyjwt / secretstorage),
upgraded explicitly via `uv lock --upgrade-package cryptography`.
Lockfile regenerated with `uv lock --exclude-newer` (3-day buffer).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@williajm
Copy link
Copy Markdown
Owner Author

Bundled dep bumps: cryptography 46.0.6 → 46.0.7 (CVE-2026-39892, transitive via authlib/pyjwt) and pytest 9.0.2 → 9.0.3 (CVE-2025-71176). These were failing pip-audit in CI — fix included here so the PR is mergeable.

The previous commit locked with `--exclude-newer` which baked an
[options] exclude-newer entry into uv.lock. CI does not set
UV_EXCLUDE_NEWER, so it re-resolved and `--locked` failed consistency
checks. Regenerate without the flag to match main's lockfile style;
hash-pinned lockfile still provides supply-chain integrity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@williajm williajm merged commit 9eeb6dc into main Apr 14, 2026
19 checks passed
@williajm williajm deleted the security/release-hardening branch April 14, 2026 20:17
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