servicesignatures

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package servicesignatures identifies passive service greetings using bounded protocol parsers. Rules select parsers; they never contain executable patterns.

Index

Constants

View Source
const (
	Format            = "netcap-service-signatures"
	SchemaVersion     = 1
	FileName          = "service-signatures.json"
	MaxCatalogueBytes = 1 << 20
	MaxBannerBytes    = 8192
)
View Source
const InventoryFileName = "service-signatures-status.json"

Variables

This section is empty.

Functions

func PublicationBytes

func PublicationBytes() []byte

func ResourceAttribution

func ResourceAttribution() json.RawMessage

func WriteInventory

func WriteInventory(dir string, i Inventory) error

WriteInventory atomically records the catalogue used by this capture, including a disabled decoder, so an older run's snapshot cannot masquerade as this run.

Types

type Catalogue

type Catalogue struct {
	Format        string `json:"format"`
	SchemaVersion int    `json:"schema_version"`
	Rules         []Rule `json:"rules"`
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func Builtin

func Builtin() *Engine

func Load

func Load(path string) (*Engine, error)

Load falls back to the independently authored protocol catalogue. The error must be surfaced to the operator; a bad external catalogue never stays active.

func Parse

func Parse(r io.Reader) (*Engine, error)

func (*Engine) Catalogue

func (e *Engine) Catalogue() Catalogue

Catalogue returns a copy so callers cannot mutate a live engine.

func (*Engine) Identify

func (e *Engine) Identify(data []byte, transport, direction string) (Result, bool)

Identify expects a contiguous prefix starting at the server's first byte. Call again with the accumulated prefix after segmentation; never concatenate gaps.

func (*Engine) Inventory

func (e *Engine) Inventory(scope string, loadError error) Inventory

type Inventory

type Inventory struct {
	Format        string     `json:"format"`
	SchemaVersion int        `json:"schema_version"`
	Scope         string     `json:"scope"`
	State         string     `json:"state"`
	Source        string     `json:"source"`
	SourceSHA256  string     `json:"source_sha256,omitempty"`
	CheckedAt     time.Time  `json:"checked_at"`
	Degraded      bool       `json:"degraded"`
	Warning       string     `json:"warning,omitempty"`
	RuleCount     int        `json:"rule_count"`
	Protocols     []string   `json:"protocols"`
	Catalogue     *Catalogue `json:"catalogue,omitempty"`
	Limitations   []string   `json:"limitations"`
}

func ReadInventory

func ReadInventory(path string) (Inventory, error)

func UnavailableInventory

func UnavailableInventory(state, warning string) Inventory

type Provenance

type Provenance struct {
	URL     string `json:"url"`
	Section string `json:"section"`
}

type Result

type Result struct {
	ID       string
	Protocol string
	Product  string
	Version  string
}

type Rule

type Rule struct {
	ID         string       `json:"id"`
	Protocol   string       `json:"protocol"`
	Transport  string       `json:"transport"`
	Direction  string       `json:"direction"`
	Kind       string       `json:"kind"`
	Provenance []Provenance `json:"provenance"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL