Documentation
¶
Index ¶
- Variables
- func AddApplications(serviceIdent string, applications []string)
- func MatchServiceProbes(serv *service, banner []byte, ident string)
- func NewService(ts int64, numBytesServer, numBytesClient int, ip string) *service
- func ObserveBanner(o Observation) (bool, error)
- func ObserveFlowBanner(id, flow string, banner []byte, at time.Time, serverBytes, clientBytes int, ...) (bool, error)
- func ResetProbeEnums()
- func ResetStore()
- func SignatureInventory() servicesignatures.Inventory
- type HyperscanBuildStats
- type HyperscanCategory
- type HyperscanStatus
- type Observation
Constants ¶
This section is empty.
Variables ¶
var Decoder = &decoder.AbstractDecoder{ Type: types.Type_NC_Service, Name: "Service", Description: "A network service", PostInit: func(d *decoder.AbstractDecoder) error { var err error serviceLog, _, err = logging.InitZapLogger( decoderconfig.Instance.Out, "service", decoderconfig.Instance.Debug, ) if err != nil { return err } return initServiceProbes() }, DeInit: func(e *decoder.AbstractDecoder) error { Store.operations.Lock() defer Store.operations.Unlock() if decoderconfig.Instance.AggregateStore != nil { err := walkStoredServices(func(s *types.Service, apps map[string]struct{}) error { return writeService(e, s, apps) }) return errors.Join(err, serviceLog.Sync()) } // flush writer var err error idents := make([]string, 0, len(Store.Items)) for ident := range Store.Items { idents = append(idents, ident) } sort.Strings(idents) for _, ident := range idents { item := Store.Items[ident] item.Lock() err = errors.Join(err, writeService(e, item.Service, item.applications)) item.Unlock() } return errors.Join(err, serviceLog.Sync()) }, }
Decoder for protocol analysis and writing audit records to disk.
var Store = &atomicServiceMap{ Items: make(map[string]*service), }
Store ServiceStore holds all tcp service banners.
Functions ¶
func AddApplications ¶
AddApplications adds DPI-detected application protocols to a service. This function is thread-safe and can be called from packet decoders.
func MatchServiceProbes ¶
func NewService ¶
NewService creates a new network service.
func ObserveBanner ¶ added in v0.16.8
func ObserveBanner(o Observation) (bool, error)
ObserveBanner serializes one endpoint's observations with a fixed lock set. Probe callbacks run outside the aggregate lock because they can emit software.
func ObserveFlowBanner ¶ added in v0.16.8
func ResetProbeEnums ¶
func ResetProbeEnums()
ResetProbeEnums remains for callers resetting capture state. IDs are now stable.
func ResetStore ¶
func ResetStore()
ResetStore clears all services from memory This should be called when resetting state between processing different files
func SignatureInventory ¶
func SignatureInventory() servicesignatures.Inventory
SignatureInventory is the actual decoder initialization result, not a re-read of a catalogue that may have changed since the capture started.
Types ¶
type HyperscanBuildStats ¶
type HyperscanBuildStats struct {
Categories int `json:"categories"`
PatternsTotal int `json:"patterns_total"`
PatternsHS int `json:"patterns_hyperscan"`
PatternsFallbk int `json:"patterns_fallback"`
}
HyperscanBuildStats is the stub-build twin of the tagged type.
type HyperscanCategory ¶
type HyperscanCategory struct {
Name string `json:"name"`
Patterns int `json:"patterns"`
Rejections int `json:"rejections"`
Matches uint64 `json:"matches"`
Scans uint64 `json:"scans"`
ScanErrors uint64 `json:"scan_errors"`
SampleError string `json:"sample_error,omitempty"`
}
HyperscanCategory is the stub-build twin of the tagged type.
type HyperscanStatus ¶
type HyperscanStatus struct {
Enabled bool `json:"enabled"`
LibVersion string `json:"lib_version"`
Build HyperscanBuildStats `json:"build"`
BuildError string `json:"build_error,omitempty"`
ScanFallbacks uint64 `json:"scan_fallbacks"`
Categories []HyperscanCategory `json:"categories,omitempty"`
}
HyperscanStatus is the stub-build twin of the tagged type.
func GetHyperscanStatus ¶
func GetHyperscanStatus() HyperscanStatus
GetHyperscanStatus reports the integration as compiled-out so UI surfaces can render a clear "disabled" badge instead of guessing.