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 4e6a79f commit 6a13bef
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
with:
ref: ${{ inputs.ref }}
submodules: recursive
persist-credentials: false

- name: Build
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false

- name: Generate docs
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false

- name: Configure Build Matrix
id: configure
Expand Down Expand Up @@ -99,6 +100,7 @@ jobs:
ref: ${{ inputs.ref }}
submodules: recursive
fetch-tags: true
persist-credentials: false

- name: Install Linux deps
if: runner.os == 'Linux'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
# We must use 'fetch-depth: 2', or else the linter won't have another
# revision to compare to.
fetch-depth: 2
persist-credentials: false

- name: Lint
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
ref: ${{ inputs.tag }}
submodules: recursive
fetch-tags: true
persist-credentials: false

- name: Log in to Docker Hub
uses: docker/login-action@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-npm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
persist-credentials: false

- uses: actions/setup-node@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-tags: true
persist-credentials: false

- name: Compute latest
id: compute
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-linux-distros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false

- name: Configure Build Matrix
id: configure
Expand Down Expand Up @@ -69,6 +70,7 @@ jobs:
with:
ref: ${{ inputs.ref }}
submodules: recursive
persist-credentials: false

- name: Build in Docker
run: ./packager/testing/test_dockers.sh "${{ matrix.os_name }}"

0 comments on commit 6a13bef

Please sign in to comment.