execguard

package
v4.24.26 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: AGPL-3.0 Imports: 13 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 execguard runs a workload under the sensor and decides about every program it starts, before the program runs.

It is for where there is no eBPF: Fargate, gVisor-less containers that may not load BPF, any host where the sensor cannot run privileged. The sensor becomes the workload's entrypoint (vulnetix-sensor run -- <command>), puts a seccomp filter on the workload that sends every execve and execveat to the sensor through a user notification, and answers each one: continue, or refuse with EPERM. Every other system call runs at full speed; only program starts stop.

Refusing an exec is reversible (the next attempt can be allowed), so guard mode may hold one, unlike stopping a running process.

Two limits, stated plainly:

  • The path is read from the workload's memory while it waits. A workload with a second thread can change that memory between the check and the kernel's own read. This is a policy control for software that is not already hostile, not a sandbox against code that is.
  • It needs no privilege beyond NO_NEW_PRIVS, which also means a setuid binary in the workload no longer gains privileges when it runs.

Index

Constants

View Source
const ChildEnv = "__VULNETIX_EXECGUARD_CHILD"

ChildEnv marks the re-executed sensor that installs the filter and then becomes the workload.

Variables

This section is empty.

Functions

func MaybeChild

func MaybeChild()

MaybeChild runs the child half when this process is the re-executed sensor. Call it first thing in main; it does not return in the child.

func Run

func Run(command []string, decide Decider) (int, error)

Run starts command under the guard and returns its exit code.

Types

type Decider

type Decider func(Exec) error

Decider answers an exec: nil to allow, an error to refuse with EPERM.

type Exec

type Exec struct {
	PID  int
	Path string // absolute, resolved against the caller's working directory
	Argv []string
}

Exec is one program start the workload asked for.

Jump to

Keyboard shortcuts

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