runtime

package
v0.0.0-...-3388463 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CAP_PRIVILEGED uint64 = 0x3ffffffff

ref: https://fossd.anu.edu.au/linux/latest/source/include/uapi/linux/capability.h Linux Kernel >= 3.5 (CentOS >= 7, Ubuntu >= 12.10) const CAP_PRIVILEGED uint64 = 0x1fffffffff Linux Kernal >= 2.6.25 (CentOS >= 6, Ubuntu >= 8.10)

View Source
const CAP_SYS_ADMIN uint64 = 1 << 21
View Source
const CAP_SYS_RESOURCE uint64 = 1 << 24

Variables

This section is empty.

Functions

This section is empty.

Types

type Kernel

type Kernel interface {
	List() []*KernelParam
}

func CurrentKernel

func CurrentKernel() Kernel

type KernelParam

type KernelParam struct {
	Key         string
	Description string
	Value       string
	IsMatch     bool
}

func NewFileKernalParam

func NewFileKernalParam(key, fileName string, defaultValue int, defaultIsMaxValue bool) *KernelParam

type RuntimePermission

type RuntimePermission interface {
	// is running in container
	IsInContainer() bool

	// has privileged
	HasPrivileged() bool

	// has cap_sys_admin
	HasSysAdminPermission() bool

	// has sys mount permission
	HasSysMountPermission() bool

	HasSetOOMScorePermission() bool

	HasChrootPermission() bool
}
var Permission RuntimePermission

Jump to

Keyboard shortcuts

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