Repository navigation
How to block a command? #2034
|
Agent used the "command_policies": {
"commands": {
"poweroff": { "from": { "session": "deny" } },
"halt": { "from": { "session": "deny" } },
"reboot": { "from": { "session": "deny" } },
"shutdown": { "from": { "session": "deny" } },
"pkill": { "from": { "session": "deny" } },
"killall": { "from": { "session": "deny" } },
"npm": { "from": { "session": "deny" } },
"pip": { "from": { "session": "deny" } },
"su": { "from": { "session": "deny" } },
"doas": { "from": { "session": "deny" } },
"ftp": { "from": { "session": "deny" } },
"sftp": { "from": { "session": "deny" } },
"rsync": { "from": { "session": "deny" } },
"scp": { "from": { "session": "deny" } },
"rm": { "from": { "session": "deny" } },
"chmod": { "from": { "session": "deny" } },
"sudo": { "from": { "session": "deny" } },
"kill": { "from": { "session": "deny" } }
}
},however if I just run bash inside that profile, I can still call |
Replies: 1 comment 3 replies
|
There are two different boundaries here: blocking an executable and blocking a shell's builtin. Your Inside the same sandboxed Bash, these are safe ways to inspect which path is being used: type -a kill
help killThat also explains why the older So the new policy is useful for the external command, but it does not mean “no process in this session can send signals.” Disabling a shell builtin is not a security boundary against an agent that controls the shell or can use another program to send a signal. If that's the requirement, you need the appropriate process/signal isolation, not just a command-name deny. What OS and |
@lovehumans For nono 0.79.0 on Linux, there is no profile setting that implements exactly “only my children, never myself.” The closest supported setting protects processes outside the sandbox, rather than distinguishing each process from its children.
Merge this into your existing profile's top-level
securitysection:This is a supported 0.79.0 profile value. Its Linux implementation requires Landlock ABI v6+ and refuses to start if that signal-scoping support is unavailable. Unlike the executable deny policy, this applies to direct signal syscalls, including those made by Bash's builtin.
Check the effective policy for the profile you…