Skip to content

Commit e99b3d2

Browse files
authored
Merge pull request #152 from githubabcs-devops/update-workflows
Update workflow actions to latest versions for improved security and …
2 parents 79e4e4d + e8f4307 commit e99b3d2

17 files changed

+105
-59
lines changed

.github/workflows/CIS-Anchore-Grype.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030

3131
steps:
3232
- name: Checkout code
33-
uses: actions/checkout@v5
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434

3535
- name: Build an image from Dockerfile
36-
uses: docker/build-push-action@v6
36+
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
3737
with:
3838
context: ./src/webapp01
3939
file: ./src/webapp01/Dockerfile
@@ -42,20 +42,20 @@ jobs:
4242
load: true
4343

4444
- name: Run the Anchore Grype scan action
45-
uses: anchore/scan-action@v6
45+
uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
4646
id: scan
4747
with:
4848
image: "${{ env.imageName }}:${{ env.tag }}"
4949
fail-build: ${{ env.fail-build }}
5050
severity-cutoff: critical
5151

5252
- name: Upload Anchore vulnerability report to GitHub Security tab
53-
uses: github/codeql-action/upload-sarif@v3
53+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
5454
with:
5555
sarif_file: ${{ steps.scan.outputs.sarif }}
5656

5757
- name: Upload alerts file as a workflow artifact
58-
uses: actions/upload-artifact@v4
58+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5959
with:
6060
name: alerts
6161
path: ${{ steps.scan.outputs.sarif }}

.github/workflows/CIS-Trivy-AquaSecurity.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@ jobs:
3030

3131
steps:
3232
- name: Checkout code
33-
uses: actions/checkout@v5
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434

3535
- name: Build an image from Dockerfile
3636
run: |
3737
docker build ./src/webapp01 --file ./src/webapp01/Dockerfile --tag ${{ env.imageName }}:${{ env.tag }}
3838
3939
- name: Run Trivy vulnerability scanner
40-
uses: aquasecurity/trivy-action@0.32.0
40+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # v0.35.0
4141
with:
4242
image-ref: "${{ env.imageName }}:${{ env.tag }}"
4343
format: "sarif"
4444
output: "trivy-results.sarif"
4545

4646
- name: Upload Trivy scan results to GitHub Security tab
47-
uses: github/codeql-action/upload-sarif@v3
47+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
4848
if: always()
4949
with:
5050
sarif_file: "trivy-results.sarif"
5151

5252
- name: Upload alerts file as a workflow artifact
53-
uses: actions/upload-artifact@v4
53+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5454
with:
5555
name: alerts
5656
path: "trivy-results.sarif"

.github/workflows/DAST-ZAP-Zed-Attach-Proxy-Checkmarx.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232

3333
steps:
34-
- uses: actions/checkout@v5
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3535
# build and start your application here
3636
# conditionally run the build step
3737
# assuming the application is a Docker container
@@ -47,14 +47,14 @@ jobs:
4747
echo "Application is already running."
4848
fi
4949
- name: Run ZAP Scan
50-
uses: zaproxy/action-full-scan@v0.12.0
50+
uses: zaproxy/action-full-scan@3c58388149901b9a03b7718852c5ba889646c27c # v0.13.0
5151
id: zap
5252
with:
5353
allow_issue_writing: false
5454
target: "${{ env.ZAP_TARGET }}"
5555
artifact_name: "zap-full-scan"
5656
- name: ZAP Scan
57-
uses: zaproxy/action-baseline@v0.14.0
57+
uses: zaproxy/action-baseline@de8ad967d3548d44ef623df22cf95c3b0baf8b25 # v0.15.0
5858
with:
5959
allow_issue_writing: false
6060
target: "${{ env.ZAP_TARGET }}"
@@ -64,6 +64,6 @@ jobs:
6464
- uses: githubabcs-devops/zap-to-ghas@main
6565

6666
- name: Upload SARIF file
67-
uses: github/codeql-action/upload-sarif@v3
67+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
6868
with:
6969
sarif_file: results.sarif

.github/workflows/IACS-AquaSecurity-tfsec.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323

2424
steps:
2525
- name: Checkout code
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727

