sandbox
How an analysis container is confined at run time.
The measures here are a property of the platform, not of an analysis: a
container gets its inputs as files and returns its output as a file, so it
needs no network, no Linux capability, no writable image filesystem beyond
/tmp, no root, no way to gain privileges, and no more processes than a
multithreaded computation uses. The platform's runner renders this model into its
container runtime's terms, and the conformance checker renders the same
model into docker run flags, so an image that passes the check has run
under exactly what the platform applies.
AnalysisSandboxConfig
pydantic-model
¶
Bases: BaseModel
The confinement an analysis container runs under.
Every measure is on by default. A switch exists for local development of the platform, never for an analysis configuration.
Config:
extra:forbid
Fields:
-
network(bool) -
drop_all_capabilities(bool) -
readonly_rootfs(bool) -
no_new_privileges(bool) -
pids_limit(int | None) -
user(str | None)
drop_all_capabilities = True
pydantic-field
¶
Drop every Linux capability.
network = False
pydantic-field
¶
Attach the container to a network. Off means no network at all: inputs are on disk before the container starts and the output leaves as a file.
no_new_privileges = True
pydantic-field
¶
Forbid gaining privileges after start: a setuid or setcap binary in the image runs with the caller's privileges, not its own.
pids_limit = 4096
pydantic-field
¶
Most processes and threads the container may hold at once. Null leaves it unbounded. The default is far above what a multithreaded analysis uses, and stops a fork bomb from exhausting the host's process table.
readonly_rootfs = True
pydantic-field
¶
Mount the image's filesystem read-only. /tmp becomes a tmpfs whose pages count against the container's memory limit; the input and output directories stay writable.
user = '65534:65534'
pydantic-field
¶
uid:gid the container runs as. Null keeps the image's default user. The input and output directories are world-writable, so an unprivileged user reads inputs and writes the output without any grant.