Skip to content

Commit 5b79542

Browse files
[StepSecurity] Apply security best practices
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
1 parent ea40967 commit 5b79542

File tree

12 files changed

+94
-34
lines changed

12 files changed

+94
-34
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,22 @@ jobs:
3030
build:
3131
runs-on: ubuntu-22.04
3232
steps:
33-
- uses: actions/checkout@v5
33+
- name: Harden the runner (Audit all outbound calls)
34+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
35+
with:
36+
egress-policy: audit
37+
38+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3439

3540
- name: Set up JDK 17
36-
uses: actions/setup-java@v5
41+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
3742
with:
3843
distribution: 'temurin'
3944
java-version: '17'
4045
cache: 'maven'
4146

4247
- name: Set up Python
43-
uses: actions/setup-python@v6
48+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
4449
with:
4550
python-version: '3.10'
4651
architecture: 'x64'

.github/workflows/ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,24 @@ jobs:
216216
smoke/test_list_volumes"]
217217

218218
steps:
219-
- uses: actions/checkout@v5
219+
- name: Harden the runner (Audit all outbound calls)
220+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
221+
with:
222+
egress-policy: audit
223+
224+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
220225
with:
221226
fetch-depth: 0
222227

223228
- name: Set up JDK 17
224-
uses: actions/setup-java@v5
229+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
225230
with:
226231
distribution: 'temurin'
227232
java-version: '17'
228233
cache: 'maven'
229234

230235
- name: Set up Python
231-
uses: actions/setup-python@v6
236+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
232237
with:
233238
python-version: '3.10'
234239
architecture: 'x64'
@@ -340,7 +345,7 @@ jobs:
340345
echo -e "Simulator CI Test Results: (only failures listed)\n"
341346
python3 ./tools/marvin/xunit-reader.py integration-test-results/
342347
343-
- uses: codecov/codecov-action@v4
348+
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
344349
with:
345350
files: jacoco-coverage.xml
346351
fail_ci_if_error: true

.github/workflows/codecov.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,17 @@ jobs:
3232
name: codecov
3333
runs-on: ubuntu-22.04
3434
steps:
35-
- uses: actions/checkout@v5
35+
- name: Harden the runner (Audit all outbound calls)
36+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
37+
with:
38+
egress-policy: audit
39+
40+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3641
with:
3742
fetch-depth: 0
3843

3944
- name: Set up JDK 17
40-
uses: actions/setup-java@v5
45+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
4146
with:
4247
distribution: 'temurin'
4348
java-version: '17'
@@ -49,7 +54,7 @@ jobs:
4954
cd nonoss && bash -x install-non-oss.sh && cd ..
5055
mvn -P quality -Dsimulator -Dnoredist clean install -T$(nproc)
5156
52-
- uses: codecov/codecov-action@v4
57+
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
5358
with:
5459
files: ./client/target/site/jacoco-aggregate/jacoco.xml
5560
fail_ci_if_error: true

.github/workflows/codeql-analysis.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,20 @@ jobs:
3434
matrix:
3535
language: ["actions"]
3636
steps:
37+
- name: Harden the runner (Audit all outbound calls)
38+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
39+
with:
40+
egress-policy: audit
41+
3742
- name: Checkout repository
38-
uses: actions/checkout@v5
43+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3944
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@v3
45+
uses: github/codeql-action/init@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1
4146
with:
4247
languages: ${{ matrix.language }}
4348
- name: Autobuild
44-
uses: github/codeql-action/autobuild@v3
49+
uses: github/codeql-action/autobuild@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1
4550
- name: Perform CodeQL Analysis
46-
uses: github/codeql-action/analyze@v3
51+
uses: github/codeql-action/analyze@5c8a8a642e79153f5d047b10ec1cba1d1cc65699 # v3.35.1
4752
with:
4853
category: "Security"

.github/workflows/docker-cloudstack-simulator.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ jobs:
3737
if: github.repository == 'apache/cloudstack'
3838
runs-on: ubuntu-22.04
3939
steps:
40+
- name: Harden the runner (Audit all outbound calls)
41+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
42+
with:
43+
egress-policy: audit
44+
4045
- name: Login to Docker Registry
41-
uses: docker/login-action@v2
46+
uses: step-security/docker-login-action@6aa05fe688caf2c58e784663f01b3415ced503e8 # v3.7.0
4247
with:
4348
registry: ${{ secrets.DOCKER_REGISTRY }}
4449
username: ${{ secrets.DOCKERHUB_USER }}
@@ -47,7 +52,7 @@ jobs:
4752
- name: Set Docker repository name
4853
run: echo "DOCKER_REPOSITORY=apache" >> $GITHUB_ENV
4954

