Skip to content

Commit cc986a3

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

8 files changed

Lines changed: 89 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ jobs:
1717
name: Build and test
1818
runs-on: [ubuntu-latest]
1919
steps:
20+
- name: Harden the runner (Audit all outbound calls)
21+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
22+
with:
23+
egress-policy: audit
24+
2025
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2126
with:
2227
fetch-depth: 0
@@ -111,6 +116,11 @@ jobs:
111116
- linux-arm64
112117
- darwin-arm64
113118
steps:
119+
- name: Harden the runner (Audit all outbound calls)
120+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
121+
with:
122+
egress-policy: audit
123+
114124
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
115125

116126
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
@@ -157,6 +167,11 @@ jobs:
157167
if: github.event_name == 'release'
158168
needs: package
159169
steps:
170+
- name: Harden the runner (Audit all outbound calls)
171+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
172+
with:
173+
egress-policy: audit
174+
160175
- name: Download packages
161176
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
162177
with:

.github/workflows/codeql.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
runs-on: ubuntu-latest
2525

2626
steps:
27+
- name: Harden the runner (Audit all outbound calls)
28+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
29+
with:
30+
egress-policy: audit
31+
2732
- name: Checkout
2833
id: checkout
2934
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Harden the runner (Audit all outbound calls)
20+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
21+
with:
22+
egress-policy: audit
23+
24+
- name: 'Checkout Repository'
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
- name: 'Dependency Review'
27+
uses: actions/dependency-review-action@38ecb5b593bf0eb19e335c03f97670f792489a8b # v4.7.0

.github/workflows/markdown.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ jobs:
4343
name: Check Markdown Links
4444
runs-on: ubuntu-latest
4545
steps:
46+
- name: Harden the runner (Audit all outbound calls)
47+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
48+
with:
49+
egress-policy: audit
50+
4651
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4752

4853
- name: Check Links

.github/workflows/mkdocs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
build:
2124
runs-on: ubuntu-latest
@@ -46,10 +49,17 @@ jobs:
4649
path: site/
4750

4851
publish:
52+
permissions:
53+
contents: write # for Git to git push
4954
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
5055
runs-on: ubuntu-latest
5156
needs: build
5257
steps:
58+
- name: Harden the runner (Audit all outbound calls)
59+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
60+
with:
61+
egress-policy: audit
62+
5363
- name: Checkout vscode-cmsis-debugger
5464
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5565
with:

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ jobs:
7575
# Upload the results to GitHub's code scanning dashboard (optional).
7676
# Commenting out will disable the upload of results to your repo's Code Scanning dashboard
7777
- name: "Upload to code-scanning"
78-
uses: github/codeql-action/upload-sarif@v3
78+
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
7979
with:
8080
sarif_file: results.sarif

.github/workflows/tpip.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,26 @@ on:
1212

1313
workflow_dispatch:
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
report:
20+
permissions:
21+
contents: write # for Git to git push
1722
name: Generate report
1823
runs-on: ubuntu-latest
1924
steps:
20-
- uses: actions/checkout@v4
25+
- name: Harden the runner (Audit all outbound calls)
26+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
27+
with:
28+
egress-policy: audit
29+
30+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2131
with:
2232
ref: ${{ github.head_ref }}
2333

24-
- uses: actions/setup-node@v4
34+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2535
with:
2636
node-version: '20'
2737
cache: 'yarn'

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/gitleaks/gitleaks
3+
rev: v8.16.3
4+
hooks:
5+
- id: gitleaks
6+
- repo: https://github.com/pre-commit/mirrors-eslint
7+
rev: v8.38.0
8+
hooks:
9+
- id: eslint
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v4.4.0
12+
hooks:
13+
- id: end-of-file-fixer
14+
- id: trailing-whitespace

0 commit comments

Comments
 (0)