appsecacquisition

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 51 Imported by: ? modules, 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 ModuleName = appsec.ModuleName

Variables

View Source
var (
	DefaultAuthCacheDuration = (1 * time.Minute)
	DefaultAuthTimeout       = (200 * time.Millisecond)
	DefaultBodyReadTimeout   = (1 * time.Second)
)
View Source
var CRSAnomalyScores = []string{
	"sql_injection_score",
	"xss_score",
	"rfi_score",
	"lfi_score",
	"rce_score",
	"php_injection_score",
	"http_violation_score",
	"session_fixation_score",
	"anomaly_score",
}

Functions

func AppsecEventGeneration

func AppsecEventGeneration(inEvt pipeline.Event, request *http.Request) (*pipeline.Event, error)

func RegisterRX

func RegisterRX()

RegisterRX registers the rx operator using a WASI implementation instead of Go.

Types

type AppsecRunner

type AppsecRunner struct {
	UUID                string
	AppsecRuntime       *appsec.AppsecRuntimeConfig //this holds the actual appsec runtime config, rules, remediations, hooks etc.
	AppsecInbandEngine  coraza.WAF
	AppsecOutbandEngine coraza.WAF
	Labels              map[string]string
	// contains filtered or unexported fields
}

that's the runtime structure of the Application security engine as seen from the acquis

func (*AppsecRunner) AccumulateTxToEvent

func (r *AppsecRunner) AccumulateTxToEvent(evt *pipeline.Event, state *appsec.AppsecRequestState, req *appsec.ParsedRequest)

func (*AppsecRunner) Close added in v1.8.0

func (r *AppsecRunner) Close()

Close releases the runner's engines. Safe to call once its run loop has stopped: the engines are only ever used from that goroutine.

func (*AppsecRunner) InitInBand added in v1.8.2

func (r *AppsecRunner) InitInBand(datadir string) error

InitInBand prepares the runner to serve bouncer requests.

func (*AppsecRunner) InitOutOfBand added in v1.8.2

func (r *AppsecRunner) InitOutOfBand(datadir string) error

InitOutOfBand prepares the runner to evaluate the requests queued by the in-band runners.

func (*AppsecRunner) MergeDedupRules added in v1.6.5

func (*AppsecRunner) MergeDedupRules(collections []appsec.AppsecCollection, logger *log.Entry) string

func (*AppsecRunner) ProcessInBandRules

func (r *AppsecRunner) ProcessInBandRules(ctx context.Context, state *appsec.AppsecRequestState, request *appsec.ParsedRequest) error

func (*AppsecRunner) ProcessOutOfBandRules

func (r *AppsecRunner) ProcessOutOfBandRules(ctx context.Context, state *appsec.AppsecRequestState, request *appsec.ParsedRequest) error

func (*AppsecRunner) Run

func (r *AppsecRunner) Run(ctx context.Context, t *tomb.Tomb) error

func (*AppsecRunner) RunOutOfBand added in v1.8.2

func (r *AppsecRunner) RunOutOfBand(ctx context.Context, t *tomb.Tomb) error

type AuthCache

type AuthCache struct {
	APIKeys map[string]time.Time
	// contains filtered or unexported fields
}

func NewAuthCache

func NewAuthCache() AuthCache

func (*AuthCache) Delete added in v1.6.9

func (ac *AuthCache) Delete(apiKey string)

func (*AuthCache) Get

func (ac *AuthCache) Get(apiKey string) (time.Time, bool)

func (*AuthCache) Set

func (ac *AuthCache) Set(apiKey string, expiration time.Time)

type Configuration added in v1.7.4

type Configuration struct {
	ListenAddr        string         `yaml:"listen_addr"`
	ListenSocket      string         `yaml:"listen_socket"`
	CertFilePath      string         `yaml:"cert_file"`
	KeyFilePath       string         `yaml:"key_file"`
	Path              string         `yaml:"path"`
	Routines          int            `yaml:"routines"`
	AppsecConfig      string         `yaml:"appsec_config"`
	AppsecConfigs     []string       `yaml:"appsec_configs"`
	AppsecConfigPath  string         `yaml:"appsec_config_path"`
	AuthCacheDuration *time.Duration `yaml:"auth_cache_duration"`
	// AuthTimeout bounds the LAPI round-trip that validates a bouncer API key.
	// Raise it when LAPI is several hops away. Set to 0 to disable. Defaults to DefaultAuthTimeout.
	AuthTimeout *time.Duration `yaml:"auth_timeout"`
	// BodyReadTimeout bounds how long we wait for the bouncer to finish sending the request body.
	// Set to 0 to disable. Defaults to DefaultBodyReadTimeout.
	BodyReadTimeout                   *time.Duration `yaml:"body_read_timeout"`
	configuration.DataSourceCommonCfg `yaml:",inline"`
}

configuration structure of the acquis for the application security engine

type Source added in v1.7.4

type Source struct {
	InChan        chan appsec.ParsedRequest
	AppsecRuntime *appsec.AppsecRuntimeConfig
	AppsecConfigs map[string]appsec.AppsecConfig

	AuthCache        AuthCache
	AppsecRunners    []AppsecRunner // one for each go-routine
	OutOfBandRunners []AppsecRunner
	// contains filtered or unexported fields
}

func (*Source) CanRun added in v1.7.4

func (*Source) CanRun() error

func (*Source) Configure added in v1.7.4

func (w *Source) Configure(ctx context.Context, yamlConfig []byte, logger *log.Entry, _ metrics.AcquisitionMetricsLevel) error

func (*Source) Dump added in v1.7.4

func (w *Source) Dump() any

func (*Source) Features added in v1.8.2

func (w *Source) Features() []string

func (*Source) GetAggregMetrics added in v1.7.4

func (*Source) GetAggregMetrics() []prometheus.Collector

func (*Source) GetMetrics added in v1.7.4

func (*Source) GetMetrics() []prometheus.Collector

func (*Source) GetMode added in v1.7.4

func (w *Source) GetMode() string

func (*Source) GetName added in v1.7.4

func (*Source) GetName() string

func (*Source) GetUuid added in v1.7.4

func (w *Source) GetUuid() string

func (*Source) SetClientConfig added in v1.7.5

func (w *Source) SetClientConfig(config *csconfig.LocalApiClientCfg)

func (*Source) SetHub added in v1.7.5

func (w *Source) SetHub(hub *cwhub.Hub)

func (*Source) StreamingAcquisition added in v1.7.4

func (w *Source) StreamingAcquisition(ctx context.Context, out chan pipeline.Event, t *tomb.Tomb) error

func (*Source) UnmarshalConfig added in v1.7.4

func (w *Source) UnmarshalConfig(yamlConfig []byte) error

Jump to

Keyboard shortcuts

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