Skip to content

Commit b850188

Browse files
committed
ci: harden workflows per Hypatia security-scan findings
Address the actionable, in-scope items from the advisory Hypatia scan by mirroring the canonical estate templates from sibling repos (ochrance-framework / valence-shell): - Add codeql.yml (mirrors ochrance-framework: javascript-typescript, build-mode none; SHA-pinned actions). Analyses the repo's committed JS (tools/banner/build-banner.mjs); distinct SARIF category from the advisory Hypatia scan. - Add secret-scanner.yml (calls the estate secret-scanner-reusable, SHA-pinned). - governance.yml: pin the governance-reusable workflow to a SHA instead of @main (matches mirror.yml / scorecard.yml and the sibling repos' pin), closing the unpinned-action finding. - agda.yml (check, cold-check) and hypatia-scan.yml (scan): add timeout-minutes to the real-step jobs, bounding runaway jobs below the 6-hour default. Deliberately NOT changed (documented in the PR): - timeout-minutes is NOT added to governance.yml / mirror.yml / scorecard.yml — those are reusable-workflow callers, where job-level timeout-minutes is invalid YAML; the timeout belongs in the reusable workflow (hyperpolymath/standards). - No synthetic test directory for the "no tests" finding — the Agda proof suite (All.agda / Smoke.agda / characteristic / examples, typechecked in agda.yml) is the verification suite. The Hypatia scan is advisory (non-gating) per hypatia-scan.yml. https://claude.ai/code/session_01Jxr3Wy4ngpkbc2QwjEam82
1 parent 0e41e98 commit b850188

5 files changed

Lines changed: 84 additions & 1 deletion

File tree

.github/workflows/agda.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ permissions: read-all
2727
jobs:
2828
check:
2929
runs-on: ubuntu-latest
30+
# Bound the job so a hung typecheck/clone cannot occupy a runner for
31+
# the 6-hour default. Generous upper bound — the warm suite is a few
32+
# minutes; a cold stdlib+suite build is well under this.
33+
timeout-minutes: 30
3034
steps:
3135
- name: Checkout
3236
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -148,6 +152,9 @@ jobs:
148152
# given the documented WSL git-object-corruption risk). Runs in
149153
# parallel with `check`; both must pass.
150154
runs-on: ubuntu-latest
155+
# Cold (--ignore-interfaces) build is the slowest path; still well
156+
# under this bound. Caps a runaway/hung job below the 6-hour default.
157+
timeout-minutes: 30
151158
steps:
152159
- name: Checkout
153160
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/codeql.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
name: CodeQL Security Analysis
3+
4+
on:
5+
push:
6+
branches: [main, master]
7+
pull_request:
8+
branches: [main, master]
9+
schedule:
10+
- cron: '0 6 * * 1'
11+
12+
# Estate guardrail: cancel superseded runs so re-pushes / rebased PR
13+
# updates do not pile up queued runs against the shared account-wide
14+
# Actions concurrency pool. Applied only to read-only check workflows
15+
# (no publish/mutation), so cancelling a superseded run is always safe.
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
analyze:
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 30
27+
permissions:
28+
contents: read
29+
security-events: write
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
- language: javascript-typescript
35+
build-mode: none
36+
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
40+
41+
- name: Initialize CodeQL
42+
uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
43+
with:
44+
languages: ${{ matrix.language }}
45+
build-mode: ${{ matrix.build-mode }}
46+
47+
- name: Perform CodeQL Analysis
48+
uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v3
49+
with:
50+
category: "/language:${{ matrix.language }}"

.github/workflows/governance.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ permissions:
3030

3131
jobs:
3232
governance:
33-
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@main
33+
# Pinned to a SHA (not @main) per the estate supply-chain policy —
34+
# matches the sibling repos' pin (e.g. ochrance-framework). Bump
35+
# deliberately, never float: an unpinned reusable workflow is an
36+
# unpinned trust boundary. mirror.yml / scorecard.yml already pin.
37+
uses: hyperpolymath/standards/.github/workflows/governance-reusable.yml@861b5e911d9e5dcfb3c0ab3dd2a9a3c8fd0a1613

.github/workflows/hypatia-scan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
scan:
4444
name: Hypatia Neurosymbolic Analysis
4545
runs-on: ubuntu-latest
46+
# Bound the job: clone + Elixir build + scan is minutes, not hours.
47+
# Caps a hung clone/build below the 6-hour default.
48+
timeout-minutes: 20
4649

4750
steps:
4851
- name: Checkout repository
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
name: Secret Scanner
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
scan:
18+
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@3e4bd4c93911750727e2e4c66dff859e00079da0
19+
secrets: inherit

0 commit comments

Comments
 (0)