Cordon (Sandbox) Settings
Also settable in a profile configuration to override the base configuration.
New in 0.9.11 Enkaidu supports sandboxing execution of shell commands for platforms that support it. On macOS this is done using the built-in sandbox-exec helper command. On Linux platforms Enkaidu looks for bubblewrap which has to be installed by the user.
Warning If your platform does not have a supported sandbox, then Enkaidu runs in unsafe mode and runs shell commands directly.
cordon:confirm:defaults totrue, to confirm if cordon is available for your platform.mode:use this to set how the cordon is deployed, or disabled, by using one of the following values:commands(default) to run shell commands within a cordonunsafeto not use a cordon
policy:can be used to define custom policy rules for the cordon.read_only_paths: [...](default[]) array of paths to allow read-only access from within the cordon; executables in these paths are allowed to be run as well.read_write_paths: [...](default[]) array of paths where read and write access is allowed from within the cordon.- New in 0.9.13
allow_network: true | false(defaultfalse) to enable networking (inbound, outbound, and binding) for commands executed within the cordon. Whenfalse, nothing run in the cordon gets network access. - New in 0.9.14 Per-command granularity: when
allow_networkistrue, network access is granted per command — only commands that prefix-match an entry inshell_command’snetwork_allowed_commandsrun with network access; every other allowed command runs without it. There is still no way to restrict hosts or ports, so enable with care. See shell command execution.
workspace:Properties here can be used enable / configure presets specific to your workspace.using_brew: true | false(default false) to ensure brew-installed commands are reachable from within the cordonusing_ruby:in two waysusing_ruby: true(default false) to use platform-supplied Ruby, includingbrew-installed Ruby ifusing_brewistrue.using_ruby:ruby_path: PATH_STRwill ensure the Ruby at this location is allowed
using_python:in two waysusing_python: true(default false) to use platform-supplied Python, includingbrew-installed Python ifusing_brewistrue.using_python:venv_path: PATH_STRwill ensure Python virtual environment is allowed.
- New in 0.9.16
using_crystal:in two waysusing_crystal: true(default false) to use the$HOME-based shared cache folder.using_crystal:shared_cache_path: PATH_STRsets a custom location for the Crystal shared cache used to improve compilation times.
Example
cordon:
# shell commands run inside the cordon
mode: commands
policy:
read_only_paths:
- /usr/share/zoneinfo
read_write_paths:
- ./scratch
# networking for cordon commands is off by default; when true,
# only commands matching shell_command's network_allowed_commands get it
allow_network: false
workspace:
using_brew: true
using_ruby: true
using_crystal: true