[feat] --dangerously-allow-all + make --allow-cmd actually execute (STAR-55)#18
Merged
Conversation
…TAR-55) Two cmd-execution fixes, driven by the v0.2 capability review: 1. --allow-cmd was a no-op for execution: starcli built cmd via NewModule() (disabled), so run() always returned "command execution is disabled" even with the flag. It now builds cmd via NewModuleWithAllowAll() (starpkg/cmd v0.1.1) when execution is granted, so --allow-cmd runs any command. 2. New --dangerously-allow-all: one flag opens network + filesystem + host command execution of ANY command (Claude-Code-style "trust everything"). Capability model gains a separate execCmd lever (allowCmd still gates loading). Command EXECUTION is OFF in the open posture and under a bare tier; it turns on only with --allow-cmd or --dangerously-allow-all. A no-flag run still loads cmd (which() works) but run() stays disabled — no surprise process spawning by default. cmd remains argv-only + input-hardened by the module. - capability.go: capGrant.execCmd; grantFromFlags(..., dangerous); the open posture loads cmd but leaves execCmd off. - box.go: thread grant.execCmd into BoxOpts; mods.go: cmd built enabled iff execCmd. - args.go: --dangerously-allow-all flag. - tests: TestGrantExecCmd (the lever) + TestProcess_CmdExecution_EndToEnd (default disabled / --allow-cmd runs / --dangerously-allow-all opens net+cmd). - go.mod: starpkg/cmd v0.1.0 -> v0.1.1 (NewModuleWithAllowAll). - README: capability section + --help snapshot. Full -race green; Docker golang:1.25 floor green; gofmt/vet clean.
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.
What
Two fixes to host command execution, from the v0.2 capability review:
--allow-cmdwas a no-op for execution. starcli builtcmdviacmd.NewModule()(disabled), sorun()always returned "command execution is disabled" even with the flag. It now buildscmdviacmd.NewModuleWithAllowAll()(starpkg/cmd v0.1.1) when execution is granted — so--allow-cmdactually runs commands.--dangerously-allow-all— one flag opens network + filesystem + host command execution of any command (Claude-Code-style "trust everything").Capability model
The grant gains a separate
execCmdlever;allowCmdstill gates loading. Command execution is off in the open posture and under a bare tier — it turns on only with--allow-cmdor--dangerously-allow-all. So a no-flag run still loadscmd(which()works) butrun()stays disabled: no surprise process spawning by default.cmdstays argv-only + input-hardened by the module (the allow-all escape hatch only skips the allowlist, never the sanitization).run()executes?--caps full--allow-cmd--dangerously-allow-allChanges
capability.go:capGrant.execCmd;grantFromFlags(..., dangerous); open posture loads cmd but leavesexecCmdoff.box.go: threadgrant.execCmdintoBoxOpts;mods.go: cmd built enabled iffexecCmd.args.go: the--dangerously-allow-allflag.TestGrantExecCmd(the lever) +TestProcess_CmdExecution_EndToEnd(default disabled /--allow-cmdruns /--dangerously-allow-allopens net+cmd).go.mod:starpkg/cmdv0.1.0 → v0.1.1.README.md: capability section +--helpsnapshot.Verification
-racegreen; Dockergolang:1.25(go floor) green;gofmt/vetclean.Tracks STAR-55 (under STAR-53). Depends on starpkg/cmd#17 (merged, tagged v0.1.1).