Documentation ¶
Index ¶
- func ExecuteUserIDOperation(parent dyngo.Operation, args UserIDOperationArgs) error
- func MonitorUser(ctx context.Context, userID string) error
- type Action
- type GRPCAction
- type GRPCWrapper
- type HTTPAction
- type OnUserIDOperationStart
- type StackTraceAction
- type UserIDOperation
- type UserIDOperationArgs
- type UserIDOperationRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteUserIDOperation ¶
func ExecuteUserIDOperation(parent dyngo.Operation, args UserIDOperationArgs) error
ExecuteUserIDOperation starts and finishes the UserID operation by emitting a dyngo start and finish events An error is returned if the user associated to that operation must be blocked
Types ¶
type Action ¶
Action is a generic interface that represents any WAF action
func NewBlockAction ¶ added in v1.65.0
NewBlockAction creates an action for the "block_request" action type
func NewStackTraceAction ¶ added in v1.65.0
NewStackTraceAction creates an action for the "stacktrace" action type
type GRPCAction ¶ added in v1.65.0
type GRPCAction struct {
GRPCWrapper
}
GRPCAction are actions that interact with a GRPC request flow
func (*GRPCAction) Blocking ¶ added in v1.65.0
func (a *GRPCAction) Blocking() bool
func (*GRPCAction) EmitData ¶ added in v1.65.0
func (a *GRPCAction) EmitData(op dyngo.Operation)
type GRPCWrapper ¶
GRPCWrapper is an opaque prototype abstraction for a gRPC handler (to avoid importing grpc) that returns a status code and an error TODO: rely on strongly typed actions (with the actual grpc types) by introducing WAF constructors
living in the contrib packages, along with their dependencies - something like `appsec.RegisterWAFConstructor(newGRPCWAF)` Such constructors would receive the full appsec config and rules, so that they would be able to build specific blocking actions.
type HTTPAction ¶ added in v1.65.0
HTTPAction are actions that interact with an HTTP request flow (block, redirect...)
func NewRedirectAction ¶ added in v1.65.0
func NewRedirectAction(params map[string]any) *HTTPAction
NewRedirectAction creates an action for the "redirect_request" action type
func (*HTTPAction) Blocking ¶ added in v1.65.0
func (a *HTTPAction) Blocking() bool
func (*HTTPAction) EmitData ¶ added in v1.65.0
func (a *HTTPAction) EmitData(op dyngo.Operation)
type OnUserIDOperationStart ¶
type OnUserIDOperationStart func(operation *UserIDOperation, args UserIDOperationArgs)
OnUserIDOperationStart function type, called when a user ID operation starts.
func (OnUserIDOperationStart) Call ¶
func (f OnUserIDOperationStart) Call(op dyngo.Operation, v interface{})
Call the underlying event listener function by performing the type-assertion on v whose type is the one returned by ListenedType().
func (OnUserIDOperationStart) ListenedType ¶
func (OnUserIDOperationStart) ListenedType() reflect.Type
ListenedType returns the type a OnUserIDOperationStart event listener listens to, which is the UserIDOperationStartArgs type.
type StackTraceAction ¶ added in v1.65.0
type StackTraceAction struct {
Event stacktrace.Event
}
StackTraceAction are actions that generate a stacktrace
func (*StackTraceAction) Blocking ¶ added in v1.65.0
func (a *StackTraceAction) Blocking() bool
func (*StackTraceAction) EmitData ¶ added in v1.65.0
func (a *StackTraceAction) EmitData(op dyngo.Operation)
type UserIDOperation ¶
UserIDOperation type representing a call to appsec.SetUser(). It gets both created and destroyed in a single call to ExecuteUserIDOperation
type UserIDOperationArgs ¶
type UserIDOperationArgs struct {
UserID string
}
UserIDOperationArgs is the user ID operation arguments.
func (UserIDOperationArgs) IsArgOf ¶ added in v1.61.0
func (UserIDOperationArgs) IsArgOf(*UserIDOperation)
type UserIDOperationRes ¶
type UserIDOperationRes struct{}
UserIDOperationRes is the user ID operation results.
func (UserIDOperationRes) IsResultOf ¶ added in v1.61.0
func (UserIDOperationRes) IsResultOf(*UserIDOperation)