Skip to content

Commit 7641eda

Browse files
committed
security: standardize secret scanning on TruffleHog
1 parent e04f391 commit 7641eda

10 files changed

Lines changed: 23 additions & 178 deletions

File tree

.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/ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
name: CI
33
permissions:
44
contents: read
5-
65
on:
76
push:
87
branches: [main]
98
pull_request:
109
branches: [main]
11-
1210
concurrency:
1311
group: ${{ github.workflow }}-${{ github.ref }}
1412
cancel-in-progress: true
15-
1613
jobs:
1714
test:
1815
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }}
@@ -26,15 +23,11 @@ jobs:
2623
include:
2724
- julia-version: '1.11'
2825
os: macos-latest
29-
3026
steps:
3127
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
32-
3328
- uses: julia-actions/setup-julia@4c0cb0fce8556fdb04a90347310e5db8b1f98fb9 # v2
3429
with:
3530
version: ${{ matrix.julia-version }}
36-
3731
- uses: julia-actions/cache@e33b4bfa0ea7cd9caedd7cb82b0e36956ef40285 # v2
38-
3932
- name: Install, build, test
4033
run: julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test()'

.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: 10 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,43 @@
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]
109
pull_request:
1110
branches: [main, master]
1211
schedule:
13-
- cron: '0 0 * * 0'
12+
- cron: '0 0 * * 0' # Weekly on Sunday
1413
workflow_dispatch:
1514

