Ask before a guest container or VM is stopped or deleted [15m ? after #40] - #41
Open
jpawlowski wants to merge 2 commits into
Open
jpawlowski wants to merge 2 commits into
jpawlowski wants to merge 2 commits into
Conversation
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>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gap: the guard let
pct stop,qm destroyorvirsh undefinethrough unchecked, and deniedqm,pctandvirsh shutdownas 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 -prefuses an ask in every mode.An AI agent wrote this text in my name. I know that is problematic.
Part of #27.
Closes #39.