ci: seal.key from the seal broker for main and v* tags only; the website's PR code off the deploy runner #2429
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2429
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:seal-broker"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Do not merge before the seal broker runs on the server (MagicBeanDev/Infra PR: MagicBeanDev/Infra#7). Once merged, release publish and the website deploy get seal.key from the broker, not from a mounted file. Without the broker they fail to unseal.
Why. This comes from the security review of #2286's CI. A label only routes a job. Anyone who can push a branch, or open a pull request (it runs its own copy of the workflows), could add a job with
runs-on: deploy, mount/magicbean-secrets, and openRELEASE_SIGNING_KEY_SEALEDor the org-widePACKAGES_TOKEN_SEALED.website.ymlalso ran a PR's ownnpm ci/npm run buildondeploywith seal.key mounted. forgejo-runner 13 has no filter by ref or event, and a workflow sets its own env, steps and container, so nothing on the runner can tell such a job from a real one.What changed.
scripts/ci_secret.sh unsealfetches seal.key from the seal broker. The job sends the ID token Forgejo signs for it (enable-openid-connect: true, audiencemagicbean-seal-broker) over HTTPS with a pinned key (SEAL_BROKER_PIN). The broker hands the key only to these runs of an allowed repository:pushto main or to av*tag;scheduleorworkflow_dispatchon main;pull_request_targetfrom main's own workflow file.release.ymlpublish: no volume;enable-openid-connecton that job only.website.yml, the PR's code is offdeploy:deploy: main only. It builds, checks and deploys ondeploy.check: a PR's build and checks, onubuntu-latest, with no secrets.preview-build:pull_request_target, for same-repo PRs or a fork PR with thepreviewlabel. It builds the PR onubuntu-latest, with no key and no ID token, and uploadsdist/.preview-upload: ondeploy. It checks out main and uploads the PR'sdist/(files only) with main's wrangler,wrangler.jsoncandworker/index.ts..forgejo/actionlint.yamlacceptsenable-openid-connect.docs/dev/reference/ci.mdandreleases.mdmatch.Read first:
scripts/ci_secret.sh, thenwebsite.yml.Companion PRs: LongshotLauncher MagicBeanDev/LongshotLauncher#267, Beanstalk MagicBeanDev/Beanstalk#146, Infra MagicBeanDev/Infra#7.
Testing
Tested: CI only; nothing the game runs changes. Not run anywhere yet: the broker isn't deployed, and no tests were run on this PC.
Still to test (once the broker is up and
SEAL_BROKER_PINis set):SHA256SUMS.sigas before (by hand).website/: the deploy job deploys (by hand).website/:check,preview-buildandpreview-uploadpass and the preview link is posted (by hand).deploythat runsscripts/ci_secret.sh unseal: refused, with the broker's reason in the log (by hand).Measurements
Nothing to measure: CI workflow and docs only.
Risks
SEAL_BROKER_PIN: nightlies and the website deploy fail at the unseal step. A revert is enough.main(no direct push) and thev*tags (a protected-tag rule). Forgejo 17'sref_protectedclaim is always false, so the broker can't check this itself.enable-openid-connectin a job that checks out PR code.check, thenpreview-build).worker/index.ts) shows in its preview only once merged.PACKAGES_TOKEN_SEALEDjob needs the same change:enable-openid-connect: true,SEAL_BROKER_PIN, and no volume.Must happen first:
SEAL_BROKER_PINis set.mainand a protected-tag rule forv*.After this merges (and the launcher's and Beanstalk's), Infra's commit 3 removes the
/magicbean-secretsmount.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (not run on this PC; CI runs it)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Possibly related, for context:
WIP: ci: seal.key from the seal broker for main and v* tags only; the website's PR code off the deploy runnerto ci: seal.key from the seal broker for main and v* tags only; the website's PR code off the deploy runner