Skip to content

Commit

Permalink
ci: Do not persist credentials after checkout
Browse files Browse the repository at this point in the history
See actions/checkout#485 and
https://johnstawinski.com/2024/01/11/playing-with-fire-how-we-executed-a-critical-supply-chain-attack-on-pytorch/

In short, it is a terrible idea to persist even our default
credentials after checkout.  There's no call for that, so we will now
set `persist-credentials: false` on all checkout actions.
  • Loading branch information
joeyparrish committed Dec 18, 2024
1 parent 758c084 commit 5038e10
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
persist-credentials: false

- name: Lint
run: python build/check.py
Expand Down Expand Up @@ -104,6 +105,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
persist-credentials: false

# Older versions of Safari can be installed, but not to the root, and it
# can't replace the standard version, at least not on GitHub's VMs. If
Expand Down Expand Up @@ -256,6 +258,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
persist-credentials: false

- name: Docker
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/demo-version-index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
# We need a list of all tags for this, so fetch the entire history.
fetch-depth: 0
persist-credentials: false

- uses: google-github-actions/auth@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/report-incremental-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Compute incremental code coverage
id: compute
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/selenium-lab-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.compute-sha.outputs.SHA }}
persist-credentials: false

- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -154,6 +155,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.compute-sha.outputs.SHA }}
persist-credentials: false

- name: Set commit status to pending
if: ${{ inputs.skip_test_status == false }}
Expand Down Expand Up @@ -235,6 +237,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.compute-sha.outputs.SHA }}
persist-credentials: false

- name: Set commit status to pending
if: ${{ inputs.skip_commit_status == false }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/talk-to-shaka-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Handle command
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/update-screenshots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.compute-sha.outputs.SHA }}
persist-credentials: false

- name: Set commit status to pending
uses: shaka-project/shaka-github-tools/set-commit-status@main
Expand Down Expand Up @@ -61,6 +62,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.compute-sha.outputs.SHA }}
persist-credentials: false

- name: Get artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -114,6 +116,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.compute-sha.outputs.SHA }}
persist-credentials: false

- name: Compute final status
id: compute
Expand Down

0 comments on commit 5038e10

Please sign in to comment.