forwarder

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The type of an Alert that is triggered because of a rule encountering an error
	RuleErrorType = "RULE_ERROR"
)

Variables

View Source
var (
	StaticLogger = metrics.MustStaticLogger([]metrics.DimensionSet{
		{
			"AnalysisType",
			"Severity",
		},
		{
			"AnalysisType",
			"AnalysisID",
		},
		{
			"AnalysisType",
		},
	}, []metrics.Metric{
		{
			Name: "AlertsCreated",
			Unit: metrics.UnitCount,
		},
	})
	AnalysisTypeDimension = metrics.Dimension{
		Name:  "AnalysisType",
		Value: "Rule",
	}
)

Functions

This section is empty.

Types

type Alert

type Alert struct {
	ID                  string    `dynamodbav:"id,string"`
	TimePartition       string    `dynamodbav:"timePartition,string"`
	Severity            string    `dynamodbav:"severity,string"`
	RuleDisplayName     *string   `dynamodbav:"ruleDisplayName,string"`
	FirstEventMatchTime time.Time `dynamodbav:"firstEventMatchTime,string"`
	LogTypes            []string  `dynamodbav:"logTypes,stringset"`
	// Alert Title - will be the Python-generated title or a default one if no Python-generated title is available.
	Title string `dynamodbav:"title,string"`
	AlertDedupEvent
}

Alert contains all the fields associated to the alert stored in DDB

type AlertDedupEvent

type AlertDedupEvent struct {
	RuleID              string    `dynamodbav:"ruleId"`
	RuleVersion         string    `dynamodbav:"ruleVersion"`
	DeduplicationString string    `dynamodbav:"dedup"`
	CreationTime        time.Time `dynamodbav:"creationTime"`
	UpdateTime          time.Time `dynamodbav:"updateTime"`
	EventCount          int64     `dynamodbav:"eventCount"`
	LogTypes            []string  `dynamodbav:"logTypes,stringset"`
	AlertContext        *string   `dynamodbav:"context,string"`
	Type                string    `dynamodbav:"type"`
	// Generated Fields
	GeneratedTitle               *string  `dynamodbav:"title,string"`
	GeneratedDescription         *string  `dynamodbav:"description,string"`
	GeneratedReference           *string  `dynamodbav:"reference"`
	GeneratedSeverity            *string  `dynamodbav:"severity"`
	GeneratedRunbook             *string  `dynamodbav:"runbook"`
	GeneratedDestinationOverride []string `dynamodbav:"destinationOverride,stringset"`
	AlertCount                   int64    `dynamodbav:"-"` // There is no need to store this item in DDB
}

AlertDedupEvent represents the event stored in the alert dedup DDB table by the rules engine

func FromDynamodDBAttribute

func FromDynamodDBAttribute(input map[string]events.DynamoDBAttributeValue) (event *AlertDedupEvent, err error)

type Handler added in v1.6.0

type Handler struct {
	SqsClient        sqsiface.SQSAPI
	Cache            *RuleCache
	DdbClient        dynamodbiface.DynamoDBAPI
	AlertTable       string
	AlertingQueueURL string
	MetricsLogger    metrics.Logger
}

func (*Handler) Do added in v1.6.0

func (h *Handler) Do(oldAlertDedupEvent, newAlertDedupEvent *AlertDedupEvent) (err error)

type RuleCache added in v1.6.0

type RuleCache struct {
	// contains filtered or unexported fields
}

s3ClientCacheKey -> S3 client

func NewCache added in v1.6.0

func NewCache(policyClient gatewayapi.API) *RuleCache

func (*RuleCache) Get added in v1.6.0

func (c *RuleCache) Get(id, version string) (*models.Rule, error)

Jump to

Keyboard shortcuts

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