Documentation
¶
Index ¶
- func AgentUninit(ctx context.Context) error
- func CheckAttackWave(ctx *request.Context, statusCode int) bool
- func GetRateLimitingStatus(method string, route string, user string, ip string, group string) *ratelimiting.Status
- func Init(environmentConfig *aikido_types.EnvironmentConfigData, ...) error
- func OnAttackDetected(attack *DetectedAttack)
- func OnAttackWaveDetected(ctx *request.Context)
- func OnMiddlewareInstalled()
- func OnOperationAttack(operation string, blocked bool)
- func OnRequestShutdown(method string, route string, statusCode int, user string, ip string, ...)
- func OnUser(id string, username string, ip string) aikido_types.User
- func SetCloudClient(client CloudClient)
- func State() *state.Collector
- func Stats() *stats.Stats
- type CloudClient
- type DetectedAttack
- type DetectedAttackWave
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentUninit ¶
AgentUninit flushes any stats collected since the last heartbeat to the Aikido cloud and stops agent-lifetime background work.
func GetRateLimitingStatus ¶
func Init ¶
func Init(environmentConfig *aikido_types.EnvironmentConfigData, aikidoConfig *aikido_types.AikidoConfigData) error
func OnAttackDetected ¶
func OnAttackDetected(attack *DetectedAttack)
func OnAttackWaveDetected ¶
func OnMiddlewareInstalled ¶
func OnMiddlewareInstalled()
func OnOperationAttack ¶
func OnRequestShutdown ¶
func OnUser ¶
func OnUser(id string, username string, ip string) aikido_types.User
OnUser records or updates user activity in the global user registry. It updates the user's name, IP address, and last seen timestamp while preserving the original first seen time. Safe for concurrent use.
func SetCloudClient ¶
func SetCloudClient(client CloudClient)
SetCloudClient sets the cloud client. Useful for testing with mocks.
Types ¶
type CloudClient ¶
type CloudClient interface {
SendStartEvent(agentInfo cloud.AgentInfo) (*aikido_types.CloudConfigData, error)
SendHeartbeatEvent(ctx context.Context, agentInfo cloud.AgentInfo, data cloud.HeartbeatData) (*aikido_types.CloudConfigData, error)
FetchConfigUpdatedAt() time.Time
FetchConfig() (*aikido_types.CloudConfigData, error)
FetchListsConfig() (*aikido_types.ListsConfigData, error)
SendAttackDetectedEvent(agentInfo cloud.AgentInfo, request aikido_types.RequestInfo, attack aikido_types.AttackDetails)
SendAttackWaveDetectedEvent(agentInfo cloud.AgentInfo, request cloud.AttackWaveRequestInfo, attack cloud.AttackWaveDetails)
SubscribeToConfigUpdates(ctx context.Context, onUpdate func(configUpdatedAt int64)) error
}
func GetCloudClient ¶
func GetCloudClient() CloudClient
GetCloudClient returns the current cloud client. This should be used instead of direct access to the cloudClient variable.
type DetectedAttack ¶
type DetectedAttack struct {
Request aikido_types.RequestInfo `json:"request"`
Attack aikido_types.AttackDetails `json:"attack"`
}
type DetectedAttackWave ¶
Click to show internal directories.
Click to hide internal directories.