Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/actions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ workflows:
'.github/workflows/build-gossamer-gui.yml':
- 'actions/cache@v6.1.0'
- 'actions/checkout@v7.0.1'
- 'actions/setup-node@v7.1.0'
- 'actions/upload-artifact@v7.0.2'
- 'dtolnay/rust-toolchain@v1'
- 'oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6'
- 'taiki-e/install-action@v2.90.3'
'.github/workflows/ci-health-sweep.yml':
- 'actions/checkout@v7.0.1'
- 'actions/create-github-app-token@v3.3.0'
- 'step-security/harden-runner@v2.22.4'
'.github/workflows/ci.yml':
- 'actions/cache@v6.1.0'
Expand All @@ -38,6 +39,7 @@ workflows:
- 'actions/checkout@v7.0.1'
- 'github/codeql-action@v4.38.2'
'.github/workflows/credential-read-check.yml':
- 'actions/create-github-app-token@v3.3.0'
- 'step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a'
'.github/workflows/dependabot-automerge.yml':
- 'dependabot/fetch-metadata@v3.1.0'
Expand All @@ -54,6 +56,7 @@ workflows:
'.github/workflows/governance.yml':
- 'metadatastician/standards@7641c7fdb01420696b5420ab85d88f599f32f609'
'.github/workflows/hypatia-remediation-sweep.yml':
- 'actions/create-github-app-token@v3.3.0'
- 'actions/upload-artifact@v7.0.2'
- 'step-security/harden-runner@v2.22.4'
'.github/workflows/hypatia-scan.yml':
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build-gossamer-gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v7.0.1

- name: Setup Node.js
uses: actions/setup-node@v7.1.0
# Estate policy: no Node.js/npm; JS runs Bun > Deno > pnpm.
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
with:
node-version: '22'
bun-version: 1.4.4 # the release the gossamer tests were run against

