Skip to content

Commit 9238ae0

Browse files
committed
chore(security): harden supply-chain; add fuzz & SLSA scaffolding; add zsh-safe local green gate and 'no Spanish' pre-commit
1 parent ed1ea03 commit 9238ae0

File tree

12 files changed

+113
-232
lines changed

12 files changed

+113
-232
lines changed

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
language: ["javascript", "python"]
2323
steps:
2424
- uses: actions/checkout@v5
25-
- uses: github/codeql-action/init@v3
25+
- uses: github/codeql-action@0337c4c06e7e00d0d6e64396c13b9dc18dd6d8c5
2626
with:
2727
languages: ${{ matrix.language }}
2828
- uses: github/codeql-action/autobuild@v3
29-
- uses: github/codeql-action/analyze@v3
29+
- uses: github/codeql-action@0337c4c06e7e00d0d6e64396c13b9dc18dd6d8c5

.github/workflows/fuzz.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Fuzz
2+
on:
3+
pull_request:
4+
schedule:
5+
- cron: "0 4 * * 1"
6+
workflow_dispatch:
7+
permissions:
8+
contents: read
9+
jobs:
10+
fuzz:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
14+
- uses: actions/setup-node@89d709d423dc495668cd762a18dd4a070611be3f
15+
with: { node-version: "20" }
16+
- run: npm ci
17+
- run: npm run fuzz --if-present

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919
fetch-tags: true
20-
- uses: actions/setup-python@v6
20+
- uses: actions/setup-python@4267e283df95c05d9f16ece6624106f44613b489
2121
with:
2222
python-version: "3.12"
2323
- name: Check tag matches version (release events)

.github/workflows/release-sbom.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
fetch-depth: 0
1616
- name: Generate SBOM (CycloneDX JSON)
17-
uses: anchore/sbom-action@v0
17+
uses: anchore/sbom-action@c73dd3f93ab542b7902df62a6ee5ad763179fa7b
1818
with:
1919
path: .
2020
format: cyclonedx-json

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
persist-credentials: false
2727

2828
- name: Run Scorecard (private publish)
29-
uses: ossf/scorecard-action@v2.4.2
29+
uses: ossf/scorecard-action@43e475b79a8bd5217334edc08879005b2229d79a.4.2
3030
with:
3131
results_file: results.sarif
3232
results_format: sarif

.github/workflows/slsa.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: SLSA provenance
2+
on:
3+
release:
4+
types: [published]
5+
permissions:
6+
contents: write
7+
id-token: write
8+
jobs:
9+
provenance:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
13+
- uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@main
14+
with:
15+
base64-subjects: "${{ github.sha }}"

.github/workflows/supply-chain.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
pull-requests: read
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
2323
with: { fetch-depth: 2 }
2424
- name: Dependency review
2525
id: dr
26-
uses: actions/dependency-review-action@v4
26+
uses: actions/dependency-review-action@6fad41793215e16e31faa120c584d320a07b88de
2727
with:
2828
fail-on-severity: high
2929
# Clave: fuera de PR, no romper el job aunque detecte problemas
@@ -37,11 +37,11 @@ jobs:
3737
security-events: write
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
4141
with: { fetch-depth: 0 }
4242
- name: Run Scorecard
4343
id: scorecard
44-
uses: ossf/scorecard-action@v2.3.3
44+
uses: ossf/scorecard-action@43e475b79a8bd5217334edc08879005b2229d79a.3.3
4545
with:
4646
results_file: results.sarif
4747
results_format: sarif
@@ -55,14 +55,14 @@ jobs:
5555
permissions: { contents: read }
5656
runs-on: ubuntu-latest
5757
steps:
58-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
5959
- name: Generate SBOM (SPDX)
60-
uses: anchore/sbom-action@v0.17.6
60+
uses: anchore/sbom-action@c73dd3f93ab542b7902df62a6ee5ad763179fa7b.17.6
6161
with:
6262
format: spdx-json
6363
output-file: sbom.spdx.json
6464
- name: Upload SBOM artifact
65-
uses: actions/upload-artifact@v4
65+
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
6666
with:
6767
name: sbom-spdx
6868
path: sbom.spdx.json

.github/workflows/ts-ci-badge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ jobs:
55
badge:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/setup-node@v4
8+
- uses: actions/setup-node@89d709d423dc495668cd762a18dd4a070611be3f
99
with: { node-version: "20" }
1010
- run: node -v && npm -v

.github/workflows/ts-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
echo "has_pkg=false" >> "$GITHUB_OUTPUT"
5353
fi
5454
55-
- uses: actions/setup-node@v4
55+
- uses: actions/setup-node@89d709d423dc495668cd762a18dd4a070611be3f
5656
if: ${{ steps.guard.outputs.has_pkg == 'true' }}
5757
with:
5858
node-version: ${{ matrix.node }}

fuzz/parse-json.fuzz.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"use strict";
2+
3+
module.exports.fuzz = (data) => {
4+
try {
5+
JSON.parse(data.toString());
6+
} catch {
7+
// ignore
8+
}
9+
};

0 commit comments

Comments
 (0)