Originally created by: 5dive-bot
DIVE-8014 — finishes DIVE-7963 findings [#3] and [#8] (follow-up to DIVE-7973 / [#1617]).
release-cut.yml — the v* tag now goes over SSH with a write deploy key (RELEASE_TAG_DEPLOY_KEY, a secret in the release-signing environment; the cut job now runs in that environment, main only). A tag ruleset can then bypass that deploy key and nothing else — GitHub refuses the Actions integration as a bypass actor (422). The key is staged in its own step (so the release grade's scripts never see it in their env), the host is pinned to GitHub's published ed25519 key with StrictHostKeyChecking=yes, and a final if: always() step removes it. With no key set the push falls back to github.token with a warning, so tonight's cut still runs before main adds the key; once the ruleset is active that fallback is refused and the error names the missing secret.
seal-signing-keys.yml (one-shot, delete after use) — workflow_dispatch with NO inputs, main only. Seals to SEAL_TO_KEY / SEAL_TO_KEY_ID, constants committed in the file (empty here; the job refuses to run while they are unset). Why a constant and not an input (review finding): whoever picks the public key can open the artifact, and anyone with write access can dispatch on main, including the app every agent seat pushes through, so an input would let a seat pass its own key and take both signing keys. A constant changes only through a reviewed merge to main. The other option, a required-reviewer environment on the job, was not chosen: a reviewer must be a GitHub user and the admin acts through a token, so every dispatch would wait on a click nobody on the team can make. It seals APT_SIGNING_KEY and OFFLINE_UPDATE_SIGNING_KEY (libsodium sealed box via Ubuntu's python3-nacl) and uploads only ciphertext (1-day artifact). Refuses an empty secret and a public key that is not 32 bytes. The job summary prints each key's PUBLIC fingerprint and the exact gh api -X PUT commands for step 3.
apt-repo / offline-update / docker-image — comment only: a deploy-key push DOES start workflows, so nothing may listen on push: tags: v* (checked: only publish.yml listens on tags, python-v*; no create triggers).
Checked locally: actionlint-scan clean; release_cut_{assign,bundle,guards}_unit + actionlint_scan_unit pass; sealer round-trip with a throwaway keypair decrypts both values byte-identical, fingerprints match; sealer arms 4/4 (unset key, unset key_id, 16-byte key all refused; good key round-trips); the dispatch trigger has no inputs, so a dispatch carrying another key cannot be expressed; empty-secret arm refused; stage+push block with stubbed git takes the SSH remote when the key is set and the token fallback (with its error) when not; the pinned host key verified against github.com (reached auth).
Admin steps (main): create release-signing (main only) if not yet, add the deploy key + RELEASE_TAG_DEPLOY_KEY, check gh api repos/5dive-ai/5dive/keys has no other write key, apply the tag ruleset (bypass DeployKey), merge a PR setting SEAL_TO_KEY/SEAL_TO_KEY_ID to the environment's public-key response, run the sealer, PUT, prove apt-repo + offline-update sign from the environment, then delete the repo-level copies and this one-shot workflow.
🤖 Generated with Claude Code
Ticket changed by: lodar