50-
- uses: actions/checkout@v5
55+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
5156

5257
- name: Set ACS version
5358
run: echo "ACS_VERSION=$(grep '<version>' pom.xml | head -2 | tail -1 | cut -d'>' -f2 |cut -d'<' -f1)" >> $GITHUB_ENV

.github/workflows/main-sonar-check.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,31 @@ jobs:
3232
name: Main Sonar JaCoCo Build
3333
runs-on: ubuntu-22.04
3434
steps:
35-
- uses: actions/checkout@v5
35+
- name: Harden the runner (Audit all outbound calls)
36+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
37+
with:
38+
egress-policy: audit
39+
40+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3641
with:
3742
fetch-depth: 0
3843

3944
- name: Set up JDK17
40-
uses: actions/setup-java@v5
45+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
4146
with:
4247
distribution: 'temurin'
4348
java-version: '17'
4449
cache: 'maven'
4550

4651
- name: Cache SonarCloud packages
47-
uses: actions/cache@v5
52+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
4853
with:
4954
path: ~/.sonar/cache
5055
key: ${{ runner.os }}-sonar
5156
restore-keys: ${{ runner.os }}-sonar
5257

5358
- name: Cache local Maven repository
54-
uses: actions/cache@v5
59+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
5560
with:
5661
path: ~/.m2/repository
5762
key: ${{ runner.os }}-m2-${{ hashFiles('pom.xml', '*/pom.xml', '*/*/pom.xml', '*/*/*/pom.xml') }}

.github/workflows/merge-conflict-checker.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ jobs:
3434
pull-requests: write # for eps1lon/actions-label-merge-conflict to label PRs
3535
runs-on: ubuntu-22.04
3636
steps:
37+
- name: Harden the runner (Audit all outbound calls)
38+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
39+
with:
40+
egress-policy: audit
41+
3742
- name: Conflict Check
38-
uses: eps1lon/actions-label-merge-conflict@v2.0.0
43+
uses: eps1lon/actions-label-merge-conflict@9023974d0f6f2c9664f51f519363e03d70857188 # v2.0.0
3944
with:
4045
repoToken: "${{ secrets.GITHUB_TOKEN }}"
4146
dirtyLabel: "status:has-conflicts"

.github/workflows/pre-commit.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,20 @@ jobs:
3131
name: Run pre-commit
3232
runs-on: ubuntu-22.04
3333
steps:
34+
- name: Harden the runner (Audit all outbound calls)
35+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
36+
with:
37+
egress-policy: audit
38+
3439
- name: Check Out
35-
uses: actions/checkout@v5
40+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3641
- name: Install
3742
run: |
3843
python -m pip install --upgrade pip
3944
pip install pre-commit
4045
- name: Set PY
4146
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
42-
- uses: actions/cache@v5
47+
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
4348
with:
4449
path: ~/.cache/pre-commit
4550
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}

.github/workflows/rat.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ jobs:
3030
build:
3131
runs-on: ubuntu-22.04
3232
steps:
33-
- uses: actions/checkout@v5
33+
- name: Harden the runner (Audit all outbound calls)
34+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
35+
with:
36+
egress-policy: audit
37+
38+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3439
- name: Set up JDK 17
35-
uses: actions/setup-java@v5
40+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
3641
with:
3742
java-version: '17'
3843
distribution: 'adopt'

.github/workflows/sonar-check.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,32 @@ jobs:
3333
name: Sonar JaCoCo Coverage
3434
runs-on: ubuntu-22.04
3535
steps:
36-
- uses: actions/checkout@v5
36+
- name: Harden the runner (Audit all outbound calls)
37+
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
38+
with:
39+
egress-policy: audit
40+
41+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
3742
with:
3843
ref: "refs/pull/${{ github.event.number }}/merge"
3944
fetch-depth: 0
4045

4146
- name: Set up JDK17
42-
uses: actions/setup-java@v5
47+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
4348
with:
4449
distribution: 'temurin'
4550
java-version: '17'
4651
cache: 'maven'
4752

4853
- name: Cache SonarCloud packages
49-
uses: actions/cache@v5
54+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
5055
with:
5156
path: ~/.sonar/cache
5257
key: ${{ runner.os }}-sonar
5358
restore-keys: ${{ runner.os }}-sonar
5459

5560
- name: Cache local Maven repository
56-
uses: actions/cache@v5
61+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
5762
with:
5863
path: ~/.m2/repository
5964
key: ${{ runner.os }}-m2-${{ hashFiles('pom.xml', '*/pom.xml', '*/*/pom.xml', '*/*/*/pom.xml') }}

0 commit comments

Comments
 (0)