Documentation ¶
Index ¶
Constants ¶
const SDSEnabled = false
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatchAction ¶
type MatchAction struct { Type string `json:"type"` Placeholder string `json:"placeholder"` Direction string `json:"direction"` CharacterCount uint32 `json:"character_count"` }
MatchAction defines what's the action to do when there is a match.
type ProximityKeywords ¶
type ProximityKeywords struct { Keywords []string `json:"keywords"` CharacterCount uint32 `json:"character_count"` }
ProximityKeywords definition in RC config.
type ReconfigureOrder ¶
type ReconfigureOrder struct { Type ReconfigureOrderType Config []byte ResponseChan chan error }
ReconfigureOrder are used to trigger a reconfiguration of the SDS scanner.
type ReconfigureOrderType ¶
type ReconfigureOrderType string
const ( // StandardRules triggers the storage of a new set of standard rules // and reconfigure the internal SDS scanner with an existing user // configuration if any. StandardRules ReconfigureOrderType = "standard_rules" // AgentConfig triggers a reconfiguration of the SDS scanner. AgentConfig ReconfigureOrderType = "agent_config" )
type RuleConfig ¶
type RuleConfig struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Tags []string `json:"tags"` Definition RuleDefinition `json:"definition"` MatchAction MatchAction `json:"match_action"` IncludedKeywords ProximityKeywords `json:"included_keywords"` IsEnabled bool `json:"is_enabled"` }
RuleConfig of rule as sent by the Remote Configuration.
type RuleDefinition ¶
type RuleDefinition struct { StandardRuleID string `json:"standard_rule_id"` Pattern string `json:"pattern"` }
RuleDefinition definition in RC config.
type RulesConfig ¶
type RulesConfig struct { ID string `json:"id"` Name string `json:"name"` Rules []RuleConfig `json:"rules"` IsEnabled bool `json:"is_enabled"` Description string `json:"description"` }
RulesConfig as sent by the Remote Configuration. Equivalent of the groups in the UI.
func (RulesConfig) OnlyEnabled ¶
func (r RulesConfig) OnlyEnabled() RulesConfig
OnlyEnabled returns a new RulesConfig object containing only enabled rules. Use this to filter out disabled rules.
type Scanner ¶
type Scanner struct { }
Scanner mock.
func CreateScanner ¶
CreateScanner creates a scanner for unsupported platforms/architectures.
func (*Scanner) GetRuleByIdx ¶
func (s *Scanner) GetRuleByIdx(_ uint32) (RuleConfig, error)
GetRuleByIdx mocks the GetRuleByIdx function.
func (*Scanner) Reconfigure ¶
func (s *Scanner) Reconfigure(_ ReconfigureOrder) error
Reconfigure mocks the Reconfigure function.
type StandardRuleConfig ¶
type StandardRuleConfig struct { ID string `json:"id"` Name string `json:"name"` Tags []string `json:"tags"` Description string `json:"description"` Definitions []StandardRuleDefinition `json:"definitions"` }
StandardRuleConfig as sent by the Remote Configuration;
type StandardRuleDefinition ¶
type StandardRuleDefinition struct { Version int `json:"version"` Pattern string `json:"pattern"` DefaultIncludedKeywords []string `json:"default_included_keywords"` RequiredCapabilities []string `json:"required_capabilities"` }
StandardRuleDefinition contains a versioned standard rule definition.
type StandardRulesConfig ¶
type StandardRulesConfig struct { Rules []StandardRuleConfig `json:"rules"` Defaults StandardRulesDefaults `json:"defaults"` }
StandardRulesConfig contains standard rules.
type StandardRulesDefaults ¶
type StandardRulesDefaults struct {
IncludedKeywordsCharCount uint32 `json:"included_keywords_char_count"`
}
StandardRulesDefaults contains consts defaults information for standard rules.