sds

package module
v0.54.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const SDSEnabled = false

Variables

This section is empty.

Functions

This section is empty.

Types

type Match

type Match struct {
	RuleIdx uint32
}

Match mock.

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

func CreateScanner(_ int) *Scanner

CreateScanner creates a scanner for unsupported platforms/architectures.

func (*Scanner) Delete

func (s *Scanner) Delete()

Delete mocks the Delete function.

func (*Scanner) GetRuleByIdx

func (s *Scanner) GetRuleByIdx(_ uint32) (RuleConfig, error)

GetRuleByIdx mocks the GetRuleByIdx function.

func (*Scanner) IsReady

func (s *Scanner) IsReady() bool

IsReady mocks the IsReady function.

func (*Scanner) Reconfigure

func (s *Scanner) Reconfigure(_ ReconfigureOrder) error

Reconfigure mocks the Reconfigure function.

func (*Scanner) Scan

func (s *Scanner) Scan(_ []byte, _ *message.Message) (bool, []byte, error)

Scan mocks the Scan 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL