sensor

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintCapabilities added in v0.8.2

func PrintCapabilities(out io.Writer, report CapabilityReport, lang i18n.Locale)

PrintCapabilities renders a snapshot without rewriting fields that consumers persist as evidence. It also works with reports loaded from previous runs.

func RunWithOptions added in v0.3.0

func RunWithOptions(out io.Writer, opts Options) (runErr error)

RunWithOptions loads the configured eBPF probes and writes normalized JSONL telemetry until SIGINT/SIGTERM. It requires root or CAP_BPF + CAP_PERFMON.

Types

type CapabilityReport added in v0.8.0

type CapabilityReport struct {
	SchemaVersion      string                     `json:"schema_version"`
	UpdatedAt          string                     `json:"updated_at"`
	Ready              bool                       `json:"ready"`
	Status             string                     `json:"status"` // starting, ready, degraded, stopped, or failed
	Reason             string                     `json:"reason,omitempty"`
	Probes             []ProbeCapability          `json:"probes"`
	TLSDiscovery       TLSDiscoveryReport         `json:"tls_discovery"`
	AccessControlState *StateCollectionCapability `json:"access_control_state,omitempty"`
}

type Options added in v0.3.0

type Options struct {
	SSLLib   string
	LibcLib  string
	GoTLSBin string
	Context  context.Context
	OnReady  func()
	// AutoTLS scans visible processes, including container mount namespaces,
	// for mapped OpenSSL libraries and Go TLS executables. Polling cannot capture
	// a process that starts and exits entirely between scans.
	AutoTLS         bool
	TLSScanInterval time.Duration
	TLSMaxTargets   int
	TLSMaxProcesses int
	// State readers use procfs independently of eBPF. Snapshots are timestamped
	// observations of a task, never syscall verdicts or kernel lifetime aliases.
	AppArmorState bool
	SeccompState  bool
	// Diagnostics receives capability changes as JSON prefixed with
	// "agentprov-sensor: capabilities ". Nil defaults to stderr.
	Diagnostics io.Writer
	// Language controls additional human diagnostics. Protocol lines and the
	// capability callback remain unchanged, including their original reasons.
	Language i18n.Locale
	// OnCapabilities receives bounded snapshots on state changes. Callbacks must
	// return promptly; callers may persist the latest snapshot for health APIs.
	OnCapabilities func(CapabilityReport)
}

Options configures the native sensor. Optional probe failures are reported as degraded coverage; OnReady only promises the required syscall probes and the ring-buffer reader are active, not that every TLS implementation is covered.

type ProbeCapability added in v0.8.0

type ProbeCapability struct {
	Name     string `json:"name"`
	Category string `json:"category"`
	Target   string `json:"target,omitempty"`
	Required bool   `json:"required"`
	Status   string `json:"status"` // attached, detached, failed, disabled, or unsupported
	Reason   string `json:"reason,omitempty"`
}

type StateCollectionCapability added in v0.10.0

type StateCollectionCapability struct {
	AppArmor      bool   `json:"apparmor_collection_enabled"`
	Seccomp       bool   `json:"seccomp_collection_enabled"`
	Mode          string `json:"mode"`
	QueueCapacity int    `json:"queue_capacity"`
	CacheCapacity int    `json:"cache_capacity"`
	MinIntervalMS int64  `json:"min_interval_ms"`
}

type TLSDiscoveryReport added in v0.8.0

type TLSDiscoveryReport struct {
	Enabled                bool     `json:"enabled"`
	ScanIntervalMS         int64    `json:"scan_interval_ms"`
	MaxTargets             int      `json:"max_targets"`
	MaxProcessesPerScan    int      `json:"max_processes_per_scan"`
	ActiveTargets          int      `json:"active_targets"`
	ScanComplete           bool     `json:"scan_complete"`
	ProcessesScanned       int      `json:"processes_scanned"`
	UnreadableProcesses    int      `json:"unreadable_processes"`
	UnresolvedMounts       int      `json:"unresolved_mounts"`
	TruncatedMaps          int      `json:"truncated_maps"`
	SkippedTargets         int      `json:"skipped_targets"`
	UnsupportedExecutables int      `json:"unsupported_executables"`
	Reason                 string   `json:"reason,omitempty"`
	Limitations            []string `json:"limitations"`
}

Jump to

Keyboard shortcuts

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