types

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleLabel = "kubernetes.io/role"
	Worker    = "node"
	Master    = "master"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppArmorProfile

type AppArmorProfile struct {
	Name  string
	Rules string

	/*
			capability net_raw,
			capability setuid,
			capability setgid,
			capability dac_override,
			network raw,
			network packet,

			# for -D
			capability sys_module,
			@{PROC}/bus/usb/ r,
			@{PROC}/bus/usb/** r,

		  	audit deny @{HOME}/bin/ rw,
		  	audit deny @{HOME}/bin/** mrwkl,
		 	 @{HOME}/ r,
		  	@{HOME}/** rw,

		  	/usr/sbin/tcpdump r,
	*/
	Enforced bool
}

func (AppArmorProfile) String

func (p AppArmorProfile) String() string

type AppArmorProfileStatus

type AppArmorProfileStatus struct {
	Profiles map[string]string `json:"profiles"`
}

func NewAppArmorStatus

func NewAppArmorStatus() *AppArmorProfileStatus

NewAppArmorStatus return apparmor profile status from workder nodes

func (*AppArmorProfileStatus) GetEnforcedProfiles

func (s *AppArmorProfileStatus) GetEnforcedProfiles() []string

GetEnforcedProfiles get enforced profile names

type Node

type Node struct {
	NodeName        string
	ExternalIP      string
	InternalIP      string
	Role            string
	AppArmorEnabled bool
	AppArmorStatus  *AppArmorProfileStatus
}

func NewNode

func NewNode() *Node

NewNode returns a new node object

func (*Node) IsMaster

func (n *Node) IsMaster() bool

IsMaster checks whether a node is master node

type NodeList

type NodeList []*Node

func (NodeList) GetEnforcedProfiles

func (nl NodeList) GetEnforcedProfiles() string

func (NodeList) PrintEnabledStatus

func (nl NodeList) PrintEnabledStatus()

PrintEnabledStatus prints AppArmor enabled status on worker nodes

func (NodeList) PrintEnforcementStatus

func (nl NodeList) PrintEnforcementStatus()

PrintEnforcementStatus prints enforced AppArmor profile on worker nodes

func (NodeList) String

func (nl NodeList) String() string

Jump to

Keyboard shortcuts

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