Skip to content

ci: harden workflows — least-privilege tokens, SHA-pinned release action, wrapper validation#216

Open
dipenpradhan wants to merge 1 commit into
Gurupreet:masterfrom
dipenpradhan:security-workflow-hardening
Open

ci: harden workflows — least-privilege tokens, SHA-pinned release action, wrapper validation#216
dipenpradhan wants to merge 1 commit into
Gurupreet:masterfrom
dipenpradhan:security-workflow-hardening

Conversation

@dipenpradhan

Copy link
Copy Markdown

Summary

Item 1 (+5) of #215 — workflow hardening with zero new infrastructure:

  • Replace marvinpinto/action-automatic-releases@latest in master-apk-create.yml: that action is archived/unmaintained, referenced by a mutable tag, and receives GITHUB_TOKEN. Now softprops/action-gh-release, pinned to a commit SHA (b430933… = v3.0.0), updating the same rolling latest-master prerelease.
  • Least-privilege permissions: blocks on android.yml, build.yml (contents: read) and master-apk-create.yml (contents: write for the release). Previously these inherited the default token permissions. The issue-creation workflows already had scoped permissions.
  • New wrapper-validation.yml: gradle/actions/wrapper-validation (SHA-pinned, v6.1.0) verifies every checked-in gradle-wrapper.jar against official Gradle checksums on pushes and PRs — a tampered wrapper JAR is invisible in code review.

Verification

Tested end-to-end on the fork (dipenpradhan/ComposeCookBook): the hardened workflows ran on a push to its master — including the release step, which successfully created/updated the latest-master prerelease with the APK via the new pinned action.

Refs #215

🤖 Generated with Claude Code

cc @Gurupreet for review

- Replace archived marvinpinto/action-automatic-releases@latest
  (mutable tag, token access) with softprops/action-gh-release
  pinned to a commit SHA
- Add least-privilege permissions blocks to android.yml, build.yml
  and master-apk-create.yml (default token was write-all)
- Add a Gradle wrapper validation workflow (checksums of
  gradle-wrapper.jar verified against official distributions)

Refs Gurupreet#215

Co-Authored-By: Claude Opus 4.8 (1M context) <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