Documentation ¶
Overview ¶
Package instrumentation holds code commonly used between all instrumentation declinations (currently httpsec/grpcsec).
Index ¶
- Constants
- Variables
- func SetAppSecEnabledTags(span TagSetter)
- func SetEventSpanTags(span TagSetter, events []json.RawMessage) error
- func SetStringTags(span TagSetter, tags map[string]string)
- func SetTags(span TagSetter, tags map[string]interface{})
- type ContextKey
- type NetaddrIP
- type NetaddrIPPrefix
- type SecurityEventsHolder
- type TagSetter
- type TagsHolder
Constants ¶
const BlockedRequestTag = "appsec.blocked"
BlockedRequestTag used to convey whether a request is blocked
Variables ¶
var ( // NetaddrParseIP wraps the netip.ParseAddr function NetaddrParseIP = netip.ParseAddr // NetaddrParseIPPrefix wraps the netip.ParsePrefix function NetaddrParseIPPrefix = netip.ParsePrefix // NetaddrMustParseIP wraps the netip.MustParseAddr function NetaddrMustParseIP = netip.MustParseAddr // NetaddrIPv6Raw wraps the netIP.AddrFrom16 function NetaddrIPv6Raw = netip.AddrFrom16 )
Functions ¶
func SetAppSecEnabledTags ¶ added in v1.43.1
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 ¶
func SetEventSpanTags(span TagSetter, events []json.RawMessage) error
SetEventSpanTags sets the security event span tags into the service entry span.
func SetStringTags ¶ added in v1.45.0
SetStringTags fills the span tags using the key/value pairs of strings found in `tags`
Types ¶
type ContextKey ¶ added in v1.48.0
type ContextKey struct{}
ContextKey is used as a key to store operations in the request's context (gRPC/HTTP)
type NetaddrIP ¶ added in v1.45.0
NetaddrIP wraps a netip.Addr value
func NetaddrIPv4 ¶ added in v1.45.0
NetaddrIPv4 wraps the netip.AddrFrom4 function
type NetaddrIPPrefix ¶ added in v1.45.0
NetaddrIPPrefix wraps a netip.Prefix value
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. See httpsec/http.go and grpcsec/grpc.go.
func (*SecurityEventsHolder) AddSecurityEvents ¶
func (s *SecurityEventsHolder) AddSecurityEvents(events ...json.RawMessage)
AddSecurityEvents adds the security events to the collected events list. Thread safe.
func (*SecurityEventsHolder) ClearEvents ¶ added in v1.45.0
func (s *SecurityEventsHolder) ClearEvents()
ClearEvents clears the list of stored events
func (*SecurityEventsHolder) Events ¶
func (s *SecurityEventsHolder) Events() []json.RawMessage
Events returns the list of stored events.
type TagSetter ¶ added in v1.43.1
type TagSetter interface {
SetTag(string, interface{})
}
TagSetter is the interface needed to set a span tag.
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. See httpsec/http.go and grpcsec/grpc.go.
func NewTagsHolder ¶
func NewTagsHolder() TagsHolder
NewTagsHolder returns a new instance of a TagsHolder struct.
func (*TagsHolder) AddTag ¶
func (m *TagsHolder) AddTag(k string, v interface{})
AddTag adds the key/value pair to the tags map
func (*TagsHolder) Tags ¶
func (m *TagsHolder) Tags() map[string]interface{}
Tags returns the tags map
Directories ¶
Path | Synopsis |
---|---|
Package grpcsec is the gRPC instrumentation API and contract for AppSec defining an abstract run-time representation of gRPC handlers.
|
Package grpcsec is the gRPC instrumentation API and contract for AppSec defining an abstract run-time representation of gRPC handlers. |
Package httpsec defines is the HTTP instrumentation API and contract for AppSec.
|
Package httpsec defines is the HTTP instrumentation API and contract for AppSec. |