Skip to content

Commit a93cae6

Browse files
[StepSecurity] Apply security best practices
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 18426f0 commit a93cae6

File tree

5 files changed

+46
-15
lines changed

5 files changed

+46
-15
lines changed

.github/workflows/build.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,38 @@ env:
1414
REGISTRY: quay.io
1515
IMAGE_NAME: ${{ github.repository }}
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
build:
1922
runs-on: ubuntu-latest
2023
if: github.actor != 'dependabot[bot]'
2124
steps:
25+
- name: Harden the runner (Audit all outbound calls)
26+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
27+
with:
28+
egress-policy: audit
29+
2230
- name: Checkout
23-
uses: actions/checkout@v5
31+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2432
- name: Set up QEMU
25-
uses: docker/setup-qemu-action@v3
33+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
2634
- name: Set up Docker Buildx
27-
uses: docker/setup-buildx-action@v3
35+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
2836
- name: Extract metadata (tags, labels) for Docker
2937
id: meta
30-
uses: docker/metadata-action@v5
38+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
3139
with:
3240
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3341
- name: Login to Quay.io Container Registry
34-
uses: docker/login-action@v3
42+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
3543
with:
3644
registry: quay.io
3745
username: utilitywarehouse+drone_ci
3846
password: ${{ secrets.SYSTEM_QUAY_TOKEN }}
3947
- name: Build and push Docker image
40-
uses: docker/build-push-action@v6
48+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
4149
with:
4250
context: .
4351
push: true

.github/workflows/codeql-analysis.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
schedule:
2121
- cron: "23 7 * * 1"
2222

23+
permissions:
24+
contents: read
25+
2326
jobs:
2427
analyze:
2528
name: Analyze
@@ -38,17 +41,22 @@ jobs:
3841
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3942

4043
steps:
44+
- name: Harden the runner (Audit all outbound calls)
45+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
46+
with:
47+
egress-policy: audit
48+
4149
- name: Checkout repository
42-
uses: actions/checkout@v5
50+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4351

4452
- name: Install Go
45-
uses: actions/setup-go@v6
53+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
4654
with:
4755
go-version-file: go.mod
4856

4957
# Initializes the CodeQL tools for scanning.
5058
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@v3
59+
uses: github/codeql-action/init@d198d2fabf39a7f36b5ce57ce70d4942944f006e # v3.31.0
5260
with:
5361
languages: ${{ matrix.language }}
5462
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -59,7 +67,7 @@ jobs:
5967
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6068
# If this step fails, then you should remove it and run the build manually (see below)
6169
- name: Autobuild
62-
uses: github/codeql-action/autobuild@v3
70+
uses: github/codeql-action/autobuild@d198d2fabf39a7f36b5ce57ce70d4942944f006e # v3.31.0
6371

6472
# ℹ️ Command-line programs to run using the OS shell.
6573
# 📚 https://git.io/JvXDl
@@ -73,4 +81,4 @@ jobs:
7381
# make release
7482

7583
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@v3
84+
uses: github/codeql-action/analyze@d198d2fabf39a7f36b5ce57ce70d4942944f006e # v3.31.0

.github/workflows/dependabot-auto-approve.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: ${{ github.actor == 'dependabot[bot]' }}
1212
steps:
13+
- name: Harden the runner (Audit all outbound calls)
14+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
15+
with:
16+
egress-policy: audit
17+
1318
- name: Dependabot metadata
1419
id: metadata
15-
uses: dependabot/[email protected]
20+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
1621
with:
1722
github-token: "${{ secrets.GITHUB_TOKEN }}"
1823
- name: Approve a PR

.github/workflows/dependabot-auto-merge.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ jobs:
1111
runs-on: ubuntu-latest
1212
if: ${{ github.actor == 'dependabot[bot]' }}
1313
steps:
14+
- name: Harden the runner (Audit all outbound calls)
15+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
16+
with:
17+
egress-policy: audit
18+
1419
- name: Dependabot metadata
1520
id: metadata
16-
uses: dependabot/[email protected]
21+
uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
1722
with:
1823
github-token: "${{ secrets.GITHUB_TOKEN }}"
1924
- name: Enable auto-merge for Dependabot PRs

.github/workflows/test.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ jobs:
1515
os: [ubuntu-latest]
1616
runs-on: ${{ matrix.os }}
1717
steps:
18+
- name: Harden the runner (Audit all outbound calls)
19+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
20+
with:
21+
egress-policy: audit
22+
1823
- name: Checkout code
19-
uses: actions/checkout@v5
24+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2025

2126
- name: Install Go
22-
uses: actions/setup-go@v6
27+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
2328
with:
2429
go-version: ${{ matrix.go-version }}
2530

0 commit comments

Comments
 (0)