Versions in this module Expand all Collapse all v0 v0.2.253 Apr 7, 2025 Changes in this version + const Container + const ContainerAllowed + const EphemeralContainer + const ErrKernelVersion + const ErrMacOS + const ExitCodeError + const ExitCodeIncompatibleKernel + const ExitCodeMacOS + const ExitCodeRuncNotFound + const ExitCodeSuccess + const InitContainer + const ProcessAllowed + const Unknown + var ContainerHasTerminatedError = errors.New("container has terminated") + var ContainerReachedMaxTime = errors.New("container reached max time") + var ObjectCompleted = errors.New("object is completed") + var TooLargeObjectError = errors.New("object is too large") + func AddJitter(duration time.Duration, maxJitterPercentage int) time.Duration + func After(value string, a string) string + func Atoi(s string) int + func Between(value string, a string, b string) string + func CalculateFileHashes(path string) (sha1Hash string, md5Hash string, err error) + func CalculateSHA256FileExecHash(path string, args []string) string + func CalculateSHA256FileOpenHash(path string) string + func ChunkBy[T any](items []T, chunkSize int) [][]T + func CreateK8sContainerID(namespaceName string, podName string, containerName string) string + func CreateK8sPodID(namespaceName string, podName string) string + func CreateProcessTree(process *apitypes.Process, shimPid uint32) (*apitypes.Process, error) + func CurrentDir() string + func DiskUsage(path string) int64 + func EnrichApplicationProfileContainer(container *v1beta1.ApplicationProfileContainer, ...) + func EnrichNeighborhoodContainer(container *v1beta1.NetworkNeighborhoodContainer, ...) + func EscapeJSONPointerElement(s string) string + func GenerateNeighborsIdentifier(neighborEntry v1beta1.NetworkNeighbor) (string, error) + func GetApplicationProfileContainer(object *v1beta1.ApplicationProfile, containerType ContainerType, ...) *v1beta1.ApplicationProfileContainer + func GetCmdlineByPid(pid int) (*string, error) + func GetCommFromPid(pid uint32) (string, error) + func GetContainerStatuses(podStatus v1.PodStatus) []v1.ContainerStatus + func GetExecArgsFromEvent(event *tracerexectype.Event) []string + func GetExecPathFromEvent(event *tracerexectype.Event) string + func GetFileSize(path string) (int64, error) + func GetHostFilePathFromEvent(event K8sEvent, containerPid uint32) (string, error) + func GetLabels(watchedContainer *WatchedContainerData, stripContainer bool) map[string]string + func GetNamespaceMatchLabels(destinationNamespace, sourceNamespace string) map[string]string + func GetNetworkNeighborhoodContainer(object *v1beta1.NetworkNeighborhood, containerType ContainerType, ...) *v1beta1.NetworkNeighborhoodContainer + func GetPathFromPid(pid uint32) (string, error) + func GetProcessEnv(pid int) (map[string]string, error) + func GetProcessFromProcessTree(process *apitypes.Process, pid uint32) *apitypes.Process + func GetProcessStat(pid int) (*procfs.ProcStat, error) + func IsSensitivePath(fullPath string, paths []string) bool + func MapContainerStatuses(statuses []v1.ContainerStatus) map[string]v1.ContainerStatus + func MergePolicies(primary, secondary v1beta1.RulePolicy) v1beta1.RulePolicy + func NormalizeImageName(image string) string + func RandomDuration(max int, duration time.Duration) time.Duration + func SetInMap(newExecMap *maps.SafeMap[string, mapset.Set[string]]) func(k string, v mapset.Set[string]) bool + func TrimRuntimePrefix(id string) string + type ContainerInfo struct + ImageID string + ImageTag string + Name string + type ContainerType int + func (c ContainerType) String() string + type EnrichEvent interface + GetBaseEvent func() *types.Event + GetExtra func() interface{} + GetPID func() uint64 + SetExtra func(extra interface{}) + type EventType string + const AllEventType + const CapabilitiesEventType + const DnsEventType + const ExecveEventType + const HTTPEventType + const HardlinkEventType + const IoUringEventType + const NetworkEventType + const OpenEventType + const PtraceEventType + const RandomXEventType + const SSHEventType + const SymlinkEventType + const SyscallEventType + type K8sEvent interface + GetNamespace func() string + GetPod func() string + type PatchOperation struct + Op string + Path string + Value interface{} + func AppendStatusAnnotationPatchOperations(existingPatch []PatchOperation, watchedContainer *WatchedContainerData) []PatchOperation + func CreateCapabilitiesPatchOperations(capabilities, syscalls []string, execs map[string][]string, ...) []PatchOperation + func CreateNetworkPatchOperations(ingress, egress []v1beta1.NetworkNeighbor, containerType string, ...) []PatchOperation + type WatchedContainerCompletionStatus string + const WatchedContainerCompletionStatusFull + const WatchedContainerCompletionStatusPartial + type WatchedContainerData struct + ContainerID string + ContainerIndex int + ContainerInfos map[ContainerType][]ContainerInfo + ContainerType ContainerType + ImageID string + ImageTag string + InitialDelayExpired bool + InstanceID instanceidhandler.IInstanceID + K8sContainerID string + NsMntId uint64 + ParentResourceVersion string + ParentWorkloadSelector *metav1.LabelSelector + PreRunningContainer bool + RelevantArtifactsFilesByIdentifier map[string]bool + RelevantRealtimeFilesByIdentifier map[string]bool + RelevantRelationshipsArtifactsByIdentifier map[string]bool + SeccompProfilePath *string + SyncChannel chan error + TemplateHash string + UpdateDataTicker *time.Ticker + Wlid string + func (watchedContainer *WatchedContainerData) GetCompletionStatus() WatchedContainerCompletionStatus + func (watchedContainer *WatchedContainerData) GetStatus() WatchedContainerStatus + func (watchedContainer *WatchedContainerData) ResetStatusUpdatedFlag() + func (watchedContainer *WatchedContainerData) SetCompletionStatus(newStatus WatchedContainerCompletionStatus) + func (watchedContainer *WatchedContainerData) SetContainerInfo(wl workloadinterface.IWorkload, containerName string) error + func (watchedContainer *WatchedContainerData) SetStatus(newStatus WatchedContainerStatus) + func (watchedContainer *WatchedContainerData) StatusUpdated() bool + type WatchedContainerStatus string + const WatchedContainerStatusCompleted + const WatchedContainerStatusInitializing + const WatchedContainerStatusMissingRuntime + const WatchedContainerStatusReady + const WatchedContainerStatusTooLarge