alertcontext

package
v1.6.6-rc5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: MIT Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const MaxContextValueLen = 4000

Variables

View Source
var ErrNoContextData = errors.New("no context to send")

Functions

func AppsecEventToContext added in v1.6.5

func AppsecEventToContext(event types.AppsecEvent, request *http.Request) (models.Meta, []error)

Iterate over the individual appsec matched rules to create the needed alert context.

func EvalAlertContextRules added in v1.6.5

func EvalAlertContextRules(evt types.Event, match *types.MatchedRule, request *http.Request, tmpContext map[string][]string) []error

func EventToContext

func EventToContext(events []types.Event) (models.Meta, []error)

Iterate over the individual events to create the needed alert context.

func LoadConsoleContext added in v1.6.0

func LoadConsoleContext(c *csconfig.Config, hub *cwhub.Hub) error

LoadConsoleContext loads the context from the hub (if provided) and the file console_context_path.

func NewAlertContext

func NewAlertContext(contextToSend map[string][]string, valueLength int) error

func TruncateContext added in v1.6.2

func TruncateContext(values []string, contextValueLen int) (string, error)

Truncate an individual []string to fit in the context value length

func TruncateContextMap added in v1.6.5

func TruncateContextMap(contextMap map[string][]string, contextValueLen int) ([]*models.MetaItems0, []error)

Truncate the context map to fit in the context value length

func ValidateContextExpr

func ValidateContextExpr(key string, expressions []string) error

Types

type Context

type Context struct {
	ContextToSend         map[string][]string
	ContextValueLen       int
	ContextToSendCompiled map[string][]*vm.Program
	Log                   *log.Logger
}

type HubItemWrapper added in v1.6.0

type HubItemWrapper struct {
	Context map[string][]string `yaml:"context"`
}

HubItemWrapper is a wrapper around a hub item to unmarshal only the context part because there are other fields like name etc.

Jump to

Keyboard shortcuts

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