Skip to content

Commit bd69352

Browse files
committed
security: standardize secret scanning on TruffleHog
1 parent 3dd67de commit bd69352

61 files changed

Lines changed: 184 additions & 884 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/casket-pages.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,33 @@
11
# SPDX-License-Identifier: MPL-2.0
22
name: GitHub Pages
3-
43
on:
54
push:
65
branches: [main, master]
76
workflow_dispatch:
8-
97
permissions:
108
contents: read
119
pages: write
1210
id-token: write
13-
1411
concurrency:
1512
group: "pages"
1613
cancel-in-progress: false
17-
1814
jobs:
1915
build:
2016
runs-on: ubuntu-latest
2117
timeout-minutes: 15
2218
steps:
2319
- name: Checkout
2420
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
25-
2621
- name: Checkout casket-ssg
2722
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
2823
with:
2924
repository: hyperpolymath/casket-ssg
3025
path: .casket-ssg
31-
3226
- name: Setup GHCup
3327
uses: haskell-actions/setup@ec49483bfc012387b227434aba94f59a6ecd0900 # v2
3428
with:
3529
ghc-version: '9.8.2'
3630
cabal-version: '3.10'
37-
3831
- name: Cache Cabal
3932
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
4033
with:
@@ -43,11 +36,9 @@ jobs:
4336
~/.cabal/store
4437
.casket-ssg/dist-newstyle
4538
key: ${{ runner.os }}-casket-${{ hashFiles('.casket-ssg/casket-ssg.cabal') }}
46-
4739
- name: Build casket-ssg
4840
working-directory: .casket-ssg
4941
run: cabal build
50-
5142
- name: Prepare site source
5243
shell: bash
5344
run: |
@@ -90,21 +81,17 @@ jobs:
9081
echo "Project-specific site content can be added later under site/."
9182
} > .site-src/index.md
9283
fi
93-
9484
- name: Build site
9585
run: |
9686
mkdir -p _site
9787
cd .casket-ssg && cabal run casket-ssg -- build ../.site-src ../_site
9888
touch ../_site/.nojekyll
99-
10089
- name: Setup Pages
10190
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
102-
10391
- name: Upload artifact
10492
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
10593
with:
10694
path: '_site'
107-
10895
deploy:
10996
environment:
11097
name: github-pages

.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/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/quality-gates.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,37 @@
22
name: Quality Gates
33
permissions:
44
contents: read
5-
65
on:
76
pull_request:
87
push:
98
branches:
109
- main
11-
1210
jobs:
1311
must-gates:
1412
runs-on: ubuntu-latest
1513
timeout-minutes: 15
1614
steps:
1715
- name: Checkout
1816
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
19-
2017
- name: Install system dependencies
2118
run: |
2219
sudo apt-get update
2320
sudo apt-get install -y just gnat gprbuild ripgrep
24-
2521
- name: Run must invariants
2622
run: ./scripts/run-must-gates.sh
27-
2823
- name: Verify trust manifests
2924
run: ./scripts/trust/verify-manifest.sh
30-
3125
test-all:
3226
runs-on: ubuntu-latest
3327
timeout-minutes: 15
3428
steps:
3529
- name: Checkout
3630
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
37-
3831
- name: Install Rust toolchain
3932
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
40-
4133
- name: Install system dependencies
4234
run: |
4335
sudo apt-get update
4436
sudo apt-get install -y just gnat gprbuild
45-
4637
- name: Run unified test gate
4738
run: just test-all

.github/workflows/scorecard-enforcer.yml

Lines changed: 2 additions & 30 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,42 +32,21 @@ 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-
57-
- name: Persist SARIF for downstream score-gate job
58-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
59-
with:
60-
name: scorecard-results
61-
path: results.sarif
62-
retention-days: 1
63-
64-
check-score:
65-
needs: scorecard
66-
runs-on: ubuntu-latest
67-
permissions:
68-
contents: read
69-
steps:
70-
- name: Download SARIF from scorecard job
71-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v5.0.0
72-
with:
73-
name: scorecard-results
74-
7550
- name: Check minimum score
7651
run: |
7752
SCORE=$(jq -r '.runs[0].tool.driver.properties.score // 0' results.sarif 2>/dev/null || echo "0")
@@ -85,21 +60,18 @@ jobs:
8560
echo "::error::Scorecard score $SCORE is below minimum $MIN_SCORE"
8661
exit 1
8762
fi
88-
8963
# Check specific high-priority items
9064
check-critical:
9165
runs-on: ubuntu-latest
9266
timeout-minutes: 15
9367
steps:
9468
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
95-
9669
- name: Check SECURITY.md exists
9770
run: |
9871
if [ ! -f "SECURITY.md" ]; then
9972
echo "::error::SECURITY.md is required"
10073
exit 1
10174
fi
102-
10375
- name: Check for pinned dependencies
10476
run: |
10577
# 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

.github/workflows/workflow-linter.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# Prevention workflow - validates all workflows have proper security config
33
name: Workflow Security Linter
4-
54
on:
65
pull_request:
76
paths:
87
- '.github/workflows/**'
98
push:
109
paths:
1110
- '.github/workflows/**'
12-
1311
permissions: read-all
14-
1512
jobs:
1613
lint-workflows:
1714
runs-on: ubuntu-latest
1815
timeout-minutes: 15
1916
steps:
2017
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
21-
2218
- name: Check SPDX headers
2319
run: |
2420
errors=0
@@ -30,7 +26,6 @@ jobs:
3026
fi
3127
done
3228
exit $errors
33-
3429
- name: Check permissions declaration
3530
run: |
3631
errors=0
@@ -42,7 +37,6 @@ jobs:
4237
fi
4338
done
4439
exit $errors
45-
4640
- name: Check pinned actions
4741
run: |
4842
errors=0

.machine_readable/contractiles/Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,6 @@ crg-badge:
153153
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
154154
*) color="lightgrey" ;; esac; \
155155
echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"
156+
157+
secret-scan-trufflehog:
158+
@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
@@ -153,3 +153,6 @@ crg-badge:
153153
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
154154
*) color="lightgrey" ;; esac; \
155155
echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"
156+
157+
secret-scan-trufflehog:
158+
@command -v trufflehog >/dev/null && trufflehog filesystem . --only-verified || true

0 commit comments

Comments
 (0)