Documentation
¶
Index ¶
- func ExtractPodOwner(pod *corev1.Pod, clientset kubernetes.Interface) (string, string, string, string)
- func GetContainerID(pod *corev1.Pod, containerName string) string
- func GetContainerImage(pod *corev1.Pod, containerName string) string
- func GetContainerImageDigest(pod *corev1.Pod, containerName string) string
- func GetContainerNameFromExecToPodEvent(event admission.Attributes) (string, error)
- func GetControllerDetails(event admission.Attributes, clientset kubernetes.Interface) (*corev1.Pod, string, string, string, string, string, error)
- func GetPodDetails(clientset kubernetes.Interface, podName, namespace string) (*corev1.Pod, error)
- type GenericRuleFailure
- func (rule *GenericRuleFailure) GetAdmissionsAlert() apitypes.AdmissionAlert
- func (rule *GenericRuleFailure) GetBaseRuntimeAlert() apitypes.BaseRuntimeAlert
- func (rule *GenericRuleFailure) GetRuleAlert() apitypes.RuleAlert
- func (rule *GenericRuleFailure) GetRuleId() string
- func (rule *GenericRuleFailure) GetRuntimeAlertK8sDetails() apitypes.RuntimeAlertK8sDetails
- func (rule *GenericRuleFailure) GetRuntimeProcessDetails() apitypes.ProcessTree
- func (rule *GenericRuleFailure) SetAdmissionsAlert(admissionsAlert apitypes.AdmissionAlert)
- func (rule *GenericRuleFailure) SetBaseRuntimeAlert(baseRuntimeAlert apitypes.BaseRuntimeAlert)
- func (rule *GenericRuleFailure) SetRuleAlert(ruleAlert apitypes.RuleAlert)
- func (rule *GenericRuleFailure) SetRuntimeAlertK8sDetails(runtimeAlertK8sDetails apitypes.RuntimeAlertK8sDetails)
- func (rule *GenericRuleFailure) SetRuntimeProcessDetails(runtimeProcessDetails apitypes.ProcessTree)
- func (rule *GenericRuleFailure) SetWorkloadDetails(workloadDetails string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractPodOwner ¶
func ExtractPodOwner(pod *corev1.Pod, clientset kubernetes.Interface) (string, string, string, string)
ExtractPodOwner returns the kind, name, namespace, and UID of the controller that owns the pod. The UID is captured from OwnerReferences or during resolution to avoid duplicate API calls.
func GetContainerID ¶ added in v0.2.128
GetContainerID returns the container ID for the given container name from the pod status. It checks regular containers, init containers, and ephemeral containers. When containerName is empty, falls back to the first container (matching Kubernetes default behavior). Returns an empty string if the container is not found or pod is nil.
func GetContainerImage ¶ added in v0.2.131
GetContainerImage returns the container image name for the given container name from the pod spec. When containerName is empty, falls back to the first container (matching Kubernetes default behavior).
func GetContainerImageDigest ¶ added in v0.2.131
GetContainerImageDigest returns the image digest (from ImageID) for the given container name from the pod status. The "docker-pullable://" prefix is stripped so the result is a clean registry digest reference. When containerName is empty, falls back to the first container (matching Kubernetes default behavior).
func GetContainerNameFromExecToPodEvent ¶
func GetContainerNameFromExecToPodEvent(event admission.Attributes) (string, error)
GetContainerNameFromExecToPodEvent returns the container name from the admission event for exec operations.
func GetControllerDetails ¶
func GetControllerDetails(event admission.Attributes, clientset kubernetes.Interface) (*corev1.Pod, string, string, string, string, string, error)
GetControllerDetails returns the pod and controller details (pod, kind, name, namespace, uid, and node name). The workload UID is captured during owner resolution to avoid duplicate API calls.
func GetPodDetails ¶
GetPodDetails returns the pod details from the Kubernetes API server.
Types ¶
type GenericRuleFailure ¶
type GenericRuleFailure struct {
BaseRuntimeAlert apitypes.BaseRuntimeAlert
RuntimeProcessDetails apitypes.ProcessTree
RuleAlert apitypes.RuleAlert
AdmissionAlert apitypes.AdmissionAlert
RuntimeAlertK8sDetails apitypes.RuntimeAlertK8sDetails
RuleID string
}
func (*GenericRuleFailure) GetAdmissionsAlert ¶
func (rule *GenericRuleFailure) GetAdmissionsAlert() apitypes.AdmissionAlert
func (*GenericRuleFailure) GetBaseRuntimeAlert ¶
func (rule *GenericRuleFailure) GetBaseRuntimeAlert() apitypes.BaseRuntimeAlert
func (*GenericRuleFailure) GetRuleAlert ¶
func (rule *GenericRuleFailure) GetRuleAlert() apitypes.RuleAlert
func (*GenericRuleFailure) GetRuleId ¶
func (rule *GenericRuleFailure) GetRuleId() string
func (*GenericRuleFailure) GetRuntimeAlertK8sDetails ¶
func (rule *GenericRuleFailure) GetRuntimeAlertK8sDetails() apitypes.RuntimeAlertK8sDetails
func (*GenericRuleFailure) GetRuntimeProcessDetails ¶
func (rule *GenericRuleFailure) GetRuntimeProcessDetails() apitypes.ProcessTree
func (*GenericRuleFailure) SetAdmissionsAlert ¶
func (rule *GenericRuleFailure) SetAdmissionsAlert(admissionsAlert apitypes.AdmissionAlert)
func (*GenericRuleFailure) SetBaseRuntimeAlert ¶
func (rule *GenericRuleFailure) SetBaseRuntimeAlert(baseRuntimeAlert apitypes.BaseRuntimeAlert)
func (*GenericRuleFailure) SetRuleAlert ¶
func (rule *GenericRuleFailure) SetRuleAlert(ruleAlert apitypes.RuleAlert)
func (*GenericRuleFailure) SetRuntimeAlertK8sDetails ¶
func (rule *GenericRuleFailure) SetRuntimeAlertK8sDetails(runtimeAlertK8sDetails apitypes.RuntimeAlertK8sDetails)
func (*GenericRuleFailure) SetRuntimeProcessDetails ¶
func (rule *GenericRuleFailure) SetRuntimeProcessDetails(runtimeProcessDetails apitypes.ProcessTree)
func (*GenericRuleFailure) SetWorkloadDetails ¶
func (rule *GenericRuleFailure) SetWorkloadDetails(workloadDetails string)