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 ¶
const ( Standard = "standard" Extended = "extended" )
The IDs of the catalog (also the names the frontends translate).
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.
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 ¶
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).
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 ¶
Enabled is the validated list of profile IDs the cluster offers; unknown IDs are an error.
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.
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