Skip to content

Ask before a guest container or VM is stopped or deleted [15m ? after #40] - #41

Open
jpawlowski wants to merge 2 commits into
wintermeyer:mainfrom
jpawlowski:feat/guard-ask-guest-stops
Open

jpawlowski wants to merge 2 commits into
wintermeyer:mainfrom
jpawlowski:feat/guard-ask-guest-stops

Conversation

@jpawlowski

Copy link
Copy Markdown
Contributor

Gap: the guard let pct stop, qm destroy or virsh undefine through unchecked, and denied qm, pct and virsh shutdown as a host power-off.

Change: a second tier next to deny. Stopping, shutting down or deleting a guest through its manager (pct, qm, incus, lxc, virsh, lxc-stop, lxc-destroy) returns ask: the user confirms the exact command. Where no prompt reaches a human (bypassPermissions, dontAsk, unknown mode) it is denied. Host taboos in the same command still win. The test matrix learns the permission mode and the ask outcome.

Size: the time sits in the permission-mode rule at the end of guard-taboos.sh.

Verified: 591 passed, 0 failed, and green merged with every open PR that touches the guard. Measured with Claude Code 2.1.267: the hook sees permission_mode; claude -p refuses an ask in every mode.

An AI agent wrote this text in my name. I know that is problematic.

Part of #27.
Closes #39.

The guard gets a second tier next to deny. Stopping, shutting down or
deleting a system container or VM through its manager (pct, qm,
incus, lxc, virsh, lxc-stop, lxc-destroy) is answered with ask: the
user confirms the exact command in a permission prompt. Where no
prompt can reach a human (bypassPermissions, dontAsk, an unknown
mode, and every claude -p run, measured with Claude Code 2.1.267) it
is denied. Host taboos in the same command still win.

A guest manager's shutdown verb no longer counts as a host
power-off, so the clean way to stop a guest is no stricter than the
hard one. Both decisions go through one emitter. The test matrix
learns the permission mode and the ask outcome.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ShellCheck read $GOPTS followed by a bracket expression as an array
index (SC1087) and failed the error-severity step. ${GOPTS} expands
the same string.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

Ask before a guest container or VM is stopped or deleted

1 participant