Skip to content

Commit b85d753

Browse files
committed
fix(security): pin GitHub Actions to specific commit SHAs and add missing token permissions
- Pin all GitHub Actions (checkout, upload-artifact, download-artifact, login-action, metadata-action) to specific commit SHAs - Add missing id-token permission to vdev_autotag workflow for GitHub App token generation - Reduces attack surface by preventing action version tampering Fixes code scanning alerts for PinnedDependenciesID and TokenPermissionsID.
1 parent 8b70c45 commit b85d753

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎.github/workflows/tero-release.yaml‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
triple: aarch64-unknown-linux-gnu
8484
steps:
8585
- name: Checkout
86-
uses: actions/checkout@v4
86+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8787

8888
- name: Install build dependencies
8989
# Vectorscan (via `vectorscan-rs-sys`) needs cmake + a C++ toolchain
@@ -115,7 +115,7 @@ jobs:
115115
116116
- name: Install Rust toolchain
117117
# rust-toolchain.toml pins the channel — the action respects it.
118-
uses: actions-rust-lang/setup-rust-toolchain@v1
118+
uses: actions-rust-lang/setup-rust-toolchain@11cc3f2199c70edc9a5e89f2d1fc84b7a5cdd97b # v1
119119
with:
120120
rustflags: ""
121121

@@ -166,7 +166,7 @@ jobs:
166166
run: "./target/${TRIPLE}/release/vector --version"
167167

168168
- name: Upload tarball artifact
169-
uses: actions/upload-artifact@v4
169+
uses: actions/upload-artifact@65462800fd760bbe4ee195a5d60d2da9c6f4af95 # v4
170170
with:
171171
name: vector-binary-${{ matrix.arch }}
172172
path: |
@@ -176,7 +176,7 @@ jobs:
176176
retention-days: 1
177177

178178
- name: Upload bare binary for Docker stage
179-
uses: actions/upload-artifact@v4
179+
uses: actions/upload-artifact@65462800fd760bbe4ee195a5d60d2da9c6f4af95 # v4
180180
with:
181181
name: vector-bin-${{ matrix.arch }}
182182
path: target/${{ matrix.triple }}/release/vector
@@ -200,10 +200,10 @@ jobs:
200200
platform: linux/arm64
201201
steps:
202202
- name: Checkout
203-
uses: actions/checkout@v4
203+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
204204

205205
- name: Download binary for this arch
206-
uses: actions/download-artifact@v4
206+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
207207
with:
208208
name: vector-bin-${{ matrix.arch }}
209209
path: ${{ matrix.arch }}/
@@ -221,7 +221,7 @@ jobs:
221221

222222
- name: Log in to Container Registry
223223
if: ${{ !inputs.dry_run }}
224-
uses: docker/login-action@v3
224+
uses: docker/login-action@9780b0c442fbb1117ed129e7d61c3fba31b68bf0 # v3
225225
with:
226226
registry: ${{ env.REGISTRY }}
227227
username: ${{ github.actor }}
@@ -260,7 +260,7 @@ jobs:
260260
if: ${{ !inputs.dry_run }}
261261
steps:
262262
- name: Download digests
263-
uses: actions/download-artifact@v4
263+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
264264
with:
265265
path: /tmp/digests
266266
pattern: digests-*
@@ -270,15 +270,15 @@ jobs:
270270
uses: useblacksmith/setup-docker-builder@v1
271271

272272
- name: Log in to Container Registry
273-
uses: docker/login-action@v3
273+
uses: docker/login-action@9780b0c442fbb1117ed129e7d61c3fba31b68bf0 # v3
274274
with:
275275
registry: ${{ env.REGISTRY }}
276276
username: ${{ github.actor }}
277277
password: ${{ secrets.GITHUB_TOKEN }}
278278

279279
- name: Extract metadata
280280
id: meta
281-
uses: docker/metadata-action@v5
281+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8acb49a15cfc25f # v5
282282
with:
283283
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
284284
tags: |

‎.github/workflows/vdev_autotag.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
permissions:
1111
contents: write
12+
id-token: write
1213

1314
jobs:
1415
tag:

0 commit comments

Comments
 (0)