app

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package app is the containment product's command. It is the launch step of docs/adr-sandboxing.md: a runner (the plugin engine, workload's local driver, a person) starts `ext sandbox exec` with a grant, and the command confines its own process with src/cto/internal/confine and becomes the guest.

cto exec --grant FILE [--driver NAME] [--accept CLASS,...] [--runner CLASS,...]
         [--status-fd N] [--dir DIR] -- PATH [ARG...]
cto exec --launch-fd N [--status-fd N]
cto check [--json]

With --grant the grant is read from a JSON file (a src/cto/sandbox Policy) and the guest's base environment is the caller's PATH only; a grant with secrets needs --launch-fd. With --launch-fd the whole launch (confine.Launch, secrets' values included) is read from an inherited file descriptor, which is how a runner passes it without putting a secret on a command line. --status-fd writes the one status line (the report, or the code of a refusal) to an inherited descriptor before the guest starts.

Index

Constants

View Source
const (
	ExitUsage   = 2   // the command line is wrong
	ExitRefused = 125 // the launch was refused: the status line or stderr says why
	ExitExec    = 126 // the guest could not be started after the process was confined
)

The exit statuses of `sandbox exec` when it does not become the guest.

View Source
const MaxLaunchBytes = 4 << 20

MaxLaunchBytes bounds a launch read from a descriptor.

Variables

View Source
var Version = "0.1.0-dev"

Version is the version of this build of cto.

Functions

func Run

func Run(name string, args []string, stdout, stderr io.Writer) int

Run runs the containment command. name is the command prefix used in messages, either "cto" or "ext sandbox".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL