Documentation ¶
Overview ¶
Package trace provides functions to annotate trace spans with AppSec related information.
Index ¶
Constants ¶
const BlockedRequestTag = "appsec.blocked"
BlockedRequestTag used to convey whether a request is blocked
Variables ¶
This section is empty.
Functions ¶
func SetAppSecEnabledTags ¶
func SetAppSecEnabledTags(span TagSetter)
SetAppSecEnabledTags sets the AppSec-specific span tags that are expected to be in the web service entry span (span of type `web`) when AppSec is enabled.
func SetEventSpanTags ¶
SetEventSpanTags sets the security event span tags into the service entry span.
Types ¶
type NoopTagSetter ¶ added in v1.60.0
type NoopTagSetter struct{}
NoopTagSetter is a TagSetter that does nothing. Useful when no tracer Span is available, but a TagSetter is assumed.
func (NoopTagSetter) SetTag ¶ added in v1.60.0
func (NoopTagSetter) SetTag(string, any)
type SecurityEventsHolder ¶
type SecurityEventsHolder struct {
// contains filtered or unexported fields
}
SecurityEventsHolder is a wrapper around a thread safe security events slice. The purpose of this struct is to be used by composition in an Operation to allow said operation to handle security events addition/retrieval.
func (*SecurityEventsHolder) AddSecurityEvents ¶
func (s *SecurityEventsHolder) AddSecurityEvents(events []any)
AddSecurityEvents adds the security events to the collected events list. Thread safe.
func (*SecurityEventsHolder) ClearEvents ¶
func (s *SecurityEventsHolder) ClearEvents()
ClearEvents clears the list of stored events
func (*SecurityEventsHolder) Events ¶
func (s *SecurityEventsHolder) Events() []any
Events returns the list of stored events.
type TagsHolder ¶
type TagsHolder struct {
// contains filtered or unexported fields
}
TagsHolder wraps a map holding tags. The purpose of this struct is to be used by composition in an Operation to allow said operation to handle tags addition/retrieval.
func NewTagsHolder ¶
func NewTagsHolder() TagsHolder
NewTagsHolder returns a new instance of a TagsHolder struct.
func (*TagsHolder) AddSerializableTag ¶
func (m *TagsHolder) AddSerializableTag(k string, v any)
AddSerializableTag adds the key/value pair to the tags map. Value is serialized as JSON.
func (*TagsHolder) SetTag ¶ added in v1.60.0
func (m *TagsHolder) SetTag(k string, v any)
SetTag adds the key/value pair to the tags map
func (*TagsHolder) Tags ¶
func (m *TagsHolder) Tags() map[string]any
Tags returns a copy of the aggregated tags map (normal and serialized)