1615
# Estate guardrail: cancel superseded runs so re-pushes don't pile up.
1716
concurrency:
1817
group: ${{ github.workflow }}-${{ github.ref }}
1918
cancel-in-progress: true
20-
2119
permissions:
2220
contents: read
2321
security-events: write
2422
pull-requests: write
25-
2623
jobs:
2724
scan:
2825
name: Hypatia Neurosymbolic Analysis
2926
runs-on: ubuntu-latest
3027
timeout-minutes: 15
31-
3228
steps:
3329
- name: Checkout repository
3430
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3531
with:
36-
fetch-depth: 0 # Full history for better pattern analysis
37-
32+
fetch-depth: 0 # Full history for better pattern analysis
3833
- name: Setup Elixir for Hypatia scanner
3934
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.18.2
4035
with:
4136
elixir-version: '1.18'
4237
otp-version: '27'
43-
4438
- name: Clone Hypatia
4539
run: |
4640
if [ ! -d "$HOME/hypatia" ]; then
4741
git clone https://github.com/hyperpolymath/hypatia.git "$HOME/hypatia"
4842
fi
49-
5043
- name: Build Hypatia scanner (if needed)
5144
run: |
5245
cd "$HOME/hypatia"
@@ -55,7 +48,6 @@ jobs:
5548
mix deps.get
5649
mix escript.build
5750
fi
58-
5951
- name: Run Hypatia scan
6052
id: scan
6153
env:
@@ -88,14 +80,12 @@ jobs:
8880
echo "- Critical: $CRITICAL" >> $GITHUB_STEP_SUMMARY
8981
echo "- High: $HIGH" >> $GITHUB_STEP_SUMMARY
9082
echo "- Medium: $MEDIUM" >> $GITHUB_STEP_SUMMARY
91-
9283
- name: Upload findings artifact
9384
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
9485
with:
9586
name: hypatia-findings
9687
path: hypatia-findings.json
9788
retention-days: 90
98-
9989
- name: Convert Hypatia findings to SARIF
10090
# Always runs (no findings_count guard): an EMPTY SARIF run is
10191
# valid and intentional — uploading it clears stale Hypatia
@@ -211,7 +201,6 @@ jobs:
211201
console.log(`hypatia.sarif written: ${results.length} result(s).`);
212202
CJS
213203
node "$RUNNER_TEMP/hypatia-sarif.cjs"
214-
215204
- name: Upload SARIF to GitHub code scanning
216205
# Fork PRs get a read-only GITHUB_TOKEN, so security-events:write
217206
# is unavailable and upload-sarif cannot publish — skip there
@@ -223,16 +212,19 @@ jobs:
223212
# exists to end). The empty-SARIF "clear stale alerts" path is
224213
# handled in the converter above and does not error here.
225214
if: >-
226-
always() &&
227-
(github.event_name != 'pull_request' ||
215+
always() && (github.event_name != 'pull_request' ||
216+
217+
218+
219+
220+
228221
github.event.pull_request.head.repo.fork != true)
229222
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v3.28.1
230223
with:
231224
sarif_file: hypatia.sarif
232225
# Distinct category so Hypatia results coexist with CodeQL's
233226
# (codeql.yml) instead of overwriting them on the same surface.
234227
category: hypatia
235-
236228
- name: Submit findings to gitbot-fleet (Phase 2)
237229
if: steps.scan.outputs.findings_count > 0
238230
# Phase 2 is the collaborative LEARNING side-channel ("bots share
@@ -256,52 +248,7 @@ jobs:
256248
GITHUB_REPOSITORY: ${{ github.repository }}
257249
GITHUB_SHA: ${{ github.sha }}
258250
FINDINGS_COUNT: ${{ steps.scan.outputs.findings_count }}
259-
run: |
260-
echo "📤 Submitting $FINDINGS_COUNT findings to gitbot-fleet..."
261-
262-
# Clone gitbot-fleet to temp directory. A clone failure (network,
263-
# repo gone) is non-fatal: learning submission is best-effort.
264-
FLEET_DIR="/tmp/gitbot-fleet-$$"
265-
if ! git clone --depth 1 https://github.com/hyperpolymath/gitbot-fleet.git "$FLEET_DIR"; then
266-
echo "::warning::Could not clone gitbot-fleet — skipping Phase 2 learning submission (non-fatal)."
267-
exit 0
268-
fi
269-
270-
# The submission script's location in gitbot-fleet has drifted
271-
# before (it was absent from the default branch, which exit-127'd
272-
# every consuming repo's scan). Probe known locations rather than
273-
# hard-coding one path, and skip gracefully if none is present.
274-
SUBMIT_SCRIPT=""
275-
for cand in \
276-
"$FLEET_DIR/scripts/submit-finding.sh" \
277-
"$FLEET_DIR/scripts/submit_finding.sh" \
278-
"$FLEET_DIR/bin/submit-finding.sh" \
279-
"$FLEET_DIR/submit-finding.sh"; do
280-
if [ -f "$cand" ]; then
281-
SUBMIT_SCRIPT="$cand"
282-
break
283-
fi
284-
done
285-
286-
if [ -z "$SUBMIT_SCRIPT" ]; then
287-
echo "::warning::gitbot-fleet submit-finding script not found at any known path — skipping Phase 2 learning submission (non-fatal). Findings are still uploaded as an artifact and gated below."
288-
rm -rf "$FLEET_DIR"
289-
exit 0
290-
fi
291-
292-
# Run submission script. Pass the findings path as ABSOLUTE —
293-
# the script cd's into its own working dir before reading the
294-
# file, so a relative path would resolve to the wrong place.
295-
# A submission-script failure is logged but non-fatal.
296-
if bash "$SUBMIT_SCRIPT" "$GITHUB_WORKSPACE/hypatia-findings.json"; then
297-
echo "✅ Finding submission complete"
298-
else
299-
echo "::warning::gitbot-fleet submission script exited non-zero — Phase 2 learning submission skipped (non-fatal)."
300-
fi
301-
302-
# Cleanup
303-
rm -rf "$FLEET_DIR"
304-
251+
run: "echo \"\U0001F4E4 Submitting $FINDINGS_COUNT findings to gitbot-fleet...\"\n\n# Clone gitbot-fleet to temp directory. A clone failure (network,\n# repo gone) is non-fatal: learning submission is best-effort.\nFLEET_DIR=\"/tmp/gitbot-fleet-$$\"\nif ! git clone --depth 1 https://github.com/hyperpolymath/gitbot-fleet.git \"$FLEET_DIR\"; then\n echo \"::warning::Could not clone gitbot-fleet — skipping Phase 2 learning submission (non-fatal).\"\n exit 0\nfi\n\n# The submission script's location in gitbot-fleet has drifted\n# before (it was absent from the default branch, which exit-127'd\n# every consuming repo's scan). Probe known locations rather than\n# hard-coding one path, and skip gracefully if none is present.\nSUBMIT_SCRIPT=\"\"\nfor cand in \\\n \"$FLEET_DIR/scripts/submit-finding.sh\" \\\n \"$FLEET_DIR/scripts/submit_finding.sh\" \\\n \"$FLEET_DIR/bin/submit-finding.sh\" \\\n \"$FLEET_DIR/submit-finding.sh\"; do\n if [ -f \"$cand\" ]; then\n SUBMIT_SCRIPT=\"$cand\"\n break\n fi\ndone\n\nif [ -z \"$SUBMIT_SCRIPT\" ]; then\n echo \"::warning::gitbot-fleet submit-finding script not found at any known path — skipping Phase 2 learning submission (non-fatal). Findings are still uploaded as an artifact and gated below.\"\n rm -rf \"$FLEET_DIR\"\n exit 0\nfi\n\n# Run submission script. Pass the findings path as ABSOLUTE —\n# the script cd's into its own working dir before reading the\n# file, so a relative path would resolve to the wrong place.\n# A submission-script failure is logged but non-fatal.\nif bash \"$SUBMIT_SCRIPT\" \"$GITHUB_WORKSPACE/hypatia-findings.json\"; then\n echo \"✅ Finding submission complete\"\nelse\n echo \"::warning::gitbot-fleet submission script exited non-zero — Phase 2 learning submission skipped (non-fatal).\"\nfi\n\n# Cleanup\nrm -rf \"$FLEET_DIR\"\n"
305252
- name: Check for critical issues
306253
if: steps.scan.outputs.critical > 0
307254
# GATING POLICY (explicit, by design — not an oversight):
@@ -319,7 +266,6 @@ jobs:
319266
echo "::warning::Hypatia found critical security issue(s) — advisory."
320267
echo "See the Security → Code scanning page (category: hypatia)"
321268
echo "and the hypatia-findings.json artifact for details."
322-
323269
- name: Generate scan report
324270
run: |
325271
cat << EOF > hypatia-report.md
@@ -358,7 +304,6 @@ jobs:
358304
EOF
359305
360306
cat hypatia-report.md >> $GITHUB_STEP_SUMMARY
361-
362307
- name: Comment on PR with findings
363308
if: github.event_name == 'pull_request' && steps.scan.outputs.findings_count > 0
364309
# Advisory only — posting findings as a PR comment must never gate
@@ -368,32 +313,4 @@ jobs:
368313
continue-on-error: true
369314
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v7
370315
with:
371-
script: |
372-
const fs = require('fs');
373-
const findings = JSON.parse(fs.readFileSync('hypatia-findings.json', 'utf8'));
374-
375-
const critical = findings.filter(f => f.severity === 'critical').length;
376-
const high = findings.filter(f => f.severity === 'high').length;
377-
378-
let comment = `## 🔍 Hypatia Security Scan\n\n`;
379-
comment += `**Findings:** ${findings.length} issues detected\n\n`;
380-
comment += `| Severity | Count |\n|----------|-------|\n`;
381-
comment += `| 🔴 Critical | ${critical} |\n`;
382-
comment += `| 🟠 High | ${high} |\n`;
383-
comment += `| 🟡 Medium | ${findings.length - critical - high} |\n\n`;
384-
385-
if (critical > 0) {
386-
comment += `⚠️ **Action Required:** Critical security issues found!\n\n`;
387-
}
388-
389-
comment += `<details><summary>View findings</summary>\n\n`;
390-
comment += `\`\`\`json\n${JSON.stringify(findings.slice(0, 10), null, 2)}\n\`\`\`\n`;
391-
comment += `</details>\n\n`;
392-
comment += `*Powered by Hypatia Neurosymbolic CI/CD Intelligence*`;
393-
394-
github.rest.issues.createComment({
395-
owner: context.repo.owner,
396-
repo: context.repo.repo,
397-
issue_number: context.issue.number,
398-
body: comment
399-
});
316+
script: "const fs = require('fs');\nconst findings = JSON.parse(fs.readFileSync('hypatia-findings.json', 'utf8'));\n\nconst critical = findings.filter(f => f.severity === 'critical').length;\nconst high = findings.filter(f => f.severity === 'high').length;\n\nlet comment = `## \U0001F50D Hypatia Security Scan\\n\\n`;\ncomment += `**Findings:** ${findings.length} issues detected\\n\\n`;\ncomment += `| Severity | Count |\\n|----------|-------|\\n`;\ncomment += `| \U0001F534 Critical | ${critical} |\\n`;\ncomment += `| \U0001F7E0 High | ${high} |\\n`;\ncomment += `| \U0001F7E1 Medium | ${findings.length - critical - high} |\\n\\n`;\n\nif (critical > 0) {\n comment += `⚠️ **Action Required:** Critical security issues found!\\n\\n`;\n}\n\ncomment += `<details><summary>View findings</summary>\\n\\n`;\ncomment += `\\`\\`\\`json\\n${JSON.stringify(findings.slice(0, 10), null, 2)}\\n\\`\\`\\`\\n`;\ncomment += `</details>\\n\\n`;\ncomment += `*Powered by Hypatia Neurosymbolic CI/CD Intelligence*`;\n\ngithub.rest.issues.createComment({\n owner: context.repo.owner,\n repo: context.repo.repo,\n issue_number: context.issue.number,\n body: comment\n});"

.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 }}"

0 commit comments

Comments
 (0)