Skip to content

Commit 107c377

Browse files
Review SCM files and security updates (#3)
Security hardening of all 11 GitHub Actions workflow files: - SHA-pinned all actions to prevent supply chain attacks: - actions/checkout@v4.2.2 (11bd71901bbe...) - ossf/scorecard-action@v2.4.0 (62b2cac7ed81...) - github/codeql-action@v3.28.1 (662472033e02...) - codecov/codecov-action@v5.5.2 (671740ac38dd...) - trufflesecurity/trufflehog@v3.92.3 (05cccb53bc9e...) - editorconfig-checker@v2.1.0 (4b6cd6190d43...) - Swatinem/rust-cache@v2.8.2 (779680da7156...) - dtolnay/rust-toolchain@master (f7ccc83f9ed1...) - All GitHub Pages actions with SHA pins - Added SPDX-License-Identifier headers to all workflows - Added top-level permissions: read-all declarations - Added job-level permissions where needed - Fixed bug in security-policy.yml (was checking https:// instead of http://) - Updated SLSA generator from v1.4.0 to v2.1.0 - Updated STATE.scm with comprehensive 12-prover roadmap This addresses the critical supply chain security concern where unpinned actions (especially @main) could be compromised. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4b4e36f commit 107c377

12 files changed

Lines changed: 280 additions & 109 deletions

.github/workflows/generator-generic-ossf-slsa3-publish.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
# This workflow uses actions that are not certified by GitHub.
23
# They are provided by a third-party and are governed by
34
# separate terms of service, privacy policy, and support
@@ -16,14 +17,18 @@ on:
1617
release:
1718
types: [created]
1819

20+
permissions: read-all
21+
1922
jobs:
2023
build:
2124
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
2227
outputs:
2328
digests: ${{ steps.hash.outputs.digests }}
2429

2530
steps:
26-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2732

2833
# ========================================================
2934
#
@@ -60,7 +65,9 @@ jobs:
6065
actions: read # To read the workflow path.
6166
id-token: write # To sign the provenance.
6267
contents: write # To add assets to a release.
63-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.4.0
68+
# Note: SLSA generator uses version tags per their documentation
69+
# due to limitations in GitHub Actions reusable workflow verification
70+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
6471
with:
6572
base64-subjects: "${{ needs.build.outputs.digests }}"
6673
upload-assets: true # Optional: Upload to a new release
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
name: Guix/Nix Package Policy
23
on: [push, pull_request]
4+
5+
permissions: read-all
6+
37
jobs:
48
check:
59
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
612
steps:
7-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
814
- name: Enforce Guix primary / Nix fallback
915
run: |
1016
# Check for package manager files
1117
HAS_GUIX=$(find . -name "*.scm" -o -name ".guix-channel" -o -name "guix.scm" 2>/dev/null | head -1)
1218
HAS_NIX=$(find . -name "*.nix" 2>/dev/null | head -1)
13-
19+
1420
# Block new package-lock.json, yarn.lock, Gemfile.lock, etc.
1521
NEW_LOCKS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E 'package-lock\.json|yarn\.lock|Gemfile\.lock|Pipfile\.lock|poetry\.lock|cargo\.lock' || true)
1622
if [ -n "$NEW_LOCKS" ]; then
1723
echo "⚠️ Lock files detected. Prefer Guix manifests for reproducibility."
1824
fi
19-
25+
2026
# Prefer Guix, fallback to Nix
2127
if [ -n "$HAS_GUIX" ]; then
2228
echo "✅ Guix package management detected (primary)"
@@ -25,5 +31,5 @@ jobs:
2531
else
2632
echo "ℹ️ Consider adding guix.scm or flake.nix for reproducible builds"
2733
fi
28-
34+
2935
echo "✅ Package policy check passed"

.github/workflows/jekyll-gh-pages.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
23
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
34

@@ -27,16 +28,16 @@ jobs:
2728
runs-on: ubuntu-latest
2829
steps:
2930
- name: Checkout
30-
uses: actions/checkout@v4
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3132
- name: Setup Pages
32-
uses: actions/configure-pages@v5
33+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
3334
- name: Build with Jekyll
34-
uses: actions/jekyll-build-pages@v1
35+
uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1.0.13
3536
with:
3637
source: ./
3738
destination: ./_site
3839
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v3
40+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
4041

4142
# Deployment job
4243
deploy:
@@ -48,4 +49,4 @@ jobs:
4849
steps:
4950
- name: Deploy to GitHub Pages
5051
id: deployment
51-
uses: actions/deploy-pages@v4
52+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/quality.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,55 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
name: Code Quality
23
on: [push, pull_request]
34

5+
permissions: read-all
6+
47
jobs:
58
lint:
69
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
712
steps:
8-
- uses: actions/checkout@v4
9-
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
1015
- name: Check file permissions
1116
run: |
1217
find . -type f -perm /111 -name "*.sh" | head -10 || true
13-
18+
1419
- name: Check for secrets
15-
uses: trufflesecurity/trufflehog@main
20+
uses: trufflesecurity/trufflehog@05cccb53bc9e13bc6d17997db5a6bcc3df44bf2f # v3.92.3
1621
with:
1722
path: ./
1823
base: ${{ github.event.pull_request.base.sha || github.event.before }}
1924
head: ${{ github.sha }}
2025
continue-on-error: true
21-
26+
2227
- name: Check TODO/FIXME
2328
run: |
2429
echo "=== TODOs ==="
2530
grep -rn "TODO\|FIXME\|HACK\|XXX" --include="*.rs" --include="*.res" --include="*.py" --include="*.ex" . | head -20 || echo "None found"
26-
31+
2732
- name: Check for large files
2833
run: |
2934
find . -type f -size +1M -not -path "./.git/*" | head -10 || echo "No large files"
30-
35+
3136
- name: EditorConfig check
32-
uses: editorconfig-checker/action-editorconfig-checker@main
37+
uses: editorconfig-checker/action-editorconfig-checker@4b6cd6190d435e7e084fb35e36a096e98506f7b9 # v2.1.0
3338
continue-on-error: true
3439

3540
docs:
3641
runs-on: ubuntu-latest
42+
permissions:
43+
contents: read
3744
steps:
38-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3946
- name: Check documentation
4047
run: |
4148
MISSING=""
4249
[ ! -f "README.md" ] && [ ! -f "README.adoc" ] && MISSING="$MISSING README"
4350
[ ! -f "LICENSE" ] && [ ! -f "LICENSE.txt" ] && [ ! -f "LICENSE.md" ] && MISSING="$MISSING LICENSE"
4451
[ ! -f "CONTRIBUTING.md" ] && [ ! -f "CONTRIBUTING.adoc" ] && MISSING="$MISSING CONTRIBUTING"
45-
52+
4653
if [ -n "$MISSING" ]; then
4754
echo "::warning::Missing docs:$MISSING"
4855
else

.github/workflows/rsr-antipattern.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# RSR Anti-Pattern CI Check
21
# SPDX-License-Identifier: AGPL-3.0-or-later
2+
# RSR Anti-Pattern CI Check
33
#
44
# Enforces: No TypeScript, No Go, No Python (except SaltStack), No npm
55
# Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme
@@ -12,11 +12,15 @@ on:
1212
pull_request:
1313
branches: [main, master, develop]
1414

15+
permissions: read-all
16+
1517
jobs:
1618
antipattern-check:
1719
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
1822
steps:
19-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2024

2125
- name: Check for TypeScript
2226
run: |

.github/workflows/rust-ci.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,47 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
name: Rust CI
23
on: [push, pull_request]
4+
5+
permissions: read-all
6+
37
env:
48
CARGO_TERM_COLOR: always
59
RUSTFLAGS: -Dwarnings
610

711
jobs:
812
test:
913
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
1016
steps:
11-
- uses: actions/checkout@v4
12-
- uses: dtolnay/rust-toolchain@stable
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # master
1319
with:
20+
toolchain: stable
1421
components: rustfmt, clippy
15-
- uses: Swatinem/rust-cache@v2
16-
22+
- uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
23+
1724
- name: Check formatting
1825
run: cargo fmt --all -- --check
19-
26+
2027
- name: Clippy lints
2128
run: cargo clippy --all-targets --all-features -- -D warnings
22-
29+
2330
- name: Run tests
2431
run: cargo test --all-features
25-
32+
2633
- name: Build release
2734
run: cargo build --release
2835

2936
security:
3037
runs-on: ubuntu-latest
38+
permissions:
39+
contents: read
3140
steps:
32-
- uses: actions/checkout@v4
33-
- uses: dtolnay/rust-toolchain@stable
41+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
42+
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # master
43+
with:
44+
toolchain: stable
3445
- name: Install cargo-audit
3546
run: cargo install cargo-audit
3647
- name: Security audit
@@ -40,13 +51,17 @@ jobs:
4051

4152
coverage:
4253
runs-on: ubuntu-latest
54+
permissions:
55+
contents: read
4356
steps:
44-
- uses: actions/checkout@v4
45-
- uses: dtolnay/rust-toolchain@stable
57+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
- uses: dtolnay/rust-toolchain@f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 # master
59+
with:
60+
toolchain: stable
4661
- name: Install tarpaulin
4762
run: cargo install cargo-tarpaulin
4863
- name: Generate coverage
4964
run: cargo tarpaulin --out Xml
50-
- uses: codecov/codecov-action@v3
65+
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
5166
with:
5267
files: cobertura.xml

.github/workflows/rust.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
name: Rust
23

34
on:
@@ -6,16 +7,19 @@ on:
67
pull_request:
78
branches: [ "main" ]
89

10+
permissions: read-all
11+
912
env:
1013
CARGO_TERM_COLOR: always
1114

1215
jobs:
1316
build:
14-
1517
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
1620

1721
steps:
18-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1923
- name: Build
2024
run: cargo build --verbose
2125
- name: Run tests

.github/workflows/scorecard.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
name: OSSF Scorecard
23
on:
34
push:
@@ -14,17 +15,17 @@ jobs:
1415
security-events: write
1516
id-token: write
1617
steps:
17-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1819
with:
1920
persist-credentials: false
20-
21+
2122
- name: Run Scorecard
22-
uses: ossf/scorecard-action@v2.3.1
23+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
2324
with:
2425
results_file: results.sarif
2526
results_format: sarif
26-
27+
2728
- name: Upload results
28-
uses: github/codeql-action/upload-sarif@v3
29+
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.28.1
2930
with:
3031
sarif_file: results.sarif
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
12
name: Security Policy
23
on: [push, pull_request]
4+
5+
permissions: read-all
6+
37
jobs:
48
check:
59
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
612
steps:
7-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
814
- name: Security checks
915
run: |
1016
FAILED=false
11-
17+
1218
# Block MD5/SHA1 for security (allow for checksums/caching)
1319
WEAK_CRYPTO=$(grep -rE 'md5\(|sha1\(' --include="*.py" --include="*.rb" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" . 2>/dev/null | grep -v 'checksum\|cache\|test\|spec' | head -5 || true)
1420
if [ -n "$WEAK_CRYPTO" ]; then
1521
echo "⚠️ Weak crypto (MD5/SHA1) detected. Use SHA256+ for security:"
1622
echo "$WEAK_CRYPTO"
1723
fi
18-
19-
# Block HTTP URLs (except localhost)
20-
HTTP_URLS=$(grep -rE 'https://[^l][^o][^c]' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.yaml" --include="*.yml" . 2>/dev/null | grep -v 'localhost\|127.0.0.1\|example\|test\|spec' | head -5 || true)
24+
25+
# Block HTTP URLs (except localhost) - fixed: was checking https instead of http
26+
HTTP_URLS=$(grep -rE 'http://[^l][^o][^c]' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.yaml" --include="*.yml" . 2>/dev/null | grep -v 'localhost\|127.0.0.1\|example\|test\|spec' | head -5 || true)
2127
if [ -n "$HTTP_URLS" ]; then
2228
echo "⚠️ HTTP URLs found. Use HTTPS:"
2329
echo "$HTTP_URLS"
2430
fi
25-
31+
2632
# Block hardcoded secrets patterns
2733
SECRETS=$(grep -rEi '(api_key|apikey|secret_key|password)\s*[=:]\s*["\x27][A-Za-z0-9+/=]{20,}' --include="*.py" --include="*.js" --include="*.ts" --include="*.go" --include="*.rs" --include="*.env" . 2>/dev/null | grep -v 'example\|sample\|test\|mock\|placeholder' | head -3 || true)
2834
if [ -n "$SECRETS" ]; then
2935
echo "❌ Potential hardcoded secrets detected!"
3036
FAILED=true
3137
fi
32-
38+
3339
if [ "$FAILED" = true ]; then
3440
exit 1
3541
fi
36-
42+
3743
echo "✅ Security policy check passed"

0 commit comments

Comments
 (0)