Fence configuration
Configuration file for fence, a lightweight, container-free sandbox for running commands with network and filesystem restrictions
| Type | object |
|---|---|
| File match |
fence.json
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/fence-configuration/latest.json |
| Source | https://raw.githubusercontent.com/Use-Tusk/fence/refs/heads/main/docs/schema/fence.schema.json |
Validate with Lintel
npx @lintel/lintel check
Properties
Allow the sandboxed process to allocate a pseudo-terminal (PTY). Required for interactive programs that need terminal control (e.g. vim, less, top).
Command execution restrictions. Controls which commands are blocked or allowed at preflight and runtime.
5 nested properties
Commands for which the shared-binary skip warning is silenced. Add a command here after investigating a collision and accepting that it cannot be blocked on this system.
Commands that override a matching deny rule. Use to carve out specific exceptions from a broad deny pattern (e.g. allow "git push origin docs" when "git push" is denied).
Commands or command prefixes the sandbox will refuse to run. Matched at preflight and, depending on runtimeExecPolicy, at runtime for child execs.
Runtime child-process exec enforcement mode. "path" (default) uses executable-path masking for single-token denies. "argv" enables Linux-only argv-aware exec interception for child processes.
Whether to include the built-in default deny list (shutdown, reboot, insmod, mkfs, etc.). Defaults to true when omitted. Set to false to manage the deny list entirely yourself.
2 nested properties
Path or built-in template name to inherit base settings from (e.g. "code" or "./base.json"). Settings in this file are merged on top of the extended config.
Filesystem access restrictions. Controls which paths may be read, written, or executed inside the sandbox.
8 nested properties
Paths the sandbox may execute (grants read and execute permission, but not directory listing). Use for binaries that must be reachable but whose parent directories should not be browsable.
If true, allow read access to ~/.gitconfig and ~/.config/git. Enable when git operations inside the sandbox need the user's identity or settings.
Additional filesystem paths the sandbox may read. Accepts absolute paths and glob patterns.
Filesystem paths the sandbox may write to. Accepts absolute paths and glob patterns.
If true, deny all filesystem reads by default. Only paths listed in allowRead (and essential system paths) remain readable. Use for strict read isolation.
Paths explicitly blocked from reading, even if they would otherwise be permitted by allowRead or system defaults.
Paths explicitly blocked from writing, even if they would otherwise be permitted by allowWrite.
Controls access to the WSL interop binary on Windows Subsystem for Linux. If omitted, auto-detected: WSL environments allow /init, non-WSL environments do not.
Network access restrictions. Controls which domains the sandbox may connect to and how local networking is handled.
8 nested properties
If true, allow connections to any Unix socket path. Overrides allowUnixSockets.
Allow the sandbox to bind to local network ports. Enable this when the sandboxed process needs to run a local server.
Allow outbound connections to localhost and loopback addresses. If omitted, inherits the value of allowLocalBinding.
Unix socket paths the sandbox may connect to (e.g. /var/run/docker.sock).
Domains the sandbox may connect to. Supports wildcards (e.g. .example.com). Use "" to allow all outbound connections. If empty, all outbound connections are blocked.
Domains explicitly blocked even if they match allowedDomains. Evaluated before allowedDomains.
Port for the internal HTTP proxy used to enforce domain filtering. Set automatically by fence; only override for advanced configurations.
Port for the internal SOCKS proxy used to enforce domain filtering. Set automatically by fence; only override for advanced configurations.
SSH command and host restrictions. Applies only to ssh invocations; does not affect other network access.
6 nested properties
If true, switch SSH command filtering to denylist mode: all remote commands are permitted except those in deniedCommands. When false (the default), allowedCommands acts as an allowlist.
Commands permitted over SSH (allowlist mode). Only the listed commands may be executed on remote hosts. An empty list allows interactive sessions only.
Host patterns the sandbox may SSH to. Supports wildcards (e.g. .example.com, prod-). SSH connections to hosts not matching any pattern are blocked.
Commands blocked over SSH (denylist mode). Only meaningful when allowAllCommands is true.
Host patterns explicitly blocked for SSH, even if they match allowedHosts. Evaluated before allowedHosts.
If true, also apply the global command.deny rules to SSH remote commands.