v1

package
v1.8.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 26 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

This section is empty.

Variables

This section is empty.

Functions

func FormatAlerts

func FormatAlerts(result []*ent.Alert) models.AddAlertsRequest

FormatAlerts : Format results from the database to be swagger model compliant

func FormatDecisions

func FormatDecisions(decisions []*ent.Decision) []*models.Decision

Format decisions for the bouncers

func FormatOneAlert

func FormatOneAlert(alert *ent.Alert) *models.Alert

func PrometheusBouncersHasEmptyDecision

func PrometheusBouncersHasEmptyDecision(c *gin.Context)

func PrometheusBouncersHasNonEmptyDecision

func PrometheusBouncersHasNonEmptyDecision(c *gin.Context)

func PrometheusBouncersMiddleware

func PrometheusBouncersMiddleware(c *gin.Context)

func PrometheusMachinesMiddleware

func PrometheusMachinesMiddleware(c *gin.Context)

func PrometheusMiddleware

func PrometheusMiddleware(c *gin.Context)

Types

type Controller

type Controller struct {
	DBClient     *database.Client
	APIKeyHeader string
	Middlewares  *middlewares.Middlewares
	Profiles     []*csprofiles.Runtime

	AlertsAddChan      chan []*models.Alert
	DecisionDeleteChan chan []*models.Decision

	PluginChannel   chan models.ProfileAlert
	ConsoleConfig   csconfig.ConsoleConfig
	TrustedIPs      []net.IPNet
	AutoRegisterCfg *csconfig.LocalAPIAutoRegisterCfg

	DecisionsStreamPageSize int
	// contains filtered or unexported fields
}

func New

func New(cfg *ControllerV1Config) (*Controller, error)

func (*Controller) AbortRemoteIf added in v1.5.0

func (*Controller) AbortRemoteIf(option bool) gin.HandlerFunc

func (*Controller) CheckInAllowlist added in v1.6.6

func (c *Controller) CheckInAllowlist(gctx *gin.Context)

func (*Controller) CheckInAllowlistBulk added in v1.6.9

func (c *Controller) CheckInAllowlistBulk(gctx *gin.Context)

func (*Controller) CreateAlert

func (c *Controller) CreateAlert(gctx *gin.Context)

CreateAlert writes the alerts received in the body to the database

func (*Controller) CreateMachine

func (c *Controller) CreateMachine(gctx *gin.Context)

func (*Controller) DeleteAlertByID added in v1.4.2

func (c *Controller) DeleteAlertByID(gctx *gin.Context)

DeleteAlertByID delete the alert associated to the ID

func (*Controller) DeleteAlerts

func (c *Controller) DeleteAlerts(gctx *gin.Context)

DeleteAlerts deletes alerts from the database based on the specified filter

func (*Controller) DeleteDecisionById

func (c *Controller) DeleteDecisionById(gctx *gin.Context)

func (*Controller) DeleteDecisions

func (c *Controller) DeleteDecisions(gctx *gin.Context)

func (*Controller) DeleteMachine added in v1.6.9

func (c *Controller) DeleteMachine(gctx *gin.Context)

func (*Controller) FindAlertByID

func (c *Controller) FindAlertByID(gctx *gin.Context)

FindAlertByID returns the alert associated with the ID

func (*Controller) FindAlerts

func (c *Controller) FindAlerts(gctx *gin.Context)

FindAlerts returns alerts from the database based on the specified filter

func (*Controller) GetAllowlist added in v1.6.6

func (c *Controller) GetAllowlist(gctx *gin.Context)

func (*Controller) GetAllowlists added in v1.6.6

func (c *Controller) GetAllowlists(gctx *gin.Context)

func (*Controller) GetDecision

func (c *Controller) GetDecision(gctx *gin.Context)

func (*Controller) HandleDBErrors

func (*Controller) HandleDBErrors(gctx *gin.Context, err error)

func (*Controller) HeartBeat added in v1.4.0

func (c *Controller) HeartBeat(gctx *gin.Context)

func (*Controller) LimitStreamConcurrency added in v1.8.2

func (c *Controller) LimitStreamConcurrency(gctx *gin.Context)

LimitStreamConcurrency queues stream requests beyond the configured limit. The slot is held until the response is fully written, because that is what bounds memory. It runs before StreamDecision reads the cursor, so a request that waited still gets an up-to-date delta.

func (*Controller) StreamDecision

func (c *Controller) StreamDecision(gctx *gin.Context)

func (*Controller) UsageMetrics added in v1.6.3

func (c *Controller) UsageMetrics(gctx *gin.Context)

UsageMetrics receives metrics from log processors and remediation components

type ControllerV1Config added in v1.4.0

type ControllerV1Config struct {
	DbClient    *database.Client
	ProfilesCfg []*csconfig.ProfileCfg

	AlertsAddChan      chan []*models.Alert
	DecisionDeleteChan chan []*models.Decision

	PluginChannel   chan models.ProfileAlert
	ConsoleConfig   csconfig.ConsoleConfig
	TrustedIPs      []net.IPNet
	AutoRegisterCfg *csconfig.LocalAPIAutoRegisterCfg

	DecisionsStream *csconfig.DecisionsStreamCfg
}

type RepeatedPrefixError added in v1.6.3

type RepeatedPrefixError struct {
	OriginalError error
	Prefix        string
}

RepeatedPrefixError wraps an error and removes the repeating prefix from its message

func (RepeatedPrefixError) Error added in v1.6.3

func (e RepeatedPrefixError) Error() string

func (RepeatedPrefixError) Unwrap added in v1.6.3

func (e RepeatedPrefixError) Unwrap() error

Jump to

Keyboard shortcuts

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