bpfrecorder

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no recorded profile found")

ErrNotFound is the GRPC error if no recorded profile found.

Functions

func BPFLSMEnabled added in v0.8.4

func BPFLSMEnabled() bool

func Dial

Dial can be used to connect to the default GRPC server by creating a new client.

Types

type AppArmorRecorder added in v0.8.4

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

func (*AppArmorRecorder) GetAppArmorProcessed added in v0.8.4

func (b *AppArmorRecorder) GetAppArmorProcessed() BpfAppArmorProcessed

func (*AppArmorRecorder) Load added in v0.8.4

func (*AppArmorRecorder) Unload added in v0.8.4

func (b *AppArmorRecorder) Unload()

type BpfAppArmorFileProcessed added in v0.8.3

type BpfAppArmorFileProcessed struct {
	AllowedExecutables []string
	AllowedLibraries   []string
	ReadOnlyPaths      []string
	WriteOnlyPaths     []string
	ReadWritePaths     []string
}

type BpfAppArmorProcessed added in v0.8.3

type BpfAppArmorProcessed struct {
	FileProcessed BpfAppArmorFileProcessed
	Socket        BpfAppArmorSocketTypes
	Capabilities  []string
}

type BpfAppArmorSocketTypes added in v0.8.4

type BpfAppArmorSocketTypes struct {
	UseRaw bool
	UseTCP bool
	UseUDP bool
}

type BpfRecorder

type BpfRecorder struct {
	api.UnimplementedBpfRecorderServer

	AppArmor *AppArmorRecorder
	Seccomp  *SeccompRecorder
	// contains filtered or unexported fields
}

BpfRecorder is the main structure of this package.

func New

func New(programName string, logger logr.Logger, recordSeccomp, recordAppArmor bool) *BpfRecorder

New returns a new BpfRecorder instance.

func (*BpfRecorder) FindProcMountNamespace added in v0.7.0

func (b *BpfRecorder) FindProcMountNamespace(pid uint32) (uint32, error)

FindProcMountNamespace is looking up the mnt ns for a given PID.

func (*BpfRecorder) Load added in v0.7.0

func (b *BpfRecorder) Load(startEventProcessor bool) (err error)

Load prestarts the bpf recorder.

func (*BpfRecorder) Run

func (b *BpfRecorder) Run() error

Run the BpfRecorder.

func (*BpfRecorder) Start

func (*BpfRecorder) Stop

func (*BpfRecorder) Syscalls added in v0.7.0

func (b *BpfRecorder) Syscalls() *bpf.BPFMap

Syscalls returns the bpf map containing the PID (key) to syscalls (value) data.

func (*BpfRecorder) SyscallsForProfile

func (b *BpfRecorder) SyscallsForProfile(
	_ context.Context, r *api.ProfileRequest,
) (*api.SyscallsResponse, error)

SyscallsForProfile returns the syscall names for the provided profile name.

func (*BpfRecorder) Unload added in v0.7.0

func (b *BpfRecorder) Unload()

Unload can be used to reset the bpf recorder.

func (*BpfRecorder) WaitForPidExit added in v0.8.3

func (b *BpfRecorder) WaitForPidExit(ctx context.Context, pid uint32) error

When running outside of Kubernetes as spoc, we have the use case of waiting for a specific PID to exit.

type SeccompRecorder added in v0.8.4

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

func (*SeccompRecorder) Load added in v0.8.4

func (s *SeccompRecorder) Load(b *BpfRecorder) error

func (*SeccompRecorder) PopSyscalls added in v0.8.4

func (s *SeccompRecorder) PopSyscalls(b *BpfRecorder, mntns uint32) ([]string, error)

func (*SeccompRecorder) Unload added in v0.8.4

func (s *SeccompRecorder) Unload()

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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