Skip to content

Commit

Permalink
ci: Prevent leaked credentials (#8142)
Browse files Browse the repository at this point in the history
Naive use of google-github-actions/auth and
google-github-actions/deploy-appengine can lead to leaked credentials.

In particular, uploading static content from the workspace root leads to
servable copies of the credentials file written by
google-github-actions/auth. This is exactly what the Shaka Player Demo
did. Making matters worse, google-github-actions/auth logs credential
filenames for all to see.

All uploaded credentials were expired before I uploaded this PR.

This fixes the leak by installing a gcloudignore file which prevents the
credentials from being uploaded.
  • Loading branch information
joeyparrish authored Feb 21, 2025
1 parent c080f85 commit 3a47bd1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ runs:
run: |
mv app-engine/shaka-player-demo/* .
rm README.md
mv app-engine/gcloudignore .gcloudignore
5 changes: 3 additions & 2 deletions .github/workflows/demo-version-index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ jobs:
credentials_json: '${{ secrets.APPENGINE_DEPLOY_KEY }}'

- name: Generate static content
run: python3 app-engine/demo-version-index/generate.py
run: |
python3 app-engine/demo-version-index/generate.py
cp app-engine/gcloudignore app-engine/demo-version-index/.gcloudignore
- uses: google-github-actions/deploy-appengine@v2
with:
project_id: shaka-player-demo
version: index
working_directory: app-engine/demo-version-index/
promote: false

7 changes: 7 additions & 0 deletions app-engine/gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Defaults you get without an explicit .gcloudignore file
.git
.gitignore
.gcloudignore

# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json

0 comments on commit 3a47bd1

Please sign in to comment.