Documentation
¶
Overview ¶
Package networkfirewall implements a routed, verdict-producing packet firewall. It does not decrypt TLS or modify packet bytes.
Index ¶
- Variables
- func PrepareOwned(ctx context.Context, c Config) error
- func ProvisionOwned(ctx context.Context, c Config, provision func() error) error
- func RetireOwned(ctx context.Context, c Config, retire func() error) error
- type Config
- type Counters
- type Decision
- type Evaluator
- type Firewall
- type PacketEvent
- type TLSMetadata
- type Verdict
Constants ¶
This section is empty.
Variables ¶
var ErrFragment = errors.New("fragment requires explicit failure verdict; reassembly unsupported")
Functions ¶
func PrepareOwned ¶
PrepareOwned installs persistent missing-listener-deny hooks before routing.
func ProvisionOwned ¶
ProvisionOwned holds the packet-owner fences and persistent deny hooks while a supervisor reconciles topology. The callback must not reacquire these fences.
Types ¶
type Config ¶
type Config struct {
Namespace, Interface string
ProtectedCIDRs []string
// ManagementDestinations exempts these peer CIDRs in both flow directions.
ManagementDestinations []string
Hook string // input or forward
Queue uint16
MaxQueueLen uint32
Deadline time.Duration
FailureVerdict Verdict
// BypassWithoutListener and FailOpenOnOverflow are independent kernel policies.
BypassWithoutListener, FailOpenOnOverflow bool
// InspectTLS enables bounded visible ClientHello metadata; it never holds a
// packet waiting for a later segment and cannot inspect encrypted application data.
InspectTLS bool
// Persistent appliance hooks require lifetime-lock fencing for recovery.
OwnershipNonce string
RecoverOwned bool
}
type Counters ¶
type Counters struct{ Packets, Accepted, Dropped, WouldDeny, ParseErrors, EvaluationErrors, Deadlines, Overloads, VerdictErrors, ReceiveErrors uint64 }
type Evaluator ¶
type Evaluator interface {
EvaluatePacket(PacketEvent) (Decision, error)
}
Evaluator must be safe to retain until its outstanding call finishes. Only one call runs at a time; a hung evaluator consumes one worker, never one per packet.
type Firewall ¶
type Firewall struct {
Operations *runtimeobs.Monitor
// contains filtered or unexported fields
}
func (*Firewall) Ready ¶
func (f *Firewall) Ready() <-chan struct{}
Ready closes after both the queue listener and scoped diversion rules exist.
type PacketEvent ¶
type PacketEvent struct {
SrcIP, DstIP string
SrcPort, DstPort int
Transport string
IPVersion, TCPFlags int
Direction string
TLS *TLSMetadata
}
func ParsePacket ¶
func ParsePacket(b []byte) (e PacketEvent, err error)
ParsePacket accepts a complete L3 packet. Fragmented traffic, IPv6 jumbograms, ESP and unknown extension headers are deliberately not classified as TCP/UDP.
type TLSMetadata ¶
TLSMetadata describes only the visible ClientHello. ECH can hide the real SNI.