openexecmgr

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoHookExecutes = errors.New("no open/exec hook executes on this node")

ErrNoHookExecutes means neither the BPF-LSM nor the fmod_ret dispatchers could be attached and shown to run, so no open or exec rule can be enforced or observed on this node.

Functions

This section is empty.

Types

type CgroupSink

type CgroupSink interface {
	AddCgids(cgids []uint64) error
	DeleteCgids(cgids []uint64) error
}

CgroupSink is an observation-only kernel source that must see events from the same pods the exec policies select, and from no others.

type OpenExecManager

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

func NewOpenExecManager

func NewOpenExecManager(logger logr.Logger, status runtimeevent.PolicyStatusRecorder, onLoss runtimeevent.LossFunc, lsm bool, cgroupSinks ...CgroupSink) *OpenExecManager

NewOpenExecManager returns a manager even when the hooks cannot be set up: that manager fails every open and exec policy with the cause, so a node that can enforce nothing reports it on each policy instead of reading as Enforcing. lsm is the active LSM list's answer and only decides which hook type is tried first.

func (*OpenExecManager) CollectObservations

func (l *OpenExecManager) CollectObservations(ctx context.Context) ([]runtimeevent.Event, error)

CollectObservations drains the per-cgroup path counters of every enforcer from open/exec. Reading drains events, and hence reported counts represent events since the last drain.

func (*OpenExecManager) HooksUnavailable added in v0.1.3

func (l *OpenExecManager) HooksUnavailable() error

HooksUnavailable returns why no open/exec hook executes on this node, or nil when a verified hook type is attached.

func (*OpenExecManager) PodDeleted

func (l *OpenExecManager) PodDeleted(uid string) error

PodDeleted removes the pod's cgroups from every attached program and drops its bookkeeping.

func (*OpenExecManager) PodEvent

func (l *OpenExecManager) PodEvent(pod corev1.Pod, nsLabels map[string]string, cgInfos []*containers.ContainerCgroupInfo, eventType string) error

func (*OpenExecManager) RuntimePolicyEvent

func (l *OpenExecManager) RuntimePolicyEvent(compiledRb *compiler.EvaluationResult, eventType string) error

Jump to

Keyboard shortcuts

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