siem

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: AGPL-3.0 Imports: 15 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 siem forwards every DNS and egress decision the sensor makes to Guardian, the Vulnetix SIEM, as dns_events and net_events rows.

The sensor runs on a customer's machine, so it posts to the per-tenant events route with the customer's own Guardian ingest token, never to the multi-tenant producer route. The token decides the organisation; a row never carries a tenant.

Forwarding must never slow a decision. DNS and Egress only append to a bounded buffer under a mutex; the HTTP work happens in Run. When the buffer is full the oldest rows are dropped and counted, and a batch the server refuses or cannot be reached for is dropped too: the console's Sensors page stays the record of what matched, and Guardian is a copy.

Index

Constants

View Source
const DefaultURL = "https://ingest.vulnetix.com/v1/ingest/events"

DefaultURL is Guardian's per-tenant events route.

View Source
const Source = "sensor"

Source is the source column every row carries.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSDecision

type DNSDecision struct {
	Time time.Time
	// Client is who asked, host:port.
	Client  string
	QName   string
	QType   string
	RCode   string
	Answers []string
	Match   *Match
	// Error is set when the upstream resolver could not answer.
	Error string
}

DNSDecision is one lookup the DNS guard answered or refused.

type EgressDecision

type EgressDecision struct {
	Time time.Time
	// Client is the workload's side of the proxy connection, host:port.
	Client string
	// Target is what the client asked for, host:port.
	Target string
	// RemoteAddr is the address the proxy reached, ip:port, when it dialled.
	RemoteAddr string
	Method     string
	Bytes      int64
	Match      *Match
	Error      string
}

EgressDecision is one outbound connection the egress proxy allowed or refused.

type Event

type Event struct {
	Table string         `json:"table"`
	Row   map[string]any `json:"row"`
}

Event is one row as the events route takes it.

func DNSRow

func DNSRow(host string, d DNSDecision) Event

DNSRow maps a DNS decision to a dns_events row.

func EgressRow

func EgressRow(host string, d EgressDecision) Event

EgressRow maps an egress decision to a net_events row.

type Forwarder

type Forwarder struct {
	// URL is the events route; DefaultURL when empty.
	URL string
	// Token is the Guardian ingest token, gdn_...
	Token string
	// Host is the machine name every row carries.
	Host string

	Client     *http.Client
	Limit      int
	BatchSize  int
	FlushEvery time.Duration
	Logf       func(string, ...any)
	Now        func() time.Time
	// contains filtered or unexported fields
}

Forwarder buffers rows and posts them in batches.

func (*Forwarder) DNS

func (f *Forwarder) DNS(d DNSDecision)

DNS queues a DNS decision. It never blocks on the network.

func (*Forwarder) Dropped

func (f *Forwarder) Dropped() int

Dropped is how many rows were dropped since the forwarder started: pushed out of a full buffer, or in a batch that could not be delivered.

func (*Forwarder) Egress

func (f *Forwarder) Egress(d EgressDecision)

Egress queues an egress decision. It never blocks on the network.

func (*Forwarder) Flush

func (f *Forwarder) Flush(ctx context.Context)

Flush posts everything buffered, BatchSize rows to a request. A batch that fails is dropped and counted; it is not retried.

func (*Forwarder) Pending

func (f *Forwarder) Pending() int

Pending is how many rows wait to be sent.

func (*Forwarder) Run

func (f *Forwarder) Run(ctx context.Context)

Run flushes every FlushEvery, or sooner when BatchSize rows wait, until ctx ends, then flushes once more.

type Match

type Match struct {
	Rule      decide.RuleRef
	Indicator string
	Verdict   decide.Verdict
}

Match is the rule a decision was taken under. A decision with no Match is a lookup or connection no indicator named, which the sensor allowed.

Jump to

Keyboard shortcuts

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