libseccomp

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package libseccomp provides a wrapper for "github.com/seccomp/libseccomp-golang"

Index

Constants

View Source
const (
	MsgDisallow int16 = iota + 1
	MsgHandle
)

MsgDisallow, Msghandle defines the action needed when trapped by seccomp filter

Variables

This section is empty.

Functions

func ExportBPF

func ExportBPF(filter []bpf.Instruction) (seccomp.Filter, error)

ExportBPF convert libseccomp filter to kernel readable BPF content

func ToSeccompAction

func ToSeccompAction(a Action) libseccomp.Action

ToSeccompAction convert action to libseccomp compatible action

func ToSyscallName

func ToSyscallName(sysno uint) (string, error)

ToSyscallName convert syscallno to syscall name

Types

type Action added in v0.6.0

type Action uint32

Action is seccomp trap action

const (
	ActionAllow Action = iota + 1
	ActionErrno
	ActionTrace
	ActionKill
)

Action defines seccomp action to the syscall default value 0 is invalid

func (Action) Action added in v0.6.0

func (a Action) Action() Action

Action get the basic action

type Builder

type Builder struct {
	Allow, Trace []string
	Default      Action
}

Builder is used to build the filter

func (*Builder) Build

func (b *Builder) Build() (seccomp.Filter, error)

Build builds the filter

Jump to

Keyboard shortcuts

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