Skip to content

ci(deploy): pin deploy key to a forced command; self-update runs the new setup.sh - #163

Merged
sh1pt-actions-fleet[bot] merged 1 commit into
mainfrom
ci-deploy-forced-command
Nov 2, 2026
Merged

sh1pt-actions-fleet[bot] merged 1 commit into
mainfrom
ci-deploy-forced-command

Conversation

@sh1pt-actions-fleet

Copy link
Copy Markdown
Contributor

Deploy-on-merge has failed with Permission denied (publickey) since the post-incident root key cleanup. This replaces the old unrestricted key with a fresh ed25519 key pinned to one forced command.

Box (already done, by hand): /usr/local/sbin/agentbbs-ci-deploy installed from this branch's deploy/ci-deploy.sh; root authorized_keys line restrict,command="/usr/local/sbin/agentbbs-ci-deploy" ssh-ed25519 ... github-actions-deploy@agentbbs-2026-11-02 (backup authorized_keys.bak-cideploy-20261102).

Changes

  • deploy/ci-deploy.sh: verbs arch, upload agentbbs|ascii-live (ELF from stdin, 256 MiB cap, root-only staging dir /var/lib/agentbbs-deploy), deploy main|master (app secrets on stdin as NAME=<base64>, allowlisted). Same steps as the old inline heredoc. Nothing from the command line is evaluated by a shell.
  • .github/workflows/deploy.yml: uses those verbs instead of scp + sudo -n env ... bash -s (with restrict neither would work, and bash -s would have made the forced command pointless).
  • setup.sh §7c installs the forced command so it stays in sync with the workflow.
  • scripts/self-update.sh: git reset --hard origin/<branch> before exec'ing setup.sh, so the NEW setup.sh runs (it used to run the previous commit's copy, so setup.sh changes needed two timer runs).

Verified with the new key from dev2: id, empty command, deploy main;id, deploy evil, non-ELF upload, upload ../../etc/passwd all refused; scp/sftp closed; -L forwarding "administratively prohibited". A full arch / upload x2 / deploy main run with runner-equivalent binaries succeeded; bbs.profullstack.com / and /manifest.webmanifest 200, :22 serves agentbbs, :2202 admin login still works.

Needs: the DEPLOY_SSH_KEY secret updated to the new private key (the GitHub App token cannot write Actions secrets).

🤖 Generated with Claude Code

…s the new setup.sh

The 10-27 incident showed what an unrestricted root deploy key is worth to an
attacker. The CI key is now installed on the box as
restrict,command="/usr/local/sbin/agentbbs-ci-deploy", so it gets no shell,
scp, sftp, pty or forwarding.

- deploy/ci-deploy.sh (installed by setup.sh): verbs `arch`, `upload
  agentbbs|ascii-live` (ELF on stdin, size-capped, root-only staging dir) and
  `deploy main|master` (app secrets as NAME=<base64> on stdin, allowlisted).
  It does what the old inline heredoc did: sync to origin, pause the
  self-update timer, install binaries, exec setup.sh SKIP_BUILD=1.
- deploy.yml: uses those verbs instead of scp + `sudo bash -s`.
- self-update.sh: reset to origin before exec'ing setup.sh, so a setup.sh
  change takes effect on the first timer run instead of the second.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

10 finding(s)

HIGH/CRITICAL: 7 | LOW: 3

Severity Rule Location
HIGH secret-generic-credential deploy/ergo/ircd.yaml:162
HIGH secret-generic-credential deploy/ergo/ircd.yaml:221
HIGH secret-generic-credential deploy/ergo/ircd.yaml:638
HIGH secret-generic-credential deploy/ergo/ircd.yaml:787
HIGH secret-database-url deploy/ergo/ircd.yaml:893
HIGH secret-generic-credential deploy/ergo/ircd.yaml:1025
HIGH secret-generic-credential deploy/ergo/ircd.yaml:1033
LOW secret-generic-credential deploy/ergo/ircd.yaml:772
LOW tls-verification-disabled internal/mail/mail.go:109
LOW secret-generic-credential internal/mailu/mailu_test.go:44

Snippets are redacted; ThreatCrush never prints matched credential material.

@sh1pt-actions-fleet
sh1pt-actions-fleet Bot merged commit 29c14d4 into main Nov 2, 2026
6 checks passed
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot deleted the ci-deploy-forced-command branch November 2, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant