-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CWS] Allow suppressing all non-drift rule-based events (#25913)
Co-authored-by: spikat <[email protected]>
- Loading branch information
Showing
15 changed files
with
425 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Unless explicitly stated otherwise all files in this repository are licensed | ||
// under the Apache License Version 2.0. | ||
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
// Package model holds the security profile data model | ||
package model | ||
|
||
// EventFilteringProfileState is used to compute metrics for the event filtering feature | ||
type EventFilteringProfileState uint8 | ||
|
||
const ( | ||
// NoProfile is used to count the events for which we didn't have a profile | ||
NoProfile EventFilteringProfileState = iota | ||
// ProfileAtMaxSize is used to count the events that didn't make it into a profile because their matching profile | ||
// reached the max size threshold | ||
ProfileAtMaxSize | ||
// UnstableEventType is used to count the events that didn't make it into a profile because their matching profile was | ||
// unstable for their event type | ||
UnstableEventType | ||
// StableEventType is used to count the events linked to a stable profile for their event type | ||
StableEventType | ||
// AutoLearning is used to count the event during the auto learning phase | ||
AutoLearning | ||
// WorkloadWarmup is used to count the learned events due to workload warm up time | ||
WorkloadWarmup | ||
) | ||
|
||
// AllEventFilteringProfileState is the list of all EventFilteringProfileState | ||
var AllEventFilteringProfileState = []EventFilteringProfileState{NoProfile, ProfileAtMaxSize, UnstableEventType, StableEventType, AutoLearning, WorkloadWarmup} | ||
|
||
// String returns the string representation of the EventFilteringProfileState | ||
func (efr EventFilteringProfileState) String() string { | ||
switch efr { | ||
case NoProfile: | ||
return "no_profile" | ||
case ProfileAtMaxSize: | ||
return "profile_at_max_size" | ||
case UnstableEventType: | ||
return "unstable_event_type" | ||
case StableEventType: | ||
return "stable_event_type" | ||
case AutoLearning: | ||
return "auto_learning" | ||
case WorkloadWarmup: | ||
return "workload_warmup" | ||
} | ||
return "" | ||
} | ||
|
||
// ToTag returns the tag representation of the EventFilteringProfileState | ||
func (efr EventFilteringProfileState) ToTag() string { | ||
return "profile_state:" + efr.String() | ||
} |
Oops, something went wrong.