proxy

package
v4.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: AGPL-3.0 Imports: 18 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 proxy puts the sensor in the request path.

Reverse sits in front of a workload's port and runs the HTTP engines over each request; Egress is a forward proxy for the workload's outbound calls and checks each destination against the indicator set. Both ask the verdict engine what to do and report what they did.

Both fail open. A panic in inspection, a rule set that has not loaded, or a request too large to buffer passes through untouched: the sensor protecting a workload must never be the reason it is down.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Egress

type Egress struct {
	Rules    *Rules
	Verdicts *decide.Engine
	Report   Reporter
	// Observe, when set, receives every connection the proxy refuses or
	// carries, matched or not (the --forward siem copy). A refusal is
	// observed at once; a carried connection when it ends, with its bytes.
	// It must not block.
	Observe func(siem.EgressDecision)
	Dial    func(network, addr string) (net.Conn, error)
	Now     func() time.Time
	// Transport forwards plain-HTTP requests. Default http.DefaultTransport.
	Transport http.RoundTripper
}

Egress is a forward proxy for a workload's outbound calls: HTTP CONNECT for TLS, and absolute-URI requests for plain HTTP. It never decrypts; it sees the host a client asks for, which is what an indicator names.

A workload reaches it through HTTPS_PROXY and HTTP_PROXY, which most SDKs honour. One that ignores them is not covered here, and the DNS check is the layer that catches it.

func (*Egress) ServeHTTP

func (p *Egress) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Reporter

type Reporter func(uplink.Event)

Reporter receives every event the proxies produce.

type Reverse

type Reverse struct {
	Upstream *url.URL
	Rules    *Rules
	Verdicts *decide.Engine
	Report   Reporter
	// HealthPaths are paths a load balancer probes. A match on one is
	// reported and never held.
	HealthPaths []string
	// BodyLimit is how much of a body is inspected. Default 1 MiB.
	BodyLimit int64
	Now       func() time.Time
	// contains filtered or unexported fields
}

Reverse is the inbound proxy.

func (*Reverse) ServeHTTP

func (p *Reverse) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Rules

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

Rules is the compiled set the proxies read, swapped atomically when a feed refresh compiles a new one.

func (*Rules) Load

func (r *Rules) Load() *engine.Set

Load returns the current set, or nil before the first load.

func (*Rules) Store

func (r *Rules) Store(s *engine.Set)

Store installs a new set.

Jump to

Keyboard shortcuts

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