Documentation ¶
Index ¶
- Constants
- type RuleCreator
- type RuleCreatorMock
- type RuleEvaluator
- type RuleFailure
- type RuleMock
- func (rule *RuleMock) DeleteRule()
- func (rule *RuleMock) GetParameters() map[string]interface{}
- func (rule *RuleMock) ID() string
- func (rule *RuleMock) Name() string
- func (rule *RuleMock) ProcessEvent(_ admission.Attributes, _ objectcache.KubernetesCache) RuleFailure
- func (rule *RuleMock) SetParameters(p map[string]interface{})
Constants ¶
View Source
const ( RulePriorityNone = 0 RulePriorityLow = 1 RulePriorityMed = 5 RulePriorityHigh = 8 RulePriorityCritical = 10 RulePrioritySystemIssue = 1000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RuleCreator ¶
type RuleCreator interface { CreateRulesByTags(tags []string) []RuleEvaluator CreateRuleByID(id string) RuleEvaluator CreateRuleByName(name string) RuleEvaluator }
RuleCreator is an interface for creating rules by tags, IDs, and names
type RuleCreatorMock ¶
type RuleCreatorMock struct { }
func (*RuleCreatorMock) CreateRuleByID ¶
func (r *RuleCreatorMock) CreateRuleByID(id string) RuleEvaluator
func (*RuleCreatorMock) CreateRuleByName ¶
func (r *RuleCreatorMock) CreateRuleByName(name string) RuleEvaluator
func (*RuleCreatorMock) CreateRulesByTags ¶
func (r *RuleCreatorMock) CreateRulesByTags(tags []string) []RuleEvaluator
type RuleEvaluator ¶
type RuleEvaluator interface { // Rule ID - this is the rules unique identifier ID() string // Rule Name Name() string // Rule processing ProcessEvent(event admission.Attributes, access objectcache.KubernetesCache) RuleFailure // Set rule parameters SetParameters(parameters map[string]interface{}) // Get rule parameters GetParameters() map[string]interface{} }
type RuleFailure ¶
type RuleFailure interface { // Get Base Runtime Alert GetBaseRuntimeAlert() apitypes.BaseRuntimeAlert // Get Runtime Process Details GetRuntimeProcessDetails() apitypes.ProcessTree // Get Rule Description GetRuleAlert() apitypes.RuleAlert // Get Admissions Details GetAdmissionsAlert() apitypes.AdmissionAlert // Get K8s Runtime Details GetRuntimeAlertK8sDetails() apitypes.RuntimeAlertK8sDetails // Get Rule ID GetRuleId() string // Set Workload Details SetWorkloadDetails(workloadDetails string) // Set Base Runtime Alert SetBaseRuntimeAlert(baseRuntimeAlert apitypes.BaseRuntimeAlert) // Set Runtime Process Details SetRuntimeProcessDetails(runtimeProcessDetails apitypes.ProcessTree) // Set Rule Description SetRuleAlert(ruleAlert apitypes.RuleAlert) // Set Admissions Details SetAdmissionsAlert(admissionsAlert apitypes.AdmissionAlert) // Set K8s Runtime Details SetRuntimeAlertK8sDetails(runtimeAlertK8sDetails apitypes.RuntimeAlertK8sDetails) }
type RuleMock ¶
func (*RuleMock) DeleteRule ¶
func (rule *RuleMock) DeleteRule()
func (*RuleMock) GetParameters ¶
func (*RuleMock) ProcessEvent ¶
func (rule *RuleMock) ProcessEvent(_ admission.Attributes, _ objectcache.KubernetesCache) RuleFailure
func (*RuleMock) SetParameters ¶
Click to show internal directories.
Click to hide internal directories.