Documentation
¶
Overview ¶
Package sandbox runs the agent's converters' work in limited child processes of the agent's own binary (the WebP / AVIF and Markdown converters, ADR-0043): bounded memory, no files, few descriptors, no capabilities, no_new_privs, killed with the agent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Limit ¶
Limit bounds the child: its writable private memory (RLIMIT_DATA, which Linux counts for anonymous mappings; RLIMIT_AS would also count the address space the Go runtime reserves without using it) to what it already has plus memory plus headroom, no file it could write, at most 16 descriptors, no_new_privs, and no capabilities (the agent may hold CAP_NET_BIND_SERVICE as an ambient capability). A limit the child inherited lower stays as it is: raising a hard limit needs CAP_SYS_RESOURCE.
func SelfCommand ¶
SelfCommand returns a converter's Command for exe: the child gets no environment but GOMAXPROCS=1 (one CPU per child; the agent's environment may hold secrets) and dies with the agent.
func SelfExecutable ¶
func SelfExecutable() string
SelfExecutable is the binary children run: this process's own (/proc/self/exe on Linux, so a replaced binary on disk changes nothing until the agent restarts).
Types ¶
This section is empty.