Skip to content

Commit 79b5879

Browse files
committed
ci: Prevent leaked credentials (#8142)
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.
1 parent e0a61e7 commit 79b5879

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/custom-actions/prep-for-appspot/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ runs:
5454
run: |
5555
mv app-engine/shaka-player-demo/* .
5656
rm README.md
57+
mv app-engine/gcloudignore .gcloudignore

.github/workflows/demo-version-index.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ jobs:
3636
credentials_json: '${{ secrets.APPENGINE_DEPLOY_KEY }}'
3737

3838
- name: Generate static content
39-
run: python3 app-engine/demo-version-index/generate.py
39+
run: |
40+
python3 app-engine/demo-version-index/generate.py
41+
cp app-engine/gcloudignore app-engine/demo-version-index/.gcloudignore
4042
4143
- uses: google-github-actions/deploy-appengine@v2
4244
with:
4345
project_id: shaka-player-demo
4446
version: index
4547
working_directory: app-engine/demo-version-index/
4648
promote: false
47-

app-engine/gcloudignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Defaults you get without an explicit .gcloudignore file
2+
.git
3+
.gitignore
4+
.gcloudignore
5+
6+
# Ignore generated credentials from google-github-actions/auth
7+
gha-creds-*.json

0 commit comments

Comments
 (0)