Documentation
¶
Index ¶
- Constants
- Variables
- func Command(ctx context.Context, spec Spec, name string, args ...string) (*exec.Cmd, error)
- func ControlPlaneEnvDeny() []string
- func DefaultEnvAllow() []string
- func DefaultEnvDeny() []string
- func EnvScrub(mode string, extraAllow, extraDeny []string) func(parent []string) []string
- func LoadCarveouts(r io.Reader) (fs []FSCarveout, net []NetCarveout, err error)
- func OverlayEnv(env []string, set map[string]string) []string
- func ParseEnvList(s string) []string
- func Preflight() error
- func PreflightSyscallTap() error
- func ScrubModeValid(mode string) bool
- func SecretEnvDeny() []string
- func ShimMain() (handled bool, err error)
- func Started(cmd *exec.Cmd, startErr error) error
- func SystemExecDirs() []string
- type EnvPolicy
- type FSCarveout
- type NetCarveout
- type Spec
Constants ¶
const ( ScrubOff = "off" ScrubDenySecrets = "deny-secrets" ScrubStrict = "strict" )
const ( ModeRO = "ro" ModeRW = "rw" )
Variables ¶
var ErrInvalidCarveout = errors.New("libsandbox: invalid carve-out")
var ErrInvalidSpec = errors.New("libsandbox: invalid spec")
var ErrIsolation = errors.New("libsandbox: isolation failure")
var ErrLandlockUnsupported = errors.New("libsandbox: landlock unsupported by kernel")
Functions ¶
func ControlPlaneEnvDeny ¶
func ControlPlaneEnvDeny() []string
func DefaultEnvAllow ¶
func DefaultEnvAllow() []string
func DefaultEnvDeny ¶
func DefaultEnvDeny() []string
func LoadCarveouts ¶
func LoadCarveouts(r io.Reader) (fs []FSCarveout, net []NetCarveout, err error)
func ParseEnvList ¶
func PreflightSyscallTap ¶
func PreflightSyscallTap() error
PreflightSyscallTap reports whether SyscallTap can be built on this host. It returns nil when it can, and an ErrIsolation error naming the missing capability otherwise. Two things are required: a kernel with seccomp user-notify (5.0+), and a free listener slot, because a filter chain can hold only one user-notify listener. A process that already runs under a filter with a listener (a container runtime, WSL2's init, another sandbox) cannot install a second one: the kernel answers EBUSY.
func ScrubModeValid ¶
func SecretEnvDeny ¶
func SecretEnvDeny() []string
func SystemExecDirs ¶
func SystemExecDirs() []string
Types ¶
type FSCarveout ¶
type NetCarveout ¶
type Spec ¶
type Spec struct {
WorkspaceRoot string
Home string
EnvAllow []string
EnvSet map[string]string
FS []FSCarveout
Net []NetCarveout
AllowPrivateEgress bool
NetworkWall bool
Tracker libtracker.ActivityTracker
SyscallTap bool
}
Source Files
¶
- carveouts.go
- command.go
- egresspolicy.go
- env.go
- envinject.go
- envmode.go
- envpolicy.go
- execpath.go
- isolation_linux.go
- landlock_linux.go
- libsandbox.go
- netbridge_linux.go
- netns_linux.go
- plan.go
- platform_other.go
- preflight_linux.go
- shim_linux.go
- spec.go
- started.go
- started_other.go
- synctap_audit_amd64.go
- synctap_linux.go
- tun_linux.go