Documentation
¶
Overview ¶
Package firewallaudit projects decoder records into retrospective policy events. It does not intercept the transaction that produced a record.
Index ¶
Constants ¶
const ( MaxFields = 128 MaxValueBytes = 1024 MaxItems = 4 MaxDepth = 6 MaxNodes = 4096 )
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig(path string) (responseactions.Config, error)
LoadConfig reads configuration and TLS material without creating a broker or making network requests. New performs broker scope/token admission separately.
Types ¶
type Capabilities ¶
type Capabilities struct {
Version string `json:"version"`
Protocol string `json:"protocol"`
Phase string `json:"phase"`
EvaluationPhase string `json:"evaluation_phase"`
Attributes []string `json:"attributes"`
MaxFields int `json:"max_fields"`
MaxValueBytes int `json:"max_value_bytes"`
MaxItems int `json:"max_items"`
MaxDepth int `json:"max_depth"`
MaxNodes int `json:"max_nodes"`
Collections string `json:"collections"`
Omissions string `json:"omissions"`
Records []Schema `json:"records"`
}
Capabilities describes the exact compiled protobuf surface. All values are transient, including secret fields; audit output never contains field values.
func Discover ¶
func Discover() Capabilities
Discover returns an independent copy suitable for agent/tool discovery.
type ConfigJSON ¶
type ConfigJSON struct {
Scopes map[string]responseactions.Scope `json:"scopes"`
QueueSize int `json:"queueSize"`
MaxPending int `json:"maxPending"`
MaxReceipts int `json:"maxReceipts"`
Retention time.Duration `json:"retention"`
CA string `json:"ca"`
Cert string `json:"cert"`
Key string `json:"key"`
MaxActionsPerMinute int `json:"maxActionsPerMinute,omitempty"`
}
ConfigJSON matches the firewall command's effects file (durations are JSON nanoseconds). It deliberately contains no endpoint supplied by a policy.
type PacketContext ¶
type PacketContext struct{ SrcIP, DstIP string }
PacketContext must come from the caller's packet tuple, never parsed from a protocol banner, Flow string, remote-address text, or unvalidated Fields.
type Projection ¶
type Projection struct {
Event policy.Event
Truncated bool
// contains filtered or unexported fields
}
func Project ¶
func Project(m proto.Message, packet *PacketContext) (Projection, error)
Project reads but never retains or mutates the message. The decoder must own the record for the duration of the callback, as for its existing writer.
type Result ¶
type Result struct {
SchemaVersion string `json:"schema_version"`
RecordType string `json:"record_type,omitempty"`
Phase string `json:"phase"`
Decision policy.Decision `json:"decision"`
Reason string `json:"reason"`
DryRun bool `json:"dry_run"`
Truncated bool `json:"truncated,omitempty"`
EffectsRequested int `json:"effects_requested,omitempty"`
EffectsRejected int `json:"effects_rejected,omitempty"`
}
Result is metadata only. Never add event values, expressions or intent sources.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func Open ¶
Open requires explicit effect admission even for replay, but replay constructs no broker. Evaluation uses one counter state with effects removed; only a live, attributed winning decision can subsequently be converted to broker intents.
func (*Runtime) Chain ¶
Chain preserves a pre-existing observer. Collector.New wraps this callback again to retain its own network detection and record analysis.
func (*Runtime) DroppedAudit ¶
func (*Runtime) Observe ¶
func (r *Runtime) Observe(m proto.Message, packet *PacketContext) Result
Observe is synchronous, bounded projection/evaluation plus nonblocking queue admission. There is no per-record goroutine and no writer or network I/O here.
func (*Runtime) Receipts ¶
func (r *Runtime) Receipts() []responseactions.Receipt
Receipts reports asynchronous broker outcomes without record or source values.