- name: Run loader smoke tests
# Shell-glob picks up every *.test.mjs in test/gossamer/, so
# `bun test <dir>` picks up every *.test.mjs in test/gossamer/, so
# adding a new harness (e.g. the panel-surface
# `browser_smoke.test.mjs` added in #220) doesn't need a second
# workflow edit. Node 22's `--test` does not yet support a
# directory argument directly.
run: node --test test/gossamer/*.test.mjs
# `browser_smoke.test.mjs` added in #220) needs no second workflow
# edit. The files import `node:test`, which Bun implements.
run: bun test test/gossamer/

build-ephapax:
name: Build Ephapax toolchain (pinned)
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/ci-health-sweep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,28 @@ jobs:
api.github.com:443

- uses: actions/checkout@v7.0.1

# Short-lived installation token, replacing the long-lived
# HYPATIA_DISPATCH_PAT. Scoped to every repository the App is
# installed on (the sweep walks the whole owner).
- name: Mint sweep token (GitHub App)
id: sweep_app
uses: actions/create-github-app-token@v3.3.0
with:
app-id: ${{ secrets.HYPATIA_APP_ID }}
private-key: ${{ secrets.HYPATIA_APP_PRIVATE_KEY }}
owner: ${{ inputs.owner || 'hyperpolymath' }}
permission-actions: read # detect.sh lists workflow runs and jobs
permission-checks: read # detect.sh reads check-run annotations
permission-administration: write # allow-list PUT
permission-contents: write # fix branches
permission-pull-requests: write # PR create
permission-issues: write # issue upsert
permission-workflows: write # branches that touch .github/workflows
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

- name: Run CI-health sweep
env:
# PAT needs classic `repo` + `workflow` scope (repo admin for the
# allow-list PUT, PR create, and issue upsert). Reused from the
# existing remediation pipeline.
GH_TOKEN: ${{ secrets.HYPATIA_DISPATCH_PAT }}
GH_TOKEN: ${{ steps.sweep_app.outputs.token }}
OWNER: ${{ inputs.owner || 'hyperpolymath' }}
# Scheduled runs remediate live (owner opted into auto-remediation);
# manual dispatch defaults to dry-run for safety.
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/credential-read-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ on:
HYPATIA_SCAN_PAT:
description: Scanner credential to validate against Hypatia's three alert endpoints
required: true
HYPATIA_DISPATCH_PAT:
description: Required only when scanner_only is false
HYPATIA_APP_ID:
description: GitHub App ID; required only when scanner_only is false
required: false
HYPATIA_APP_PRIVATE_KEY:
description: GitHub App private key; required only when scanner_only is false
required: false

permissions:
Expand Down Expand Up @@ -76,12 +79,20 @@ jobs:
with:
egress-policy: block
allowed-endpoints: api.github.com:443
- name: Check dispatch identity and observation-store visibility
- name: Mint dispatch token (GitHub App)
id: app
uses: actions/create-github-app-token@v3.3.0
with:
app-id: ${{ secrets.HYPATIA_APP_ID }}
private-key: ${{ secrets.HYPATIA_APP_PRIVATE_KEY }}
owner: hyperpolymath
repositories: verisimdb-data
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
permission-contents: read
- name: Check App authentication and observation-store visibility
env:
GH_TOKEN: ${{ secrets.HYPATIA_DISPATCH_PAT }}
GH_TOKEN: ${{ steps.app.outputs.token }}
run: |
set -euo pipefail
[ -n "${GH_TOKEN:-}" ] || { echo '::error::HYPATIA_DISPATCH_PAT is missing'; exit 1; }
gh api user --silent
[ -n "${GH_TOKEN:-}" ] || { echo '::error::the GitHub App token was not minted (HYPATIA_APP_ID / HYPATIA_APP_PRIVATE_KEY)'; exit 1; }
gh api 'repos/hyperpolymath/verisimdb-data/git/ref/heads/main' --silent
echo 'Dispatch: authentication and store-ref read passed. Write, workflow, administrative and dispatch permissions were not tested.' >> "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion .github/workflows/estate-rescan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
#
# `scan` builds panic-attack and runs it over ~300 repositories' worth of
# third-party content. Until this split it ran in the same job as
# HYPATIA_DISPATCH_PAT, and `Checkout verisimdb-data` left that PAT in the
# the old write-capable PAT, and `Checkout verisimdb-data` left that PAT in the
# clone's .git/config, readable by every later step, the freshly built
# scanner included. Now `scan` holds no credential and hands its output to
# `publish` as an artifact; the two jobs that hold the PAT run no fetched
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/hypatia-remediation-sweep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,23 @@ jobs:
| sort -t'|' -k3 -nr >> "$GITHUB_STEP_SUMMARY"
fi

# Short-lived (1 h) installation token for the one repository this step
# writes to, replacing the long-lived HYPATIA_DISPATCH_PAT.
- name: Mint dispatch token (GitHub App)
id: dispatch_app
if: steps.query.outputs.target_count != '0' && steps.cfg.outputs.dry != 'true'
uses: actions/create-github-app-token@v3.3.0
with:
app-id: ${{ secrets.HYPATIA_APP_ID }}
private-key: ${{ secrets.HYPATIA_APP_PRIVATE_KEY }}
owner: hyperpolymath
repositories: gitbot-fleet
permission-contents: write # repository_dispatch needs Contents: write

- name: Dispatch findings to gitbot-fleet
if: steps.query.outputs.target_count != '0' && steps.cfg.outputs.dry != 'true'
env:
GH_TOKEN: ${{ secrets.HYPATIA_DISPATCH_PAT }}
GH_TOKEN: ${{ steps.dispatch_app.outputs.token }}
OWNER: ${{ steps.cfg.outputs.owner }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
Expand Down
11 changes: 7 additions & 4 deletions docs/operations/credential-roles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
alerts and Secret scanning alerts access for the intended repository selection.
Metadata read is automatic; no write or account permissions are needed for
these reads. The remediation sweep's query uses this
credential. Its later repository-dispatch step still uses
`HYPATIA_DISPATCH_PAT`; the two values are not fallbacks for one another.
credential. Its later repository-dispatch step uses a short-lived GitHub App
installation token minted from `HYPATIA_APP_ID` and `HYPATIA_APP_PRIVATE_KEY`
(Contents: write on `gitbot-fleet` only; the App must be installed on both
`gitbot-fleet` and `verisimdb-data`, the latter for the credential read check); the PAT and the App are not
fallbacks for one another. `HYPATIA_DISPATCH_PAT` has been retired.

Run the manual `Credential read check` workflow after replacing either secret.
Its separate jobs check authentication and specific read endpoints without
Expand Down Expand Up @@ -36,7 +39,7 @@ an operator. Pin the reusable to a reviewed full commit SHA and pass only
`scanner_only: true`; the dispatch job is skipped and its secret is optional.
Manual runs default to checking both roles, with a `scanner_only` checkbox
for scanner-only validation. A caller that explicitly checks dispatch must
also pass `HYPATIA_DISPATCH_PAT`.
also pass `HYPATIA_APP_ID` and `HYPATIA_APP_PRIVATE_KEY`.

The API targets remain fixed: Hypatia's three alert endpoints and, only for
dispatch validation, the observation-store main ref. A successful call from
Expand All @@ -58,7 +61,7 @@ observation publication requires a qualified receipt in addition to access.

`estate-rescan.yml` uses `VERISIMDB_DATA_PUBLISH_PAT` only in its preflight
and publication jobs. The scanner job has no publisher credential. There is
no fallback to `HYPATIA_DISPATCH_PAT` or `HYPATIA_SCAN_PAT`.
no fallback to the GitHub App credentials or `HYPATIA_SCAN_PAT`.

Provision a fine-grained token with resource owner `hyperpolymath`, only
`verisimdb-data` selected, Contents read/write and Pull requests read/write;
Expand Down
4 changes: 2 additions & 2 deletions docs/operations/standards-move-estate-rollout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ checks out the current one (#1004).
cannot run from CI. After replacing either secret, run
`credential-read-check.yml` to authenticate the scanner and dispatch
credentials separately. A remediation-sweep `dry_run: true` now reads
`HYPATIA_SCAN_PAT` and skips dispatch; it cannot validate a rotated
`HYPATIA_DISPATCH_PAT`. The credential read check proves only the reads
`HYPATIA_SCAN_PAT` and skips dispatch; it cannot validate the
App credentials. The credential read check proves only the reads
named in its summary. Validate the intended write/dispatch operation and
its egress policy separately before claiming rotation complete. See
xref:credential-roles.adoc[credential roles and validation limits].
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki-pages/Operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The supervision tree starts Bandit on port 9090 (9099 under `MIX_ENV=test`):

| Variable | Purpose |
|---|---|
| `HYPATIA_DISPATCH_PAT` | GitHub PAT with `repo` scope for cross-repo dispatch |
| `HYPATIA_DISPATCH_PAT` | Optional local-run token for `mix hypatia.*` tasks. The remediation, ci-health and credential-check workflows no longer use it: they mint GitHub App tokens from `HYPATIA_APP_ID` / `HYPATIA_APP_PRIVATE_KEY`. The Phase 2 resync fragment (`scripts/sweeps/phase2-canonical.fragment.yml`) still needs it in consuming repos |
| `HYPATIA_HTTP_PORT` | Override the Bandit listen port (default 9090) |
| `HYPATIA_VERISIM_URL` | verisim-api base URL. No default: unset or blank turns off prover hints, strategy-shift detection and recommender retraining |
| `HYPATIA_ECHIDNABOT_URL` | echidnabot base URL (`/graphql` is appended). No default: unset or blank means strategy-shift re-queues are logged and dropped |
Expand Down
6 changes: 3 additions & 3 deletions hypatia_chora.deed
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
(job
:workflow ".github/workflows/ci-health-sweep.yml"
:job "sweep"
:secrets ("HYPATIA_DISPATCH_PAT")
:secrets ("HYPATIA_APP_ID" "HYPATIA_APP_PRIVATE_KEY")
:endpoints ("github.com:443" "api.github.com:443")
:enforcement harden-runner-block
:reason "Checks out this repo, then every call in scripts/ci-health/ is gh against the GitHub API.")
Expand All @@ -190,7 +190,7 @@
(job
:workflow ".github/workflows/hypatia-remediation-sweep.yml"
:job "sweep"
:secrets ("HYPATIA_SCAN_PAT" "HYPATIA_DISPATCH_PAT")
:secrets ("HYPATIA_SCAN_PAT" "HYPATIA_APP_ID" "HYPATIA_APP_PRIVATE_KEY")
:endpoints ("api.github.com:443" "results-receiver.actions.githubusercontent.com:443" "*.blob.core.windows.net:443")
:enforcement harden-runner-block
:reason "Reads vulnerability alerts with the read-only scanner credential, sends repository dispatches with the separate dispatch credential, then uploads the target list as an artifact.")
Expand All @@ -204,7 +204,7 @@
(job
:workflow ".github/workflows/credential-read-check.yml"
:job "dispatch"
:secrets ("HYPATIA_DISPATCH_PAT")
:secrets ("HYPATIA_APP_ID" "HYPATIA_APP_PRIVATE_KEY")
:endpoints ("api.github.com:443")
:enforcement harden-runner-block
:reason "Checks token identity and reads the observation-store main ref; does not validate dispatch or write permissions.")
Expand Down
6 changes: 4 additions & 2 deletions scripts/ci-health/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ from the conclusion alone.

== Operating notes / off-switch

* Needs `secrets.HYPATIA_DISPATCH_PAT` (classic `repo` + `workflow` scope — repo
admin for the allow-list PUT, PR create, issue upsert).
* Needs the GitHub App secrets `HYPATIA_APP_ID` and `HYPATIA_APP_PRIVATE_KEY`.
The workflow mints a short-lived installation token with Administration,
Contents, Pull requests, Issues and Workflows write, plus Actions and Checks read (allow-list PUT, PR
create, issue upsert). See `docs/operations/credential-roles.adoc`.
* Scheduled runs remediate **live**; manual `workflow_dispatch` defaults to
**dry-run**. To pause auto-remediation, set the schedule run to dry-run or
disable the workflow.
Expand Down
Loading