Documentation
¶
Index ¶
- func InitServicePeerLabelResolver(k8sClient k8sclient.K8sClientInterface)
- func InitServicePeerLabelResolverWithCache(k8sClient k8sclient.K8sClientInterface, size int, ttl time.Duration)
- func RuleAppliesToContext(rule *typesv1.Rule, contextInfo contextdetection.ContextInfo) bool
- type RuleManager
- func (rm *RuleManager) ContainerCallback(notif containercollection.PubSubEvent)
- func (rm *RuleManager) EvaluatePolicyRulesForEvent(eventType utils.EventType, event utils.K8sEvent) []string
- func (rm *RuleManager) HasApplicableRuleBindings(namespace, name string) bool
- func (rm *RuleManager) HasFinalApplicationProfile(pod *corev1.Pod) bool
- func (rm *RuleManager) IsContainerMonitored(k8sContainerID string) bool
- func (rm *RuleManager) IsPodMonitored(namespace, pod string) bool
- func (rm *RuleManager) ReportEnrichedEvent(enrichedEvent *events.EnrichedEvent)
- type RuleManagerClient
- type RuleManagerMock
- func (r RuleManagerMock) ContainerCallback(notif containercollection.PubSubEvent)
- func (r RuleManagerMock) EvaluatePolicyRulesForEvent(eventType utils.EventType, event utils.K8sEvent) []string
- func (r RuleManagerMock) HasApplicableRuleBindings(namespace, name string) bool
- func (r RuleManagerMock) HasFinalApplicationProfile(pod *corev1.Pod) bool
- func (r RuleManagerMock) IsContainerMonitored(k8sContainerID string) bool
- func (r RuleManagerMock) IsPodMonitored(namespace, pod string) bool
- func (r RuleManagerMock) ReportEnrichedEvent(enrichedEvent *events.EnrichedEvent)
- type RulePolicyValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitServicePeerLabelResolver ¶ added in v0.3.273
func InitServicePeerLabelResolver(k8sClient k8sclient.K8sClientInterface)
InitServicePeerLabelResolver registers a ServicePeerLabels hook backed by the Kubernetes client with a bounded LRU cache, singleflight request coalescing, and TTL refresh policy, so that Service destination endpoints in CEL rules resolve to their backend selector labels without repeated synchronous Kubernetes API reads or duplicate concurrent in-flight requests.
func InitServicePeerLabelResolverWithCache ¶ added in v0.3.273
func InitServicePeerLabelResolverWithCache(k8sClient k8sclient.K8sClientInterface, size int, ttl time.Duration)
InitServicePeerLabelResolverWithCache initializes the ServicePeerLabels hook with explicit cache size and TTL.
func RuleAppliesToContext ¶ added in v0.3.17
func RuleAppliesToContext(rule *typesv1.Rule, contextInfo contextdetection.ContextInfo) bool
Types ¶
type RuleManager ¶ added in v0.3.3
type RuleManager struct {
// contains filtered or unexported fields
}
func CreateRuleManager ¶ added in v0.3.3
func CreateRuleManager( ctx context.Context, cfg config.Config, k8sClient k8sclient.K8sClientInterface, ruleBindingCache bindingcache.RuleBindingCache, objectCache objectcache.ObjectCache, exporter exporters.Exporter, metrics metricsmanager.MetricsManager, processManager processtree.ProcessTreeManager, dnsManager dnsmanager.DNSResolver, enricher types.Enricher, ruleCooldown *rulecooldown.RuleCooldown, adapterFactory *ruleadapters.EventRuleAdapterFactory, celEvaluator cel.RuleEvaluator, mntnsRegistry contextdetection.Registry, agentVersion string, ) (*RuleManager, error)
func (*RuleManager) ContainerCallback ¶ added in v0.3.3
func (rm *RuleManager) ContainerCallback(notif containercollection.PubSubEvent)
func (*RuleManager) EvaluatePolicyRulesForEvent ¶ added in v0.3.3
func (*RuleManager) HasApplicableRuleBindings ¶ added in v0.3.3
func (rm *RuleManager) HasApplicableRuleBindings(namespace, name string) bool
func (*RuleManager) HasFinalApplicationProfile ¶ added in v0.3.3
func (rm *RuleManager) HasFinalApplicationProfile(pod *corev1.Pod) bool
func (*RuleManager) IsContainerMonitored ¶ added in v0.3.3
func (rm *RuleManager) IsContainerMonitored(k8sContainerID string) bool
func (*RuleManager) IsPodMonitored ¶ added in v0.3.3
func (rm *RuleManager) IsPodMonitored(namespace, pod string) bool
func (*RuleManager) ReportEnrichedEvent ¶ added in v0.3.3
func (rm *RuleManager) ReportEnrichedEvent(enrichedEvent *events.EnrichedEvent)
type RuleManagerClient ¶
type RuleManagerClient interface {
ContainerCallback(notif containercollection.PubSubEvent)
HasApplicableRuleBindings(namespace, name string) bool
HasFinalApplicationProfile(pod *v1.Pod) bool
IsContainerMonitored(k8sContainerID string) bool
IsPodMonitored(namespace, pod string) bool
EvaluatePolicyRulesForEvent(eventType utils.EventType, event utils.K8sEvent) []string
}
func CreateRuleManagerMock ¶
func CreateRuleManagerMock() RuleManagerClient
type RuleManagerMock ¶
type RuleManagerMock struct {
}
func (RuleManagerMock) ContainerCallback ¶
func (r RuleManagerMock) ContainerCallback(notif containercollection.PubSubEvent)
func (RuleManagerMock) EvaluatePolicyRulesForEvent ¶ added in v0.2.340
func (RuleManagerMock) HasApplicableRuleBindings ¶
func (r RuleManagerMock) HasApplicableRuleBindings(namespace, name string) bool
func (RuleManagerMock) HasFinalApplicationProfile ¶
func (r RuleManagerMock) HasFinalApplicationProfile(pod *corev1.Pod) bool
func (RuleManagerMock) IsContainerMonitored ¶
func (r RuleManagerMock) IsContainerMonitored(k8sContainerID string) bool
func (RuleManagerMock) IsPodMonitored ¶
func (r RuleManagerMock) IsPodMonitored(namespace, pod string) bool
func (RuleManagerMock) ReportEnrichedEvent ¶ added in v0.3.3
func (r RuleManagerMock) ReportEnrichedEvent(enrichedEvent *events.EnrichedEvent)
type RulePolicyValidator ¶ added in v0.3.3
type RulePolicyValidator struct {
// contains filtered or unexported fields
}
func NewRulePolicyValidator ¶ added in v0.3.3
func NewRulePolicyValidator(objectCache objectcache.ObjectCache) *RulePolicyValidator
func (*RulePolicyValidator) Validate ¶ added in v0.3.3
func (v *RulePolicyValidator) Validate(ruleId string, process string, pcp *objectcache.ProjectedContainerProfile) (bool, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.