fix(ci): keep deployment secrets out of PR-triggered runs #421
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-425-pr-ci-secret-scope"
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?
The E2E workflow triggered on
pull_request, and its job-levelenv:block resolved ten secrets (staging Stripe key, account password, TOTP seed, mail-sink credentials with an embedded app password, tenant and client ids) into the environment of every step. On that event the runner uses the workflow file from the PR head, so three separate paths executed unreviewed, attacker-authored content with those secrets in scope: the workflow file itself, npm lifecycle scripts pulled in bynpm ci, and the Playwright specs. Blast radius was anyone who can push a branch.Split by whether a run may hold credentials.
e2e.ymlkeeps the fullenv:block and now triggers only on push tomainandworkflow_dispatch, both of which run the definition frommain. A PR-time full suite is a maintainer-triggered dispatch, taken after reading the diff. The newe2e-pr.ymlis the pull_request gate: it declares onlyE2E_STAGING_BASE_URLandOIDC_ISSUER_STAGING(neither authenticates anything), installs the lockfile, installs Chromium and runs the reachability probe. It does not run the specs. Everynpm ciunder.forgejo/workflows/now passes--ignore-scripts; the only install script in the lockfile is fsevents, which is darwin-only and optional.scripts/check-workflow-secrets.shenforces all three properties so the split cannot regress silently: nopull_requesttrigger one2e.yml, no non-allowlisted secret ine2e-pr.yml, nonpm ciwithout--ignore-scripts. It runs in the Check workflow and injust check, and the Check push trigger now watches all of.forgejo/workflows/**rather than only its own file.Follow-on removals: the BUNYIP-303
hub_liveoutput existed so the suite step could skip when a PR-run soft probe caught the hub down. The PR gate no longer runs the suite, so health-check.mjs no longer writes it and the suite's skip branch is gone. The soft hub probe (BUNYIP-301) moves to the PR gate, where it still stops a staging outage from deadlocking outage-fix PRs.Two operator actions this commit cannot perform: rotate
E2E_STAGING_STRIPE_SECRET_KEY,E2E_STAGING_PASSWORDandE2E_STAGING_TOTP_SECRET(reachable from PR-controlled code for the life of the workflow), and update branch protection onmainto requiree2e-prinstead ofe2e, which no longer reports a PR status.#BUNYIP-425