Skip to content

Commit 7db4ebe

Browse files
committed
security: standardize secret scanning on TruffleHog
1 parent b504712 commit 7db4ebe

10 files changed

Lines changed: 22 additions & 55 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,21 @@
22
# RSR-compliant CodeQL workflow with SHA-pinned actions
33

44
name: "CodeQL"
5-
65
on:
76
push:
87
branches: ["main"]
98
pull_request:
109
branches: ["main"]
1110
schedule:
1211
- cron: '42 20 * * 0'
13-
1412
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
1513
# updates do not pile up queued runs against the shared account-wide
1614
# Actions concurrency pool. Applied only to read-only check workflows
1715
# (no publish/mutation), so cancelling a superseded run is always safe.
1816
concurrency:
1917
group: ${{ github.workflow }}-${{ github.ref }}
2018
cancel-in-progress: true
21-
22-
2319
permissions: read-all
24-
2520
jobs:
2621
analyze:
2722
name: Analyze (${{ matrix.language }})
@@ -32,7 +27,6 @@ jobs:
3227
packages: read
3328
actions: read
3429
contents: read
35-
3630
strategy:
3731
fail-fast: false
3832
matrix:
@@ -46,19 +40,16 @@ jobs:
4640
# build-mode: autobuild
4741
- language: javascript-typescript
4842
build-mode: none
49-
# - language: python
50-
# build-mode: none
51-
43+
# - language: python
44+
# build-mode: none
5245
steps:
5346
- name: Checkout repository
5447
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55-
5648
- name: Initialize CodeQL
5749
uses: github/codeql-action/init@ea9e4e37992a54ee68a9571571f9a567d8f90f78 # v3.28.0
5850
with:
5951
languages: ${{ matrix.language }}
6052
build-mode: ${{ matrix.build-mode }}
61-
6253
- name: Build (manual mode)
6354
if: matrix.build-mode == 'manual'
6455
shell: bash
@@ -67,7 +58,6 @@ jobs:
6758
# cargo build --release
6859
# mix compile
6960
exit 1
70-
7161
- name: Perform CodeQL Analysis
7262
uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9571571f9a567d8f90f78 # v3.28.0
7363
with:

.github/workflows/dependabot-automerge.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,25 @@
3535
# bumps for dependabot/fetch-metadata flow through the same path.
3636

3737
name: Dependabot Auto-Merge
38-
3938
on:
4039
pull_request:
4140
types: [opened, reopened, synchronize]
42-
4341
permissions:
44-
contents: write # needed to enable auto-merge
45-
pull-requests: write # needed to approve
42+
contents: write # needed to enable auto-merge
43+
pull-requests: write # needed to approve
4644
# NB: keep narrow — do NOT add secrets: read or id-token: write here.
47-
4845
jobs:
4946
automerge:
5047
# Only run for PRs actually authored by Dependabot.
5148
if: github.actor == 'dependabot[bot]' && github.event.pull_request.user.login == 'dependabot[bot]'
5249
runs-on: ubuntu-latest
5350
timeout-minutes: 15
54-
5551
steps:
5652
- name: Fetch Dependabot metadata
5753
id: meta
5854
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
5955
with:
6056
github-token: ${{ secrets.GITHUB_TOKEN }}
61-
6257
# --- Policy gate -------------------------------------------------------
6358
# Outputs from fetch-metadata we care about:
6459
# update-type → version-update:semver-{patch,minor,major}
@@ -107,7 +102,6 @@ jobs:
107102
echo "security=$is_security" >> "$GITHUB_OUTPUT"
108103
echo "update_type=$UPDATE_TYPE" >> "$GITHUB_OUTPUT"
109104
echo "ghsa=$GHSA_ID" >> "$GITHUB_OUTPUT"
110-
111105
- name: Approve PR (if policy allows)
112106
if: steps.policy.outputs.action == 'automerge'
113107
env:
@@ -116,15 +110,13 @@ jobs:
116110
run: |
117111
gh pr review --approve "$PR_URL" \
118112
--body "Auto-approving Dependabot security update (${{ steps.policy.outputs.ghsa }}, ${{ steps.policy.outputs.update_type }}). Policy: low/moderate security patches/minors only."
119-
120113
- name: Enable auto-merge (if policy allows)
121114
if: steps.policy.outputs.action == 'automerge'
122115
env:
123116
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124117
PR_URL: ${{ github.event.pull_request.html_url }}
125118
run: |
126119
gh pr merge --auto --squash "$PR_URL"
127-
128120
- name: Write decision to step summary
129121
env:
130122
ACTION: ${{ steps.policy.outputs.action }}

.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/scorecard-enforcer.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
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
permissions: read-all
13-
1411
jobs:
1512
scorecard:
1613
runs-on: ubuntu-latest
1714
timeout-minutes: 15
1815
permissions:
1916
security-events: write
20-
id-token: write # For OIDC
17+
id-token: write # For OIDC
2118
steps:
2219
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
2320
with:
2421
persist-credentials: false
25-
2622
- name: Run Scorecard
2723
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
2824
with:
2925
results_file: results.sarif
3026
results_format: sarif
3127
publish_results: true
32-
3328
- name: Upload SARIF
3429
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3
3530
with:
3631
sarif_file: results.sarif
37-
3832
- name: Check minimum score
3933
run: |
4034
# Parse score from results
@@ -49,21 +43,18 @@ jobs:
4943
echo "::error::Scorecard score $SCORE is below minimum $MIN_SCORE"
5044
exit 1
5145
fi
52-
5346
# Check specific high-priority items
5447
check-critical:
5548
runs-on: ubuntu-latest
5649
timeout-minutes: 15
5750
steps:
5851
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
59-
6052
- name: Check SECURITY.md exists
6153
run: |
6254
if [ ! -f "SECURITY.md" ]; then
6355
echo "::error::SECURITY.md is required"
6456
exit 1
6557
fi
66-
6758
- name: Check for pinned dependencies
6859
run: |
6960
# 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
@@ -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

0 commit comments

Comments
 (0)