Skip to main content

Module session_check

Module session_check 

Source
Expand description

One command run in a session’s work folder after the session has ended, under the containment the session’s own commands had: what mur eval run judges a case’s work by.

The check is not part of the session. StagedSession::check_runner captures, before launch, what the session’s [crate::sandbox::ShellEnforcement] is built from; CheckRunner::run builds a new enforcement from it once launch_session has returned and every process the session started is dead. The command, its files and its output reach no trace, no provider request and no file the agent could read while it ran.

The enforcement is the one runtime::launch_session installs: the same capability policy, declared floor, host probe and /tmp mapping, so the same shell allowlist, Landlock scope, seccomp filter, network namespace and resource limits. Only its scope is new: a cgroup scope, runtime directory and network namespace of its own, each ended or removed when the check returns. $HOME and $TMPDIR are the session’s home/ and tmp/, as for its commands.

Structs§

CheckOutcome
What one check did.
CheckRunner
What a session’s containment was built from, captured before launch, to run a SessionCheck under it after the session ends.
SessionCheck
A command to run in a session’s work folder once the session has ended.
TreeEntry
One entry beneath an operator’s directory tree: an eval case’s start or check.files.

Enums§

CheckResult
How a check ended.

Constants§

CHECK_LOG_FILE
Where the check’s captured stdout then stderr are written, beneath the session’s records directory.
CHECK_OUTPUT_TAIL_BYTES
How much of the check’s output CheckOutcome::output_tail keeps: the last bytes of stdout followed by stderr.

Functions§

copy_tree_into
Copies the tree at source into workdir’s root: directories and regular files, each entry’s permission bits kept, an existing file overwritten.
walk_tree
Every entry beneath root, in byte-wise order of the relative path, so a parent comes before what it holds. Read with no link followed: a symbolic link or a special file anywhere in the tree is refused, naming it.