socketfence

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package socketfence installs the operator-enabled Unix API boundary. Pins are intentionally independent of the service lifetime; Close never detaches it.

Index

Constants

View Source
const Capability = "bpf-lsm-unix-v1"
View Source
const CgroupRoot = "/sys/fs/cgroup/agent-workflow"
View Source
const PinRoot = "/sys/fs/bpf/agent-workflow"

Variables

This section is empty.

Functions

func Supported

func Supported() error

Types

type Boundary

type Boundary struct {
	State State
	Group *os.File
	// contains filtered or unexported fields
}

func Install

func Install(identity string, generation uint64, paths []string, authentication []Socket) (*Boundary, error)

Install runs only at explicit operator start, before launch admission opens. paths are runtime-owned sockets; authentication must retain registered identities.

func Restore

func Restore(state State) (*Boundary, error)

Restore verifies the exact retained kernel objects, never a replacement.

func (*Boundary) Check

func (b *Boundary) Check() error

func (*Boundary) Close

func (b *Boundary) Close()

func (*Boundary) Retire

func (b *Boundary) Retire() error

Retire removes only this generation after kernel proof that its subtree is empty. Failure leaves the pins and descriptor available for operator audit.

func (*Boundary) WaitEmpty

func (b *Boundary) WaitEmpty()

WaitEmpty retains ownership through uncertain cleanup, including service loss. Errors cannot prove emptiness and deliberately do not cancel this wait.

type Socket

type Socket struct {
	Path   string `json:"path"`
	Inode  uint64 `json:"inode"`
	Device uint32 `json:"device"`
}

func OpenSocket

func OpenSocket(path string) (Socket, *os.File, error)

type State

type State struct {
	Identity   string            `json:"identity"`
	Generation uint64            `json:"generation"`
	Cgroup     string            `json:"cgroup"`
	CgroupID   uint64            `json:"cgroup_id"`
	Pins       string            `json:"pins"`
	Programs   map[string]uint32 `json:"programs"`
	Maps       map[string]uint32 `json:"maps"`
	Sockets    []Socket          `json:"sockets"`
}

Jump to

Keyboard shortcuts

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