Skip to content

Commit 2ac0181

Browse files
committed
security: standardize secret scanning on TruffleHog
1 parent 92094c6 commit 2ac0181

25 files changed

Lines changed: 40 additions & 330 deletions

.github/workflows/governance.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@
1111
# (rust-ci, codeql, dependabot, release, scan/mirror/pages plumbing).
1212

1313
name: Governance
14-
1514
on:
1615
push:
1716
branches: [main, master]
1817
pull_request:
1918
workflow_dispatch:
20-
2119
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
2220
# updates do not pile up queued runs against the shared account-wide
2321
# Actions concurrency pool. Applied only to read-only check workflows
2422
# (no publish/mutation), so cancelling a superseded run is always safe.
2523
concurrency:
2624
group: ${{ github.workflow }}-${{ github.ref }}
2725
cancel-in-progress: true
28-
2926
permissions:
3027
contents: read
31-
3228
jobs:
3329
governance:
3430
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@861b5e911d9e5dcfb3c0ab3dd2a9a3c8fd0a1613

.github/workflows/hypatia-scan.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# See standards#191 for the reusable's purpose and design.
44

55
name: Hypatia Security Scan
6-
76
on:
87
push:
98
branches: [main, master, develop]
@@ -12,17 +11,14 @@ on:
1211
schedule:
1312
- cron: '0 0 * * 0'
1413
workflow_dispatch:
15-
1614
# Estate guardrail: cancel superseded runs so re-pushes don't pile up.
1715
concurrency:
1816
group: ${{ github.workflow }}-${{ github.ref }}
1917
cancel-in-progress: true
20-
2118
permissions:
2219
contents: read
2320
security-events: write
2421
pull-requests: write
25-
2622
jobs:
2723
hypatia:
2824
uses: hyperpolymath/standards/.github/workflows/hypatia-scan-reusable.yml@6cd3772824e59c8c9affeab66061e25383544242

.github/workflows/instant-sync.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# Instant Forge Sync - Triggers propagation to all forges on push/release
33
name: Instant Sync
4-
54
on:
65
push:
76
branches: [main, master]
87
release:
98
types: [published]
10-
119
permissions:
1210
contents: read
13-
1411
jobs:
1512
dispatch:
1613
runs-on: ubuntu-latest
@@ -29,6 +26,5 @@ jobs:
2926
"sha": "${{ github.sha }}",
3027
"forges": ""
3128
}
32-
3329
- name: Confirm
3430
run: echo "::notice::Propagation triggered for ${{ github.event.repository.name }}"

.github/workflows/mirror.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# SPDX-License-Identifier: MPL-2.0
22
name: Mirror to Git Forges
3-
43
on:
54
push:
65
branches: [main]
76
workflow_dispatch:
8-
97
permissions:
108
contents: read
11-
129
jobs:
1310
mirror:
1411
uses: hyperpolymath/standards/.github/workflows/mirror-reusable.yml@e6b2884722350515934d443daf23442f2195796f

.github/workflows/scorecard-enforcer.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# Prevention workflow - runs OpenSSF Scorecard and fails on low scores
33
name: OpenSSF Scorecard Enforcer
4-
54
on:
65
push:
76
branches: [main]
87
schedule:
9-
- cron: '0 6 * * 1' # Weekly on Monday
8+
- cron: '0 6 * * 1' # Weekly on Monday
109
workflow_dispatch:
11-
1210
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
1311
# updates do not pile up queued runs against the shared account-wide
1412
# Actions concurrency pool. Applied only to read-only check workflows
1513
# (no publish/mutation), so cancelling a superseded run is always safe.
1614
concurrency:
1715
group: ${{ github.workflow }}-${{ github.ref }}
1816
cancel-in-progress: true
19-
2017
permissions:
2118
contents: read
22-
2319
jobs:
2420
# The OSSF Scorecard publish endpoint enforces a hard contract: the job that
2521
# runs `ossf/scorecard-action` with `publish_results: true` must contain
@@ -36,31 +32,27 @@ jobs:
3632
timeout-minutes: 15
3733
permissions:
3834
security-events: write
39-
id-token: write # For OIDC
35+
id-token: write # For OIDC
4036
steps:
4137
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4238
with:
4339
persist-credentials: false
44-
4540
- name: Run Scorecard
4641
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
4742
with:
4843
results_file: results.sarif
4944
results_format: sarif
5045
publish_results: true
51-
5246
- name: Upload SARIF
5347
uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4
5448
with:
5549
sarif_file: results.sarif
56-
5750
- name: Persist SARIF for downstream score-gate job
5851
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
5952
with:
6053
name: scorecard-results
6154
path: results.sarif
6255
retention-days: 1
63-
6456
check-score:
6557
needs: scorecard
6658
runs-on: ubuntu-latest
@@ -72,7 +64,6 @@ jobs:
7264
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v5.0.0
7365
with:
7466
name: scorecard-results
75-
7667
- name: Check minimum score
7768
run: |
7869
SCORE=$(jq -r '.runs[0].tool.driver.properties.score // 0' results.sarif 2>/dev/null || echo "0")
@@ -86,21 +77,18 @@ jobs:
8677
echo "::error::Scorecard score $SCORE is below minimum $MIN_SCORE"
8778
exit 1
8879
fi
89-
9080
# Check specific high-priority items
9181
check-critical:
9282
runs-on: ubuntu-latest
9383
timeout-minutes: 15
9484
steps:
9585
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
96-
9786
- name: Check SECURITY.md exists
9887
run: |
9988
if [ ! -f "SECURITY.md" ]; then
10089
echo "::error::SECURITY.md is required"
10190
exit 1
10291
fi
103-
10492
- name: Check for pinned dependencies
10593
run: |
10694
# Check workflows for unpinned actions
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
# SPDX-License-Identifier: MPL-2.0
22
name: Secret Scanner
3-
43
on:
54
pull_request:
65
push:
76
branches: [main]
8-
97
concurrency:
108
group: ${{ github.workflow }}-${{ github.ref }}
119
cancel-in-progress: true
12-
1310
permissions:
1411
contents: read
15-
1612
jobs:
1713
scan:
1814
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@3e4bd4c93911750727e2e4c66dff859e00079da0
1915
timeout-minutes: 10
2016
secrets: inherit
17+
trufflehog:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: TruffleHog Secret Scan
24+
uses: trufflesecurity/trufflehog@main
25+
with:
26+
extra_args: --only-verified --fail

