seccomp

package
v0.0.0-...-c7fba9c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Actions

func Actions() []string

Actions returns a sorted list of seccomp actions like []string{"allow", "errno", "kill", "log", "trace", "trap"}.

func MockActions

func MockActions(actions []string) (restore func())

func MockCompilerVersionInfo

func MockCompilerVersionInfo(versionInfo string) (restore func())

MockCompilerVersionInfo mocks the return value of CompilerVersionInfo.

func SupportsAction

func SupportsAction(action string) bool

Types

type BuildTimeRequirementError

type BuildTimeRequirementError struct {
	Feature      string
	Requirements []string
}

BuildTimeRequirementError represents the error case of a feature that cannot be supported because of unfulfilled build time requirements.

func (*BuildTimeRequirementError) Error

func (e *BuildTimeRequirementError) Error() string

func (*BuildTimeRequirementError) RequirementsString

func (e *BuildTimeRequirementError) RequirementsString() string

type Compiler

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

func NewCompiler

func NewCompiler(lookupTool func(name string) (string, error)) (*Compiler, error)

NewCompiler returns a wrapper for the compiler binary. The path to the binary is looked up using the lookupTool helper.

func (*Compiler) Compile

func (c *Compiler) Compile(in, out string) error

Compile compiles given source profile and saves the result to the out location.

func (*Compiler) VersionInfo

func (c *Compiler) VersionInfo() (VersionInfo, error)

VersionInfo returns the version information of the compiler. The format of version information is: <build-id> <libseccomp-version> <hash> <features>. Where, the hash is calculated over all syscall names supported by the libseccomp library.

type VersionInfo

type VersionInfo string

VersionInfo represents information about the seccomp compiler

func CompilerVersionInfo

func CompilerVersionInfo(lookupTool func(name string) (string, error)) (VersionInfo, error)

CompilerVersionInfo returns the version information of snap-seccomp looked up via lookupTool.

func (VersionInfo) Features

func (vi VersionInfo) Features() (string, error)

Features parses the output of VersionInfo and provides the golang seccomp features

func (VersionInfo) HasFeature

func (vi VersionInfo) HasFeature(feature string) (bool, error)

HasFeature parses the output of VersionInfo and answers whether or not golang-seccomp supports the feature

func (VersionInfo) LibseccompVersion

func (vi VersionInfo) LibseccompVersion() (string, error)

LibseccompVersion parses VersionInfo and provides the libseccomp version

func (VersionInfo) SupportsRobustArgumentFiltering

func (vi VersionInfo) SupportsRobustArgumentFiltering() error

SupportsRobustArgumentFiltering parses the output of VersionInfo and determines if libseccomp and golang-seccomp are new enough to support robust argument filtering

Jump to

Keyboard shortcuts

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