2828
- name: Run tfsec
29-
uses: aquasecurity/tfsec-sarif-action@v0.1.4
29+
uses: aquasecurity/tfsec-sarif-action@21ded20e8ca120cd9d3d6ab04ef746477542a608 # v0.1.4
3030
with:
3131
sarif_file: tfsec.sarif
3232

3333
- name: Upload SARIF file to GitHub Security tab
34-
uses: github/codeql-action/upload-sarif@v3
34+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
3535
with:
3636
sarif_file: tfsec.sarif

.github/workflows/IACS-Checkmarx-kics.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ jobs:
2424

2525
steps:
2626
- name: Checkout code
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2828

2929
- name: Mkdir results-dir
3030
# make sure results dir is created
3131
run: mkdir -p results-dir
3232

3333
- name: Run kics Scan
34-
uses: checkmarx/kics-github-action@v2.1.13
34+
uses: checkmarx/kics-github-action@05aa5eb70eede1355220f4ca5238d96b397e30a6 # v2.1.20
3535
with:
3636
path: 'terraform'
3737
# when provided with a directory on output_path
@@ -51,6 +51,6 @@ jobs:
5151
cat results-dir/results.json
5252
5353
- name: Upload SARIF file to GitHub Security tab
54-
uses: github/codeql-action/upload-sarif@v3
54+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
5555
with:
5656
sarif_file: results-dir/results.sarif

.github/workflows/IACS-Microsoft-Security-DevOps.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040
# Windows and Linux agents are supported
4141
runs-on: windows-latest
4242
steps:
43-
- uses: actions/checkout@v5
43+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4444

4545
- name: Run Microsoft Security DevOps
46-
uses: microsoft/security-devops-action@v1.12.0
46+
uses: microsoft/security-devops-action@08976cb623803b1b36d7112d4ff9f59eae704de0 # v1.12.0
4747
id: msdo
4848
with:
4949
# config: string. Optional. A file path to an MSDO configuration file ('*.gdnconfig').
@@ -54,13 +54,13 @@ jobs:
5454

5555
# Upload alerts to the Security tab - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
5656
- name: Upload results to Security tab
57-
uses: github/codeql-action/upload-sarif@v3
57+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
5858
with:
5959
sarif_file: ${{ steps.msdo.outputs.sarifFile }}
6060

6161
# Upload alerts file as a workflow artifact - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
6262
- name: Upload alerts file as a workflow artifact
63-
uses: actions/upload-artifact@v4
63+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6464
with:
6565
name: alerts
6666
path: ${{ steps.msdo.outputs.sarifFile }}

.github/workflows/MSDO-Microsoft-Security-DevOps.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
# Windows and Linux agents are supported
2929
runs-on: windows-latest
3030
steps:
31-
- uses: actions/checkout@v5
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3232

3333
- name: Run Microsoft Security DevOps
34-
uses: microsoft/security-devops-action@v1.12.0
34+
uses: microsoft/security-devops-action@08976cb623803b1b36d7112d4ff9f59eae704de0 # v1.12.0
3535
id: msdo
3636
with:
3737
# config: string. Optional. A file path to an MSDO configuration file ('*.gdnconfig').
@@ -42,13 +42,13 @@ jobs:
4242

4343
# Upload alerts to the Security tab - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
4444
- name: Upload results to Security tab
45-
uses: github/codeql-action/upload-sarif@v3
45+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
4646
with:
4747
sarif_file: ${{ steps.msdo.outputs.sarifFile }}
4848

4949
# Upload alerts file as a workflow artifact - required for MSDO results to appear in the codeQL security alerts tab on GitHub (Requires GHAS)
5050
- name: Upload alerts file as a workflow artifact
51-
uses: actions/upload-artifact@v4
51+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5252
with:
5353
name: alerts
5454
path: ${{ steps.msdo.outputs.sarifFile }}

