Documentation ¶
Overview ¶
Package httpsec defines is the HTTP instrumentation API and contract for AppSec. It defines an abstract representation of HTTP handlers, along with helper functions to wrap (aka. instrument) standard net/http handlers. HTTP integrations must use this package to enable AppSec features for HTTP, which listens to this package's operation events.
Index ¶
- type ExecutionContext
- type Monitorer
- type ProxyLifecycleProcessor
- func (lp *ProxyLifecycleProcessor) GetExecutionInfo() *invocationlifecycle.ExecutionStartInfo
- func (lp *ProxyLifecycleProcessor) OnInvokeEnd(_ *invocationlifecycle.InvocationEndDetails)
- func (lp *ProxyLifecycleProcessor) OnInvokeStart(startDetails *invocationlifecycle.InvocationStartDetails)
- func (lp *ProxyLifecycleProcessor) WrapSpanModifier(ctx ExecutionContext, sm agent.SpanModifier) agent.SpanModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionContext ¶
type ExecutionContext interface {
LastRequestID() string
}
type Monitorer ¶
Monitorer is the interface type expected by the httpsec invocation subprocessor monitoring the given security rules addresses and returning the security events that matched.
type ProxyLifecycleProcessor ¶
type ProxyLifecycleProcessor struct {
// contains filtered or unexported fields
}
ProxyLifecycleProcessor is an implementation of the invocationlifecycle.InvocationProcessor interface called by the Runtime API proxy on every function invocation calls and responses. This allows AppSec to run by monitoring the function invocations, and run the security rules upon reception of the HTTP request span in the SpanModifier function created by the WrapSpanModifier() method. A value of this type can be used by a single function invocation at a time.
func NewProxyLifecycleProcessor ¶
func NewProxyLifecycleProcessor(appsec Monitorer, demux aggregator.Demultiplexer) *ProxyLifecycleProcessor
NewProxyLifecycleProcessor returns a new httpsec proxy processor monitored with the given Monitorer.
func (*ProxyLifecycleProcessor) GetExecutionInfo ¶
func (lp *ProxyLifecycleProcessor) GetExecutionInfo() *invocationlifecycle.ExecutionStartInfo
func (*ProxyLifecycleProcessor) OnInvokeEnd ¶
func (lp *ProxyLifecycleProcessor) OnInvokeEnd(_ *invocationlifecycle.InvocationEndDetails)
OnInvokeEnd is the hook triggered when an invocation has ended
func (*ProxyLifecycleProcessor) OnInvokeStart ¶
func (lp *ProxyLifecycleProcessor) OnInvokeStart(startDetails *invocationlifecycle.InvocationStartDetails)
OnInvokeStart is the hook triggered when an invocation has started
func (*ProxyLifecycleProcessor) WrapSpanModifier ¶
func (lp *ProxyLifecycleProcessor) WrapSpanModifier(ctx ExecutionContext, sm agent.SpanModifier) agent.SpanModifier
WrapSpanModifier wraps the given SpanModifier function with AppSec monitoring and returns it. When non nil, the given modifySpan function is called first, before the AppSec monitoring.