an easy-to-use command-line tool for running commands with macOS sandbox-exec policies using flag-based interface
Go
98
29 commits
updated Apr 27, 2025
sbx is an easy-to-use command-line tool for running commands with macOS sandbox-exec policies using flag-based interface.Common system sandbox rules which is defined in "system.sb".-network flag, this command allows access to unix-socket.go install github.com/syumai/sbx/cmd/sbx@latest
or download binary from releases page.
sbx [flags] <command> [command-args...]
sbx [flags] -- <command> [command-flags] [command-args...]
sbx denies all operations.
--allow-all flag.deny- prefix.-all flags are boolean flags that allow / deny all operations for the corresponding operation type.
-network flags supports only settings below.
ip protocol.localhost or * for host.--allow-all Allow all operations (without this flag, deny all operations by default)--allow-file Allow file operations--deny-file Deny file operations--allow-file-all Allow all file operations--deny-file-all Deny all file operations--allow-file-read Allow file read operations--deny-file-read Deny file read operations--allow-file-read-all Allow all file read operations--deny-file-read-all Deny all file read operations--allow-file-write Allow file write operations--deny-file-write Deny file write operations--allow-file-write-all Allow all file write operations--deny-file-write-all Deny all file write operations--allow-network-all Allow all network operations--deny-network-all Deny all network operations--allow-network-inbound Allow inbound network operations--deny-network-inbound Deny inbound network operations--allow-network-outbound Allow outbound network operations--deny-network-outbound Deny outbound network operations--allow-process-exec Allow process execution--deny-process-exec Deny process execution--allow-process-exec-all Allow all process execution--deny-process-exec-all Deny all process executionsbx --allow-file-read . ls .
# same as above
sbx --allow-file-read='.' ls .
# with command flags
sbx --allow-file-read='.' -- ls -l .
localhost:8080.sbx --allow-network='localhost:8080' curl http://localhost:8080
/opt/local directory to retrieve CA certificates. (This example uses homebrew-installed curl.)sbx --allow-network='*:443' --allow-file-read='/opt/local' curl https://syum.ai/ascii
MIT
29 commits
Go
100.0%
an easy-to-use command-line tool for running commands with macOS sandbox-exec policies using flag-based interface
Go
98
29 commits
updated Apr 27, 2025
sbx is an easy-to-use command-line tool for running commands with macOS sandbox-exec policies using flag-based interface.Common system sandbox rules which is defined in "system.sb".-network flag, this command allows access to unix-socket.go install github.com/syumai/sbx/cmd/sbx@latest
or download binary from releases page.
sbx [flags] <command> [command-args...]
sbx [flags] -- <command> [command-flags] [command-args...]
sbx denies all operations.
--allow-all flag.deny- prefix.-all flags are boolean flags that allow / deny all operations for the corresponding operation type.
-network flags supports only settings below.
ip protocol.localhost or * for host.--allow-all Allow all operations (without this flag, deny all operations by default)--allow-file Allow file operations--deny-file Deny file operations--allow-file-all Allow all file operations--deny-file-all Deny all file operations--allow-file-read Allow file read operations--deny-file-read Deny file read operations--allow-file-read-all Allow all file read operations--deny-file-read-all Deny all file read operations--allow-file-write Allow file write operations--deny-file-write Deny file write operations--allow-file-write-all Allow all file write operations--deny-file-write-all Deny all file write operations--allow-network-all Allow all network operations--deny-network-all Deny all network operations--allow-network-inbound Allow inbound network operations--deny-network-inbound Deny inbound network operations--allow-network-outbound Allow outbound network operations--deny-network-outbound Deny outbound network operations--allow-process-exec Allow process execution--deny-process-exec Deny process execution--allow-process-exec-all Allow all process execution--deny-process-exec-all Deny all process executionsbx --allow-file-read . ls .
# same as above
sbx --allow-file-read='.' ls .
# with command flags
sbx --allow-file-read='.' -- ls -l .
localhost:8080.sbx --allow-network='localhost:8080' curl http://localhost:8080
/opt/local directory to retrieve CA certificates. (This example uses homebrew-installed curl.)sbx --allow-network='*:443' --allow-file-read='/opt/local' curl https://syum.ai/ascii
MIT
29 commits
Go
100.0%