From a5a26a284340de2199c10a3e79dde8d910f5f215 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 20:37:55 +0000 Subject: [PATCH 1/2] fix(ci): boj-build passes context through env and posts only over https boj-build.yml wrote ${{ github.repository }} and ${{ github.ref_name }} straight into run:, which allows shell injection, and POSTed in clear text to http://boj-server.local:7700. A GitHub-hosted runner can never resolve that mDNS name, so the step always failed silently under continue-on-error. This is the fix already merged in chora-registry#116, and the form standards' own boj-build.yml uses: - context goes through env:, the body is built with jq --arg; - the URL comes from the BOJ_SERVER_URL secret or variable, the job does nothing without one, and curl runs with --proto '=https' (an http URL skips with a warning); - concurrency group, persist-credentials: false, and a warning in place of continue-on-error; the duplicated actions-lock header lines go. The uses: line is unchanged, so actions.lock needs no refresh. Verification: shellcheck passes on the run script. It exits 0, with the reason logged, for an unset URL, an http URL and an unreachable https URL. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC --- .github/workflows/boj-build.yml | 59 +++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 7 deletions(-) diff --git a/.github/workflows/boj-build.yml b/.github/workflows/boj-build.yml index deaa98e..5793bda 100644 --- a/.github/workflows/boj-build.yml +++ b/.github/workflows/boj-build.yml @@ -1,25 +1,70 @@ # This workflow is managed by gh actions-lock. # SPDX-License-Identifier: MPL-2.0 -# This workflow is managed by gh actions-lock. -# This workflow is managed by gh actions-lock. +# +# OPTIONAL: BoJ Server Build Trigger. +# Notifies a BoJ server that this repository was pushed, so its Casket +# (ssg-mcp) cartridge rebuilds the site. The endpoint comes from the +# BOJ_SERVER_URL secret or variable and must be https; the job is a no-op +# when it is unset, and a non-fatal skip when the server is unreachable. +# It used to POST in clear text to a hard-coded boj-server.local:7700, an +# mDNS name a GitHub-hosted runner cannot resolve, so the step always failed, +# and it wrote the GitHub context straight into the script text. +# This is the form standards' and chora-registry's boj-build.yml use. name: BoJ Server Build Trigger + on: push: branches: [main, master] workflow_dispatch: + +# Cancel superseded runs; the job only sends a notification. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read + jobs: trigger-boj: + name: Trigger BoJ server runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 5 steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Trigger BoJ Server (Casket/ssg-mcp) + # GitHub context goes through env, never into the script text. + env: + BOJ_URL: ${{ secrets.BOJ_SERVER_URL || vars.BOJ_SERVER_URL }} + REPO_NAME: ${{ github.repository }} + BRANCH_NAME: ${{ github.ref_name }} run: | - # Send a secure trigger to boj-server to build this repository - curl -X POST "http://boj-server.local:7700/cartridges/ssg-mcp/invoke" \ + set -euo pipefail + + if [ -z "${BOJ_URL:-}" ]; then + echo "BOJ_SERVER_URL not configured - skipping" + exit 0 + fi + case "$BOJ_URL" in + https://*) ;; + *) + echo "::warning::BOJ_SERVER_URL is not an https URL - skipping (estate rule: HTTPS only)" + exit 0 + ;; + esac + + payload="$(jq -cn \ + --arg repo "$REPO_NAME" \ + --arg branch "$BRANCH_NAME" \ + --arg engine "casket" \ + '{repo: $repo, branch: $branch, engine: $engine}')" + + curl -sSf --proto '=https' --max-time 60 -X POST \ + "${BOJ_URL%/}/cartridges/ssg-mcp/invoke" \ -H "Content-Type: application/json" \ - -d "{\"repo\": \"${{ github.repository }}\", \"branch\": \"${{ github.ref_name }}\", \"engine\": \"casket\"}" - continue-on-error: true + --data "$payload" \ + || echo "::warning::BoJ server unreachable - skipping (non-fatal)" From fb511c715817bd21e71f79b8508d5c7538db8f5b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 20:52:21 +0000 Subject: [PATCH 2/2] deed(egress): declare boj-build's trigger-boj job (standards ADR-009) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hypatia RE001 on #299: the reworked trigger-boj job now reads secrets.BOJ_SERVER_URL, and it neither installs harden-runner nor appears in an egress declaration. The repo deed now carries one top-level (egress …) clause for it: - :secrets ("BOJ_SERVER_URL"), the only secret the job references; - :endpoints, the URL held in that secret or in the variable of the same name; - :enforcement none, which is the true answer: nothing holds the job to that host at run time; the workflow refuses any URL that is not https. A declaration, not a new `uses:`, so actions.lock is unchanged. Verification: deed_lint passes on panic-attack_chora.deed, and so does deed_lint --egress (1 egress job). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZoBy5xGnGDLk7wQ8jC --- panic-attack_chora.deed | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/panic-attack_chora.deed b/panic-attack_chora.deed index 91175dc..14d84ea 100644 --- a/panic-attack_chora.deed +++ b/panic-attack_chora.deed @@ -147,4 +147,16 @@ :note "T0 syntax heuristics are labelled T0. A finding is never dressed up as a parser or dataflow proof; see docs/RECON-AND-EVIDENCE.adoc") (obligation :name "no-self-suppression" - :note "suppressions live in a separate registry file (audits/assail-classifications_praxis.deed) so one hand cannot both add a defect and hide it")) + :note "suppressions live in a separate registry file (audits/assail-classifications_praxis.deed) so one hand cannot both add a defect and hide it") + ; Declared egress for secret-bearing jobs (standards ADR-009; Hypatia RE001). + ; trigger-boj POSTs to the BoJ server named by BOJ_SERVER_URL (a secret or a + ; variable), over https only; nothing holds it to that host at run time. + (egress + :policy "standards ADR-009" + (job + :workflow ".github/workflows/boj-build.yml" + :job "trigger-boj" + :secrets ("BOJ_SERVER_URL") + :endpoints ("secret:BOJ_SERVER_URL" "var:BOJ_SERVER_URL") + :enforcement none + :reason "optional build notification; the URL is configuration, held as a secret or a variable")))