Skip to content

Commit 2550d4b

Browse files
authored
fix(security): pin GitHub Actions and add token permissions (#16)
1 parent 01cfb01 commit 2550d4b

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

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

Lines changed: 16 additions & 16 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

@@ -124,7 +124,7 @@ jobs:
124124
# network — roughly an order of magnitude faster than actions/cache@v4
125125
# for multi-GB `target/` payloads and not subject to GitHub's 10 GB
126126
# per-repo cache cap.
127-
uses: useblacksmith/cache@v5
127+
uses: useblacksmith/cache@d70f513405ada4651da6a85c4d4573d6f682a3d7 # v5
128128
with:
129129
path: |
130130
~/.cargo/registry/index/
@@ -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 }}/
@@ -217,19 +217,19 @@ jobs:
217217
# Blacksmith's setup-docker-builder wraps buildx and points the build
218218
# cache at Blacksmith's colocated layer cache, so we drop the manual
219219
# `cache-from`/`cache-to: type=gha` below — it's handled automatically.
220-
uses: useblacksmith/setup-docker-builder@v1
220+
uses: useblacksmith/setup-docker-builder@ab5c1da94f53f5cd75c1038092aa276dddfccbba # v1
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 }}
228228
password: ${{ secrets.GITHUB_TOKEN }}
229229

230230
- name: Build and push by digest
231231
id: build
232-
uses: useblacksmith/build-push-action@v2
232+
uses: useblacksmith/build-push-action@77a6a48abcaa2cfb9e7fb530f9de9d91b3e7e74b # v2
233233
with:
234234
context: .
235235
file: distribution/docker/tero/Dockerfile
@@ -246,7 +246,7 @@ jobs:
246246
247247
- name: Upload digest
248248
if: ${{ !inputs.dry_run }}
249-
uses: actions/upload-artifact@v4
249+
uses: actions/upload-artifact@65462800fd760bbe4ee195a5d60d2da9c6f4af95 # v4
250250
with:
251251
name: digests-${{ matrix.arch }}
252252
path: /tmp/digests/*
@@ -260,25 +260,25 @@ 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-*
267267
merge-multiple: true
268268

269269
- name: Set up Blacksmith Docker builder
270-
uses: useblacksmith/setup-docker-builder@v1
270+
uses: useblacksmith/setup-docker-builder@ab5c1da94f53f5cd75c1038092aa276dddfccbba # 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: |
@@ -310,7 +310,7 @@ jobs:
310310
contents: write
311311
steps:
312312
- name: Download binary tarballs
313-
uses: actions/download-artifact@v4
313+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
314314
with:
315315
path: /tmp/assets
316316
pattern: vector-binary-*

‎.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)