Skip to content

feat(bench): Trigger install of SSH command guard on benches#6718

Draft
regdocs wants to merge 1 commit into
developfrom
prevent-bench-commands-on-prod
Draft

feat(bench): Trigger install of SSH command guard on benches#6718
regdocs wants to merge 1 commit into
developfrom
prevent-bench-commands-on-prod

Conversation

@regdocs

@regdocs regdocs commented Jun 15, 2026

Copy link
Copy Markdown
Member

Pairs with the agent-side bench wrapper that blocks destructive commands (drop-site, migrate, restore, etc.) run directly over SSH on production benches, which would put a site's state out of sync with Frappe Cloud.

Press owns the blocklist (BLOCKED_BENCH_COMMANDS) and sends it to the agent, so it can change without rebuilding the bench image. The guard lives on the container filesystem rather than the image, so it is (re)installed every time a bench turns Active - covering both new benches and fresh containers from a redeploy. backfill_command_guard_on_active_benches covers benches already running; it is left out of patches.txt so it does not fire jobs before the agent endpoint is deployed.

The enforcement can't live in the bench CLI (pinned/immutable in prod), hence routing it through press > agent.

Pairs with the agent-side bench wrapper that blocks destructive commands
(drop-site, migrate, restore, etc.) run directly over SSH on production
benches, which would put a site's state out of sync with Frappe Cloud.

Press owns the blocklist (BLOCKED_BENCH_COMMANDS) and sends it to the
agent, so it can change without rebuilding the bench image. The guard
lives on the container filesystem rather than the image, so it is
(re)installed every time a bench turns Active - covering both new benches
and fresh containers from a redeploy. backfill_command_guard_on_active_benches
covers benches already running; it is left out of patches.txt so it does
not fire jobs before the agent endpoint is deployed.

The enforcement can't live in the bench CLI (pinned/immutable in prod),
hence routing it through press > agent.
@balamurali27

Copy link
Copy Markdown
Contributor

fixes #6208

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.

2 participants