chore(ci): security hardening - #1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the CI workflow by reducing default GitHub token permissions and mitigating supply-chain risks through action pinning, while ensuring the jobs that need elevated permissions explicitly declare them.
Changes:
- Reduced workflow-level
permissionstocontents: read, and added job-level permission scopes for Pages deployment and Releases. - Pinned all third-party GitHub Actions to specific commit SHAs and disabled persisted checkout credentials (
persist-credentials: false). - Adjusted the Android keystore-generation step to use step
envvariables (instead of inline${{ env.* }}expressions) and improved quoting for secret values.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+128
to
+140
| cd $EXAMPLE_DIR/android/app | ||
| if [ -n "$KEYSTORE_BASE64" ]; then | ||
| echo "$KEYSTORE_BASE64" | base64 -d > ${{ env.ANDROID_KEYSTORE_FILE }} | ||
| echo "$KEYSTORE_BASE64" | base64 -d > $ANDROID_KEYSTORE_FILE | ||
| else | ||
| keytool -genkey -v -keystore ${{ env.ANDROID_KEYSTORE_FILE }} \ | ||
| -alias ${{ env.ANDROID_KEY_ALIAS }} \ | ||
| keytool -genkey -v -keystore $ANDROID_KEYSTORE_FILE \ | ||
| -alias $ANDROID_KEY_ALIAS \ | ||
| -keyalg RSA -keysize 2048 -validity 36135 \ | ||
| -storepass '${{ env.ANDROID_KEYSTORE_SECRET }}' \ | ||
| -keypass '${{ env.ANDROID_KEY_PASSWORD }}' \ | ||
| -dname '${{ env.ANDROID_KEY_DNAME }}' | ||
| -storepass "$ANDROID_KEYSTORE_SECRET" \ | ||
| -keypass "$ANDROID_KEY_PASSWORD" \ | ||
| -dname "$ANDROID_KEY_DNAME" | ||
| fi | ||
| if ! grep -q "${{ env.ANDROID_KEYSTORE_FILE }}" .gitignore 2>/dev/null; then | ||
| echo "${{ env.ANDROID_KEYSTORE_FILE }}" >> .gitignore | ||
| if ! grep -q "$ANDROID_KEYSTORE_FILE" .gitignore 2>/dev/null; then | ||
| echo "$ANDROID_KEYSTORE_FILE" >> .gitignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes fluttercandies/security-scanner#77