landjail

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyLandlockRestrictions

func ApplyLandlockRestrictions(logger *slog.Logger, cfg LandlockConfig) error

func Run

func Run(ctx context.Context, logger *slog.Logger, config config.AppConfig) error

Run is the main entry point that determines whether to execute as a parent or child process. If running as a child (CHILD env var is set), it applies landlock restrictions and executes the target command. Otherwise, it runs as the parent process, sets up the proxy server, and manages the child process lifecycle.

func RunChild

func RunChild(logger *slog.Logger, config config.AppConfig) error

func RunParent

func RunParent(ctx context.Context, logger *slog.Logger, config config.AppConfig) error

Types

type LandJail

type LandJail struct {
	// contains filtered or unexported fields
}

func NewLandJail

func NewLandJail(
	ruleEngine rulesengine.Engine,
	auditor audit.Auditor,
	tlsConfig *tls.Config,
	logger *slog.Logger,
	config config.AppConfig,
) (*LandJail, error)

func (*LandJail) Run

func (b *LandJail) Run(ctx context.Context) error

func (*LandJail) RunChildProcess

func (b *LandJail) RunChildProcess(command []string) error

type LandlockConfig

type LandlockConfig struct {
	// TODO(yevhenii):
	// - should it be able to bind to any port?
	// - should it be able to connect to any port on localhost?
	// BindTCPPorts    []int
	ConnectTCPPorts []int
}

Jump to

Keyboard shortcuts

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