seccomp

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateProfilePath

func GenerateProfilePath(containerID string) string

GenerateProfilePath returns the path for a container's seccomp profile.

func SaveProfile

func SaveProfile(path string, profile *Profile) error

SaveProfile saves a seccomp profile to a JSON file.

Types

type ArgRule

type ArgRule struct {
	Index    uint   `json:"index"`
	Value    uint64 `json:"value"`
	ValueTwo uint64 `json:"valueTwo,omitempty"`
	Op       string `json:"op"`
}

ArgRule defines argument filtering for syscalls.

type Profile

type Profile struct {
	DefaultAction string        `json:"defaultAction"`
	Architectures []string      `json:"architectures,omitempty"`
	Syscalls      []SyscallRule `json:"syscalls,omitempty"`
	Flags         []string      `json:"flags,omitempty"`
}

Profile represents a seccomp security profile.

func DefaultProfile

func DefaultProfile() *Profile

DefaultProfile returns the default Doki seccomp profile. This blocks dangerous syscalls while allowing normal container operation. Updated to include AF_ALG block per CVE-2026-31431.

func LoadProfile

func LoadProfile(path string) (*Profile, error)

LoadProfile loads a seccomp profile from a JSON file.

func PrivilegedProfile

func PrivilegedProfile() *Profile

func UnconfinedProfile

func UnconfinedProfile() *Profile

func (*Profile) FilterAllowed

func (p *Profile) FilterAllowed() []string

FilterAllowed returns only the allowed syscalls from a profile.

func (*Profile) FilterBlocked

func (p *Profile) FilterBlocked() []string

FilterBlocked returns only the blocked syscalls from a profile.

type SyscallRule

type SyscallRule struct {
	Names  []string  `json:"names"`
	Action string    `json:"action"`
	Args   []ArgRule `json:"args,omitempty"`
}

SyscallRule defines allowed/blocked syscalls.

Jump to

Keyboard shortcuts

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