Skip to content

security: SHA-pin release actions and tighten workflow permissions#19

Open
hinanohart wants to merge 1 commit into
mainfrom
security-fixes-2026-06-10
Open

security: SHA-pin release actions and tighten workflow permissions#19
hinanohart wants to merge 1 commit into
mainfrom
security-fixes-2026-06-10

Conversation

@hinanohart

Copy link
Copy Markdown
Owner

セキュリティ監査修正 (HIGH/MEDIUM)

自動セキュリティ監査で検出された HIGH/MEDIUM 所見に対する最小修正です。

security: pin release workflow actions to SHAs and tighten permissions

Fixes MEDIUM audit finding: the release workflow (contents:write +
id-token:write, PYPI_API_TOKEN exposed) ran several third-party actions
via mutable refs. A compromised upstream tag/branch could exfiltrate the
PyPI token or abuse write scopes.

Changes to .github/workflows/release.yml:

  • Pin all previously-mutable actions to full commit SHAs:
    • actions/upload-artifact @v7 -> 043fb46 # v7.0.1
    • actions/download-artifact @v8 -> 3e5f45b # v8.0.1
    • sigstore/cosign-installer @V3 -> 398d4b0 # v3.9.1
    • pypa/gh-action-pypi-publish @release/v1 -> cef2210 # release/v1 (v1.14.0)
    • softprops/action-gh-release @V3 -> b430933 # v3.0.0
  • Move permissions from workflow level to per-job least privilege:
    default contents:read; id-token:write only in the sign job;
    contents:write only in the github-release job.
  • Set persist-credentials: false on both actions/checkout steps.

Changes to .github/workflows/ci.yml:

注: 本PRは監査所見のみを対象とした最小変更です。リポジトリに既存のCI/lint/未pin action等の指摘が残る場合がありますが、本PRの範囲外です。

🤖 Generated with Claude Code

Fixes MEDIUM audit finding: the release workflow (contents:write +
id-token:write, PYPI_API_TOKEN exposed) ran several third-party actions
via mutable refs. A compromised upstream tag/branch could exfiltrate the
PyPI token or abuse write scopes.

Changes to .github/workflows/release.yml:
- Pin all previously-mutable actions to full commit SHAs:
  - actions/upload-artifact      @v7          -> 043fb46 # v7.0.1
  - actions/download-artifact    @v8          -> 3e5f45b # v8.0.1
  - sigstore/cosign-installer    @V3          -> 398d4b0 # v3.9.1
  - pypa/gh-action-pypi-publish  @release/v1  -> cef2210 # release/v1 (v1.14.0)
  - softprops/action-gh-release  @V3          -> b430933 # v3.0.0
- Move permissions from workflow level to per-job least privilege:
  default contents:read; id-token:write only in the sign job;
  contents:write only in the github-release job.
- Set persist-credentials: false on both actions/checkout steps.

Changes to .github/workflows/ci.yml:
- Set persist-credentials: false on actions/checkout (artipacked).

Dependabot (github-actions ecosystem, already configured) will keep the
SHA pins updated. Validated with zizmor: 0 errors, 0 warnings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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