.github/workflows/SAST-ESLint.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code.
2+
# More details at https://github.com/eslint/eslint and https://eslint.org
3+
4+
name: "SAST - ESLint"
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
# The branches below must be a subset of the branches above
11+
branches: [ "main" ]
12+
schedule:
13+
- cron: '39 9 * * 4'
14+
15+
jobs:
16+
eslint:
17+
name: Run eslint scanning
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
security-events: write
22+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@de0fac28217160c9e1c4a3e79f4436864c564dc7 # v6.0.2
26+
27+
- name: Install ESLint
28+
run: |
29+
npm install eslint@8.10.0
30+
npm install @microsoft/eslint-formatter-sarif@3.1.0
31+
32+
- name: Run ESLint
33+
env:
34+
SARIF_ESLINT_IGNORE_SUPPRESSED: "true"
35+
run: npx eslint .
36+
--config .eslintrc.js
37+
--ext .js,.jsx,.ts,.tsx
38+
--format @microsoft/eslint-formatter-sarif
39+
--output-file eslint-results.sarif
40+
continue-on-error: true
41+
42+
- name: Upload analysis results to GitHub
43+
uses: github/codeql-action/upload-sarif@d4b3ca94f14f5cf92f51e5f8efe83e46c6c46ad1 # v4.1.3
44+
with:
45+
sarif_file: eslint-results.sarif
46+
wait-for-processing: true

.github/workflows/SAST-GitHubAdvancedSecurity-CodeQL.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
4949
steps:
5050
- name: Checkout repository
51-
uses: actions/checkout@v5
51+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5252

5353
# Add any setup steps before running the `github/codeql-action/init` action.
5454
# This includes steps like installing compilers or runtimes (`actions/setup-node`
@@ -58,7 +58,7 @@ jobs:
5858

5959
# Initializes the CodeQL tools for scanning.
6060
- name: Initialize CodeQL
61-
uses: github/codeql-action/init@v3
61+
uses: github/codeql-action/init@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
6262
with:
6363
languages: ${{ matrix.language }}
6464
build-mode: ${{ matrix.build-mode }}
@@ -86,6 +86,6 @@ jobs:
8686
exit 1
8787
8888
- name: Perform CodeQL Analysis
89-
uses: github/codeql-action/analyze@v3
89+
uses: github/codeql-action/analyze@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
9090
with:
9191
category: "/language:${{matrix.language}}"

.github/workflows/SAST-Kubesec.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout code
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727

2828
- name: Run kubesec scanner (critical-double.yaml)
29-
uses: controlplaneio/kubesec-action@43d0ddff5ffee89a6bb9f29b64cd865411137b14
29+
uses: controlplaneio/kubesec-action@43d0ddff5ffee89a6bb9f29b64cd865411137b14 # v0.0.2
3030
with:
3131
input: manifests/critical-double.yaml # specify configuration file to scan here
3232
format: template
@@ -52,7 +52,7 @@ jobs:
5252
5353
- name: Upload Kubesec scan results to GitHub Security tab
5454
if: steps.validate.outputs.valid == 'true'
55-
uses: github/codeql-action/upload-sarif@v4
55+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
5656
with:
5757
sarif_file: kubesec-results.sarif
5858

@@ -61,10 +61,10 @@ jobs:
6161
runs-on: ubuntu-latest
6262
steps:
6363
- name: Checkout code
64-
uses: actions/checkout@v5
64+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6565

6666
- name: Run kubesec scanner (score-5-pod-serviceaccount.yaml)
67-
uses: controlplaneio/kubesec-action@43d0ddff5ffee89a6bb9f29b64cd865411137b14
67+
uses: controlplaneio/kubesec-action@43d0ddff5ffee89a6bb9f29b64cd865411137b14 # v0.0.2
6868
with:
6969
input: manifests/score-5-pod-serviceaccount.yaml # specify configuration file to scan here
7070
format: template
@@ -90,6 +90,6 @@ jobs:
9090
9191
- name: Upload Kubesec scan results to GitHub Security tab
9292
if: steps.validate.outputs.valid == 'true'
93-
uses: github/codeql-action/upload-sarif@v4
93+
uses: github/codeql-action/upload-sarif@d4b3ca9fa7f69d38bfcd667bdc45bc373d16277e # v4
9494
with:
9595
sarif_file: kubesec-results.sarif

0 commit comments

Comments
 (0)