Documentation
¶
Index ¶
- Constants
- Variables
- func ASLR()
- func BasicSysInfo()
- func CallAddedFunc()
- func CallBasics()
- func CheckAppArmor()
- func CheckCloudMetadataAPI()
- func CheckK8sAnonymousLogin() bool
- func CheckNamespaceIsolation()
- func CheckNetNamespace()
- func CheckPrivilegedK8sServiceAccount(tokenPath string) bool
- func CheckRouteLocalNetworkValue()
- func CheckSELinux()
- func CheckSeccompKernelSupport()
- func CheckSeccompStatus()
- func CommandAllow()
- func DNSBasedServiceDiscovery()
- func DumpCgroup()
- func FindSidFiles()
- func GetProcCapabilities() bool
- func MountEscape()
- func RegisterCheck(category CategorySpec, check Check, profiles ...string)
- func RegisterContextCheck(category CategorySpec, id, title string, fn CheckFunc, profiles ...string)
- func RegisterSimpleCheck(category CategorySpec, id, title string, fn func(), profiles ...string)
- func SearchAvailableCommands()
- func SearchLocalFilePath()
- func SearchSensitiveEnv()
- func SearchSensitiveService()
- type Category
- type CategorySpec
- type Check
- type CheckFunc
- type Context
- type Evaluator
- type Profile
Constants ¶
const ( ProfileBasic = "basic" ProfileExtended = "extended" ProfileAdditional = "additional" )
Variables ¶
var ( CategorySystemInfo = CategorySpec{ ID: "information.system", Title: "Information Gathering - System Info", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 100, } CategoryServices = CategorySpec{ ID: "information.services", Title: "Information Gathering - Services", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 200, } CategoryCommands = CategorySpec{ ID: "information.commands", Title: "Information Gathering - Commands and Capabilities", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 300, } CategoryMounts = CategorySpec{ ID: "information.mounts", Title: "Information Gathering - Mounts", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 400, } CategoryNetNamespace = CategorySpec{ ID: "information.netns", Title: "Information Gathering - Net Namespace", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 500, } CategorySysctl = CategorySpec{ ID: "information.sysctl", Title: "Information Gathering - Sysctl Variables", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 600, } CategoryDNS = CategorySpec{ ID: "information.dns", Title: "Information Gathering - DNS-Based Service Discovery", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 700, } CategoryK8sAPIServer = CategorySpec{ ID: "discovery.k8s_api", Title: "Discovery - K8s API Server", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 800, } CategoryK8sServiceAccount = CategorySpec{ ID: "discovery.k8s_sa", Title: "Discovery - K8s Service Account", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 900, } CategoryCloudMetadata = CategorySpec{ ID: "discovery.cloud_metadata", Title: "Discovery - Cloud Provider Metadata API", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 1000, } CategoryKernel = CategorySpec{ ID: "exploit.kernel", Title: "Exploit Pre - Kernel Exploits", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 1100, } CategorySensitiveFiles = CategorySpec{ ID: "information.sensitive_files", Title: "Information Gathering - Sensitive Files", DefaultProfiles: []string{ProfileExtended, ProfileAdditional}, Order: 1200, } CategoryASLR = CategorySpec{ ID: "information.aslr", Title: "Information Gathering - ASLR", DefaultProfiles: []string{ProfileExtended, ProfileAdditional}, Order: 1300, } CategoryCgroups = CategorySpec{ ID: "information.cgroups", Title: "Information Gathering - Cgroups", DefaultProfiles: []string{ProfileExtended, ProfileAdditional}, Order: 1400, } CategorySecurity = CategorySpec{ ID: "information.security", Title: "Information Gathering - Container Security", DefaultProfiles: []string{ProfileBasic, ProfileExtended}, Order: 1500, } )
var RouteLocalNetProcPath = "/proc/sys/net/ipv4/conf/all/route_localnet"
Functions ¶
func BasicSysInfo ¶
func BasicSysInfo()
func CallAddedFunc ¶ added in v1.4.1
func CallAddedFunc()
CallAddedFunc executes the additional evaluation profile.
func CallBasics ¶ added in v1.4.1
func CallBasics()
CallBasics executes the baseline evaluation profile.
func CheckAppArmor ¶ added in v1.5.6
func CheckAppArmor()
CheckAppArmor inspects kernel compile options, boot parameters, runtime status, and the active AppArmor profile for the current process.
func CheckCloudMetadataAPI ¶
func CheckCloudMetadataAPI()
func CheckK8sAnonymousLogin ¶
func CheckK8sAnonymousLogin() bool
func CheckNamespaceIsolation ¶ added in v1.5.6
func CheckNamespaceIsolation()
CheckNamespaceIsolation compares /proc/1/ns/<ns> and /proc/self/ns/<ns> for each namespace type. If the symlink targets differ, the namespace is isolated.
func CheckNetNamespace ¶
func CheckNetNamespace()
func CheckPrivilegedK8sServiceAccount ¶ added in v1.0.1
func CheckRouteLocalNetworkValue ¶
func CheckRouteLocalNetworkValue()
func CheckSELinux ¶ added in v1.5.6
func CheckSELinux()
CheckSELinux detects whether SELinux is present and enforcing.
func CheckSeccompKernelSupport ¶ added in v1.5.6
func CheckSeccompKernelSupport()
CheckSeccompKernelSupport reports whether the running kernel was compiled with Seccomp support by checking for the Seccomp field in /proc/self/status and, optionally, the kernel config.
func CheckSeccompStatus ¶ added in v1.5.6
func CheckSeccompStatus()
CheckSeccompStatus reads the Seccomp field from /proc/self/status and reports whether Seccomp is disabled (0), strict (1), or filter (2) mode.
func DNSBasedServiceDiscovery ¶ added in v1.1.0
func DNSBasedServiceDiscovery()
https://github.com/kubernetes/dns/blob/master/docs/specification.md
func DumpCgroup ¶ added in v1.1.0
func DumpCgroup()
func FindSidFiles ¶ added in v1.4.1
func FindSidFiles()
FindSidFiles such as run `find /bin/. -perm -4000 -type f `
func GetProcCapabilities ¶
func GetProcCapabilities() bool
func MountEscape ¶
func MountEscape()
func RegisterCheck ¶ added in v1.5.6
func RegisterCheck(category CategorySpec, check Check, profiles ...string)
RegisterCheck registers a check with the given category and optional profile list.
func RegisterContextCheck ¶ added in v1.5.6
func RegisterContextCheck(category CategorySpec, id, title string, fn CheckFunc, profiles ...string)
RegisterContextCheck registers a check backed by a function that consumes Context.
func RegisterSimpleCheck ¶ added in v1.5.6
func RegisterSimpleCheck(category CategorySpec, id, title string, fn func(), profiles ...string)
RegisterSimpleCheck registers a check backed by a parameterless function.
func SearchAvailableCommands ¶
func SearchAvailableCommands()
func SearchLocalFilePath ¶
func SearchLocalFilePath()
func SearchSensitiveEnv ¶
func SearchSensitiveEnv()
func SearchSensitiveService ¶
func SearchSensitiveService()
Types ¶
type CategorySpec ¶ added in v1.5.6
CategorySpec describes where a check is shown and its display metadata.
type Context ¶ added in v1.5.6
Context carries shared dependencies for evaluation checks.
func NewContext ¶ added in v1.5.6
NewContext constructs a Context instance with a default logger when none is provided.
type Evaluator ¶ added in v1.5.6
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator coordinates profile registration and execution.
func NewEvaluator ¶ added in v1.5.6
func NewEvaluator() *Evaluator
NewEvaluator returns an Evaluator with the default profiles registered.
func (*Evaluator) Profile ¶ added in v1.5.6
Profile returns a copy of the profile and a boolean indicating whether it exists.
func (*Evaluator) Profiles ¶ added in v1.5.6
Profiles returns the registered profiles sorted by their identifier.
func (*Evaluator) RegisterProfile ¶ added in v1.5.6
RegisterProfile adds or replaces a profile definition.
Source Files
¶
- available_linux_capabilities.go
- available_linux_commands.go
- categories.go
- cgroups.go
- check_mount_escape.go
- cloud_metadata_api.go
- engine.go
- evaluate.go
- k8s_anonymous_login.go
- k8s_service_account.go
- kernel.go
- network_namespace.go
- registry.go
- security_info.go
- sensitive_env.go
- sensitive_local_file_path.go
- sensitive_service.go
- service_discovery_dns.go.go
- sysctl_vars.go
- system_info.go