Skip to content

Commit 92cbe79

Browse files
Merge pull request #2 from step-security-bot/chore/GHA-060809-stepsecurity-remediation
[StepSecurity] Apply security best practices
2 parents 89fc2c4 + 2544d44 commit 92cbe79

6 files changed

Lines changed: 147 additions & 4 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: npm
9+
directory: /
10+
schedule:
11+
interval: daily

‎.github/workflows/check-build.yaml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ name: Check build
22

33
on: push
44

5+
permissions: {}
6+
57
jobs:
68
check-build:
9+
permissions:
10+
contents: read # for actions/checkout to fetch code
711
runs-on: ubuntu-latest
812
steps:
9-
- uses: actions/checkout@v7
10-
- uses: actions/setup-node@v7
13+
- name: Harden the runner (Audit all outbound calls)
14+
uses: step-security/harden-runner@v2
15+
with:
16+
egress-policy: audit
17+
18+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
1120
with:
1221
node-version: "24"
1322
- run: npm install
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@v2
21+
with:
22+
egress-policy: audit
23+
24+
- name: 'Checkout Repository'
25+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
26+
- name: 'Dependency Review'
27+
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0

‎.github/workflows/scorecards.yml‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '20 7 * * 2'
14+
push:
15+
branches: ["main"]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# Needed to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write
29+
contents: read
30+
actions: read
31+
# To allow GraphQL ListCommits to work
32+
issues: read
33+
pull-requests: read
34+
# To detect SAST tools
35+
checks: read
36+
37+
steps:
38+
- name: Harden the runner (Audit all outbound calls)
39+
uses: step-security/harden-runner@v2
40+
with:
41+
egress-policy: audit
42+
43+
- name: "Checkout code"
44+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
45+
with:
46+
persist-credentials: false
47+
48+
- name: "Run analysis"
49+
uses: ossf/scorecard-action@55891bbd73f2425e97637d96e306fc9d491d0b21 # v2.4.4
50+
with:
51+
results_file: results.sarif
52+
results_format: sarif
53+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
54+
# - you want to enable the Branch-Protection check on a *public* repository, or
55+
# - you are installing Scorecards on a *private* repository
56+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
57+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
58+
59+
# Public repositories:
60+
# - Publish results to OpenSSF REST API for easy access by consumers
61+
# - Allows the repository to include the Scorecard badge.
62+
# - See https://github.com/ossf/scorecard-action#publishing-results.
63+
# For private repositories:
64+
# - `publish_results` will always be set to `false`, regardless
65+
# of the value entered here.
66+
publish_results: true
67+
68+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
69+
# format to the repository Actions tab.
70+
- name: "Upload artifact"
71+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
72+
with:
73+
name: SARIF file
74+
path: results.sarif
75+
retention-days: 5
76+
77+
# Upload the results to GitHub's code scanning dashboard.
78+
- name: "Upload to code-scanning"
79+
uses: github/codeql-action/upload-sarif@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6
80+
with:
81+
sarif_file: results.sarif

‎.github/workflows/smoke-test.yaml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ jobs:
88
smoke-test:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v7
11+
- name: Harden the runner (Audit all outbound calls)
12+
uses: step-security/harden-runner@v2
13+
with:
14+
egress-policy: audit
15+
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1217

13-
- uses: actions/setup-python@v7
18+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
1419
with:
1520
python-version: "3.x"
1621

‎.pre-commit-config.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/gitleaks/gitleaks
3+
rev: v8.30.1
4+
hooks:
5+
- id: gitleaks
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v6.0.0
8+
hooks:
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace

0 commit comments

Comments
 (0)