profiles

package
v1.7.4 Latest Latest
Warning

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

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

Documentation

Overview

Package profiles is the fixed catalog of device security profiles. A profile has a stable ID; the laboratory settings only say which catalog profiles are enabled on the cluster, and authors choose among them: there is no per-capability choice. The catalog lives in the code on purpose: capabilities are a platform decision.

Index

Constants

View Source
const (
	Standard = "standard"
	Extended = "extended"
)

The IDs of the catalog (also the names the frontends translate).

View Source
const PingGroupRange = "0 65535"

PingGroupRange is the value of net.ipv4.ping_group_range of every device: unprivileged ICMP echo sockets for the groups 0 to 65535, so `ping` works without NET_RAW. The upper bound must lie inside the group mapping of the pod: with hostUsers: false (a user namespace of 65536 ids) a larger bound makes runc fail the sysctl write ("invalid argument") and the pod never starts. It is the same range with and without a user namespace.

View Source
const TUNResource = "cybericebox.com/tun"

TUNResource is the extended resource a device plugin of the node-agent advertises; a pod that requests it gets /dev/net/tun and nothing else from the host.

Variables

View Source
var Base = []string{
	"AUDIT_WRITE", "CHOWN", "DAC_OVERRIDE", "FOWNER", "FSETID", "KILL", "NET_BIND_SERVICE", "SETGID", "SETPCAP", "SETUID", "SYS_CHROOT",
}

Base is the capability set of every device after "drop ALL". Privilege escalation stays allowed (sudo, setuid).

View Source
var Never = []string{
	"SYS_ADMIN", "SYS_MODULE", "SYS_RAWIO", "SYS_TIME", "SYS_BOOT", "DAC_READ_SEARCH", "BPF", "PERFMON", "SYSLOG",
	"AUDIT_CONTROL", "MAC_ADMIN", "MAC_OVERRIDE", "MKNOD",
}

Never are the capabilities no profile (and no setting) adds.

Functions

func Enabled

func Enabled(list []string) ([]string, error)

Enabled is the validated list of profile IDs the cluster offers; unknown IDs are an error.

func IDs

func IDs() []string

IDs lists the catalog.

func IsEnabled

func IsEnabled(name string, enabled []string) bool

IsEnabled says whether the profile a spec names (an ID or empty) is among the enabled IDs.

func Resolve

func Resolve(name string) (string, bool)

Resolve maps a name from a spec (a catalog ID or empty, which means standard) to a catalog ID.

Types

type Profile

type Profile struct {
	ID string
	// Caps are added to Base.
	Caps []string
	// TUN: the device gets /dev/net/tun through the device plugin.
	TUN bool
}

Profile is one entry of the catalog.

func Get

func Get(name string) Profile

Get is the profile of a name from a spec; an unknown name gets the standard profile (the CRD refuses it anyway).

type UnknownError

type UnknownError struct{ ID string }

UnknownError names a profile that is not in the catalog.

func (*UnknownError) Error

func (e *UnknownError) Error() string

Jump to

Keyboard shortcuts

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