.machine_readable/contractiles/Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ crg-badge:
7070
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
7171
*) color="lightgrey" ;; esac; \
7272
echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"
73+
74+
secret-scan-trufflehog:
75+
@command -v trufflehog >/dev/null && trufflehog filesystem . --only-verified || true

Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ crg-badge:
7070
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
7171
*) color="lightgrey" ;; esac; \
7272
echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"
73+
74+
secret-scan-trufflehog:
75+
@command -v trufflehog >/dev/null && trufflehog filesystem . --only-verified || true

netstack/.github/workflows/ci.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# SPDX-License-Identifier: MPL-2.0-or-later
22
# SPDX-FileCopyrightText: 2025 Hyperpolymath <hyperpolymath@proton.me>
33
name: CI
4-
54
on:
65
push:
76
branches: [main]
87
pull_request:
98
branches: [main]
10-
119
permissions: read-all
12-
1310
jobs:
1411
validate-configs:
1512
name: Validate Nickel Configurations
@@ -20,28 +17,24 @@ jobs:
2017
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
2118
with:
2219
submodules: recursive
23-
2420
- name: Install Nickel
2521
run: |
2622
curl -sSL https://github.com/tweag/nickel/releases/latest/download/nickel-x86_64-linux -o nickel
2723
chmod +x nickel
2824
sudo mv nickel /usr/local/bin/
29-
3025
- name: Validate configurations
3126
run: |
3227
nickel export configs/base.ncl > /dev/null
3328
nickel export configs/modules.ncl > /dev/null
3429
nickel export configs/environments.ncl > /dev/null
3530
echo "✓ All Nickel configurations valid"
36-
3731
lint-spdx:
3832
name: Validate SPDX Headers
3933
runs-on: ubuntu-latest
4034
timeout-minutes: 15
4135
steps:
4236
- name: Checkout
4337
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
44-
4538
- name: Check SPDX headers
4639
run: |
4740
missing=0
@@ -56,40 +49,34 @@ jobs:
5649
exit 1
5750
fi
5851
echo "✓ All files have SPDX headers"
59-
6052
lint-shell:
6153
name: Lint Shell Scripts
6254
runs-on: ubuntu-latest
6355
timeout-minutes: 15
6456
steps:
6557
- name: Checkout
6658
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
67-
6859
- name: Run ShellCheck
6960
run: |
7061
find . -name "*.sh" -not -path "./.git/*" -not -path "./modules/*" -exec shellcheck {} \;
71-
7262
security-scan:
7363
name: Security Scan
7464
runs-on: ubuntu-latest
7565
timeout-minutes: 15
7666
steps:
7767
- name: Checkout
7868
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
79-
8069
- name: Run Trufflehog
8170
uses: trufflesecurity/trufflehog@8a8ef8526528d8a4ff3e2c90be08e25ef8efbd9b # v3
8271
with:
8372
extra_args: --only-verified
84-
8573
check-links:
8674
name: Check Documentation Links
8775
runs-on: ubuntu-latest
8876
timeout-minutes: 15
8977
steps:
9078
- name: Checkout
9179
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
92-
9380
- name: Link Checker
9481
uses: lycheeverse/lychee-action@v2.7.0
9582
with:

netstack/.github/workflows/codeql.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
# SPDX-License-Identifier: MPL-2.0-or-later
22
name: CodeQL Security Analysis
3-
43
on:
54
push:
65
branches: [main, master]
76
pull_request:
87
branches: [main, master]
98
schedule:
109
- cron: '0 6 * * 1'
11-
12-
1310
permissions: read-all
14-
1511
jobs:
1612
analyze:
1713
runs-on: ubuntu-latest
@@ -23,16 +19,13 @@ jobs:
2319
fail-fast: false
2420
matrix:
2521
language: ['actions']
26-
2722
steps:
2823
- name: Checkout
2924
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
30-
3125
- name: Initialize CodeQL
3226
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.28.1
3327
with:
3428
languages: ${{ matrix.language }}
35-
3629
- name: Perform CodeQL Analysis
3730
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v3.28.1
3831
with:

0 commit comments

Comments
 (0)