Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.sandbox.jail-native

The Vis API for the standalone native process jail.

The Vis API for the standalone native process jail.
raw docstring

end-confined-processes!clj

(end-confined-processes! owner)
(end-confined-processes! owner socket-dir)

End every live process that a jail-policy with this :owner confined, also one that left its spawner's process tree, and return how many. macOS finds them through the kernel's sandbox; elsewhere no process carries an owner, so this returns 0. With the socket-dir that spawn-process! got, also delete each socket directory of this owner that a killed spawner left.

End every live process that a [[jail-policy]] with this `:owner` confined, also
one that left its spawner's process tree, and return how many. macOS finds
them through the kernel's sandbox; elsewhere no process carries an owner, so
this returns 0. With the `socket-dir` that [[spawn-process!]] got, also delete
each socket directory of this owner that a killed spawner left.
sourceraw docstring

jail-policyclj

(jail-policy {:keys [read-write read-only deny-read deny-write deny-exec
                     unix-connect unix-socket-dirs network inbound keychain?
                     owner]
              :as policy})

The confinement value spawn-process! compiles, from a map: path lists :read-write, :read-only, :deny-read, :deny-write, :deny-exec (~ allowed; a deny wins; temp and platform code are the compiler's); :network is :off (default), :open or {:proxy <port>} (:loopback? true adds other loopback ports but :loopback-deny); :unix-connect exact local sockets; :unix-socket-dirs real paths where a child may write, bind and dial local sockets; :inbound ports on every interface; :keychain? the credential store; :owner for end-confined-processes!. macOS/Linux only: Windows uses windows-jail and private copies instead of host-path grants.

The confinement value `spawn-process!` compiles, from a map: path lists `:read-write`,
`:read-only`, `:deny-read`, `:deny-write`, `:deny-exec` (`~` allowed; a deny wins; temp
and platform code are the compiler's); `:network` is `:off` (default), `:open` or
`{:proxy <port>}` (`:loopback? true` adds other loopback ports but `:loopback-deny`);
`:unix-connect` exact local sockets; `:unix-socket-dirs` real paths where a child may
write, bind and dial local sockets; `:inbound` ports on every interface; `:keychain?`
the credential store; `:owner` for [[end-confined-processes!]]. macOS/Linux only:
Windows uses [[windows-jail]] and private copies instead of host-path grants.
sourceraw docstring

jail-signal-scoped?clj

(jail-signal-scoped?)

Whether a confined child can signal only its own descendants. Always on macOS; on Linux only with Landlock ABI 6 (kernel 6.12), else it can signal every process of its user.

Whether a confined child can signal only its own descendants. Always on macOS; on
Linux only with Landlock ABI 6 (kernel 6.12), else it can signal every process of
its user.
sourceraw docstring

jail-unsupported-reasonclj

(jail-unsupported-reason)

Why this host cannot confine a child — no Seatbelt or namespaces, WSL1, no no matching libvisjail — or nil when it can. Windows has a separate windows-jail-unsupported-reason and workspace contract.

Why this host cannot confine a child — no Seatbelt or namespaces, WSL1, no
no matching `libvisjail` — or nil when it can. Windows has a separate
[[windows-jail-unsupported-reason]] and workspace contract.
sourceraw docstring

jailed?clj

(jailed?)

True inside a child this jail already confined: spawn-process! then passes the inherited kernel policy on instead of applying a second one.

True inside a child this jail already confined: `spawn-process!` then
passes the inherited kernel policy on instead of applying a second one.
sourceraw docstring

loopback-peer-confined?clj

(loopback-peer-confined? server-port peer-port owner)

Whether a live process that a jail-policy confined, with an :owner other than owner (nil: any owner), holds the TCP connection from loopback peer-port to loopback server-port. A server asks this once for each accepted connection. macOS only: on Linux a confined child reaches no host loopback port directly, so false.

Whether a live process that a [[jail-policy]] confined, with an `:owner` other than
`owner` (nil: any owner), holds the TCP connection from loopback `peer-port` to
loopback `server-port`. A server asks this once for each accepted connection. macOS
only: on Linux a confined child reaches no host loopback port directly, so false.
sourceraw docstring

spawn-process!clj

(spawn-process! command)
(spawn-process! command
                {:keys [environment directory policy socket-dir pty?
                        merge-stderr? rows columns]})

Spawn command as a detached process through libvisjail, returning a java.lang.Process. :policy (a jail-policy map) confines it — Seatbelt on macOS, embedded bubblewrap on Linux, compiled by Vis — and a spawn the host cannot enforce throws instead of running the child unconfined; no policy keeps only the process group and stream handling. :environment is the COMPLETE child environment; a confined child also carries Jail/MARKER. :socket-dir gives a child that this call confines its own Unix socket directory. On Windows use spawn-windows-process!; this function always refuses it.

Spawn `command` as a detached process through `libvisjail`, returning a
`java.lang.Process`. `:policy` (a [[jail-policy]] map) confines it — Seatbelt
on macOS, embedded bubblewrap on Linux, compiled by Vis — and a spawn
the host cannot enforce throws instead of running the child unconfined; no
policy keeps only the process group and stream handling. `:environment` is
the COMPLETE child environment; a confined child also carries `Jail/MARKER`.
`:socket-dir` gives a child that this call confines its own Unix socket directory.
On Windows use [[spawn-windows-process!]]; this function always refuses it.
sourceraw docstring

spawn-windows-process!clj

(spawn-windows-process! jail command)
(spawn-windows-process!
  jail
  command
  {:keys [environment directory pty? merge-stderr? rows columns] :as options})

Run a command in a windows-jail, returning java.lang.Process. The executable must be absolute, inside its staged app or Windows System32. :directory is work-relative (nil means work); :environment replaces the host environment. TEMP/TMP/LOCALAPPDATA stay private; SystemRoot is OS-derived. Pipes are the default. :pty? needs positive :rows/:columns; unknown, network, host-path or credential options throw. Both destroy methods terminate the process job and its descendants.

Run a command in a [[windows-jail]], returning `java.lang.Process`.
The executable must be absolute, inside its staged app or Windows System32.
`:directory` is work-relative (nil means work); `:environment` replaces the host environment.
TEMP/TMP/LOCALAPPDATA stay private; SystemRoot is OS-derived. Pipes are the default.
`:pty?` needs positive `:rows`/`:columns`; unknown, network, host-path or credential options throw.
Both destroy methods terminate the process job and its descendants.
sourceraw docstring

stage-windows-jail!clj

(stage-windows-jail! jail source relative-destination)

Copy a local file/tree into a new relative destination under the jail's app directory; return its absolute path. Refuse links, reparse points and unsafe destinations. Source ACLs stay unchanged. Call before the first spawn.

Copy a local file/tree into a new relative destination under the jail's app
directory; return its absolute path. Refuse links, reparse points and unsafe
destinations. Source ACLs stay unchanged. Call before the first spawn.
sourceraw docstring

verify-library!clj

(verify-library!)

Load the staged library and check that it supports this host.

Load the staged library and check that it supports this host.
sourceraw docstring

windows-jailclj

(windows-jail parent)

Create a new Windows LPAC workspace under an existing local parent directory. Use with-open to terminate its jobs and release native resources. The app, work and tmp directories remain afterward so you can inspect the outputs. This grants no host-path access and enables no network capabilities.

Create a new Windows LPAC workspace under an existing local parent directory.
Use `with-open` to terminate its jobs and release native resources. The app,
work and tmp directories remain afterward so you can inspect the outputs.
This grants no host-path access and enables no network capabilities.
sourceraw docstring

windows-jail-directoriesclj

(windows-jail-directories jail)

Root directories belonging to an open or closed Windows jail. Prepare writable inputs in :work; stage-windows-jail! copies read-only inputs into :application. :temporary contains the child's per-profile TEMP/TMP and application-data directories.

Root directories belonging to an open or closed Windows jail. Prepare writable inputs
in `:work`; [[stage-windows-jail!]] copies read-only inputs into `:application`.
`:temporary` contains the child's per-profile TEMP/TMP and application-data directories.
sourceraw docstring

windows-jail-unsupported-reasonclj

(windows-jail-unsupported-reason)

Why the Windows workspace backend is unavailable, or nil when its platform archive is present. Creation still validates OS security prerequisites.

Why the Windows workspace backend is unavailable, or nil when its platform
archive is present. Creation still validates OS security prerequisites.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close