Documentation ¶
Index ¶
- Constants
- func CloseLogfile()
- func Dump(cb bpf.DumpCallback) error
- func Dump6(cb bpf.DumpCallback) error
- func GC() int
- func GC6() int
- func Log(l *LogRecord, typ FlowType, verdict FlowVerdict, code int)
- func OpenLogfile(lf string) error
- func SetMetadata(md []string)
- type Configuration
- type EndpointInfo
- type FlowType
- type FlowVerdict
- type IPPort
- type IPVersion
- type LogRecord
- type LogRecordHTTP
- type NodeAddressInfo
- type ObservationPoint
- type Proxy
- type Proxy4Key
- type Proxy4Value
- type Proxy6Key
- type Proxy6Value
- type ProxySource
- type Redirect
Constants ¶
const ( // VerdictForwared indicates that the request/response was forwarded VerdictForwared FlowVerdict = "Forwarded" // VerdictDenied indicates that the request/response was denied VerdictDenied = "Denied" // VerdictError indicates that there was an error processing the request/response VerdictError = "Error" )
Variables ¶
This section is empty.
Functions ¶
func Dump ¶
func Dump(cb bpf.DumpCallback) error
func Dump6 ¶ added in v0.9.0
func Dump6(cb bpf.DumpCallback) error
func Log ¶ added in v0.10.0
func Log(l *LogRecord, typ FlowType, verdict FlowVerdict, code int)
Log logs a record to the logfile and flushes the buffer
func OpenLogfile ¶ added in v0.10.0
OpenLogfile opens a file for logging
func SetMetadata ¶ added in v0.10.0
func SetMetadata(md []string)
SetMetadata sets the metadata to include in each record
Types ¶
type Configuration ¶ added in v0.10.0
type Configuration struct { }
Configuration is used to pass configuration into CreateOrUpdateRedirect
type EndpointInfo ¶ added in v0.10.0
type EndpointInfo struct { ID uint64 IPv4 string IPv6 string Port uint16 Identity uint64 Labels []string }
EndpointInfo contains information about the endpoint sending/receiving the request/response
type FlowType ¶ added in v0.10.0
type FlowType string
FlowType is the type to indicate the flow direction
type FlowVerdict ¶ added in v0.10.0
type FlowVerdict string
FlowVerdict is the verdict taken on request/response
type IPVersion ¶ added in v0.10.0
type IPVersion byte
IPVersion is the type used to indicate IP version
type LogRecord ¶
type LogRecord struct { // Type is the type of the flow { request | response } Type FlowType // Timestamp is the start of a request and then end of a response Timestamp string // NodeAddressInfo contains the IPs of the node where the event was generated NodeAddressInfo NodeAddressInfo // ObservationPoint indicates where the request/response was observed ObservationPoint ObservationPoint // SourceEndpoint is information about the soure endpoint if available SourceEndpoint EndpointInfo // DestinationEndpoint is information about the soure endpoint if available DestinationEndpoint EndpointInfo // IPVersion indicates the version of the IP protocol in use IPVersion IPVersion // Verdict is the verdict on the flow taken Verdict FlowVerdict // Info includes information about the rule that matched or the error // that occurred. This is informational. Info string // Metadata is additional arbitrary metadata Metadata []string // HTTP contains information for HTTP request/responses HTTP *LogRecordHTTP `json:"HTTP,omitempty"` // contains filtered or unexported fields }
LogRecord is the structure used to log individual request/response processing events
type LogRecordHTTP ¶ added in v0.10.0
type LogRecordHTTP struct { // Code is the HTTP code being returned Code int // Method is the method of the request Method string // URL is the URL of the request URL *url.URL // Protocol is the HTTP protocol in use Protocol string // Header is the HTTP header in use Header http.Header }
LogRecordHTTP contains the HTTP specific portion of a log record
type NodeAddressInfo ¶ added in v0.10.0
NodeAddressInfo holds addressing information of the node the agent runs on
type ObservationPoint ¶ added in v0.10.0
type ObservationPoint string
ObservationPoint is the type used to describe point of observation
const ( // Ingress indicates event was generated at ingress Ingress ObservationPoint = "Ingress" // Egress indicates event was generated at egress Egress ObservationPoint = "Egress" )
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func (*Proxy) CreateOrUpdateRedirect ¶
func (p *Proxy) CreateOrUpdateRedirect(l4 *policy.L4Filter, id string, source ProxySource) (*Redirect, error)
CreateOrUpdateRedirect creates or updates a L4 redirect with corresponding proxy configuration. This will allocate a proxy port as required and launch a proxy instance. If the redirect is aleady in place, only the rules will be updated.
func (*Proxy) RemoveRedirect ¶
type Proxy4Value ¶
type Proxy4Value struct { OrigDAddr types.IPv4 OrigDPort uint16 Lifetime uint16 SourceIdentity uint32 }
func LookupEgress4 ¶
func LookupEgress4(key *Proxy4Key) (*Proxy4Value, error)
func (*Proxy4Value) GetValuePtr ¶
func (v *Proxy4Value) GetValuePtr() unsafe.Pointer
func (*Proxy4Value) HostPort ¶
func (p *Proxy4Value) HostPort() string
func (*Proxy4Value) String ¶
func (v *Proxy4Value) String() string
func (*Proxy4Value) ToNetwork ¶ added in v0.10.0
func (p *Proxy4Value) ToNetwork() *Proxy4Value
ToNetwork converts Proxy4Value to network byte order.
type Proxy6Value ¶ added in v0.9.0
type Proxy6Value struct { OrigDAddr types.IPv6 OrigDPort uint16 Lifetime uint16 SourceIdentity uint32 }
func LookupEgress6 ¶ added in v0.9.0
func LookupEgress6(key *Proxy6Key) (*Proxy6Value, error)
func (*Proxy6Value) GetValuePtr ¶ added in v0.9.0
func (v *Proxy6Value) GetValuePtr() unsafe.Pointer
func (*Proxy6Value) HostPort ¶ added in v0.9.0
func (p *Proxy6Value) HostPort() string
func (*Proxy6Value) String ¶ added in v0.9.0
func (v *Proxy6Value) String() string
func (*Proxy6Value) ToNetwork ¶ added in v0.10.0
func (p *Proxy6Value) ToNetwork() *Proxy6Value
ToNetwork converts Proxy6Value to network byte order.