Documentation
¶
Overview ¶
Package ateomtunnel wires atunnel into an ateom: its flags, listeners, DNS relay, and per-actor ingress and egress. Both ateoms build their tunnel here so they cannot drift.
Index ¶
- type ActorEgress
- type Config
- type FlagSet
- type Tunnel
- func (t *Tunnel) Activate(actor resources.ActorAttribution, dial atunnel.DialFunc, egress *ActorEgress) error
- func (t *Tunnel) ActorEgressPolicy(actor resources.ActorAttribution) dns.PolicySource
- func (t *Tunnel) Deactivate(ctx context.Context, actor resources.ActorAttribution) error
- func (t *Tunnel) PrepareEgress(ctx context.Context, actor resources.ActorAttribution, ...) (*ActorEgress, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActorEgress ¶
type ActorEgress struct {
// contains filtered or unexported fields
}
ActorEgress is an actor's tunneled egress, ready to activate.
type Config ¶
type Config struct {
// ListenAddress serves actor ingress HTTPS.
ListenAddress string
// ConnectListenAddress serves actor ingress mTLS CONNECT.
ConnectListenAddress string
// CredentialBundle holds the worker Pod certificate and key, used for
// inbound serving, outbound mTLS, and authentication to the atelet broker.
CredentialBundle string
// TrustBundle verifies router clients and the node-local atelet.
TrustBundle string
// ClientIdentity is the SPIFFE ID allowed to call actor ingress HTTPS.
ClientIdentity string
// BrokerIdentity is the SPIFFE ID the node-local atelet must present on the
// credential broker connection. It names atelet's namespace, not this
// worker's, so it is configured rather than derived from the downward API.
BrokerIdentity string
// EgressListenAddress receives transparently intercepted actor egress TCP.
EgressListenAddress string
// EgressTrustBundle verifies the remote egress gateway's serving cert.
EgressTrustBundle string
// DNSEgressPolicy selects the DNS egress policy enforcement mode.
DNSEgressPolicy string
}
Config is the atunnel setup an ateom takes from its flags.
func RegisterFlags ¶
RegisterFlags registers the atunnel flags on fs and returns the Config they fill once fs is parsed.
type Tunnel ¶
type Tunnel struct {
// Ingress proxies router traffic to the active actors.
Ingress *atunnel.Server
// Egress tunnels the active actors' outbound TCP to the egress gateway.
Egress *atunnel.Egress
// EgressPort is the local atunnel listener used as the target of the
// actor network's transparent TCP redirect.
EgressPort uint16
// DNSRelay answers the sandbox's DNS from inside its own namespace.
DNSRelay *dns.Relay
// contains filtered or unexported fields
}
Tunnel is the atunnel state one ateom shares across its actors.
func Start ¶
Start builds the DNS relay and starts serving actor ingress, which proxies to upstream inside each sandbox. Egress binds only in sandbox namespaces, so nothing listens for it here.
func (*Tunnel) Activate ¶
func (t *Tunnel) Activate(actor resources.ActorAttribution, dial atunnel.DialFunc, egress *ActorEgress) error
Activate starts admitting the actor's traffic. Ingress reaches the actor through dial; egress is activated only when it was prepared.
func (*Tunnel) ActorEgressPolicy ¶ added in v0.5.0
func (t *Tunnel) ActorEgressPolicy(actor resources.ActorAttribution) dns.PolicySource
ActorEgressPolicy returns the source of actor's egress policy for its DNS relay.
func (*Tunnel) Deactivate ¶
Deactivate stops admitting the actor's traffic and drains its active streams, before the actor network is torn down. It attempts both directions even if one fails.
func (*Tunnel) PrepareEgress ¶
func (t *Tunnel) PrepareEgress(ctx context.Context, actor resources.ActorAttribution, gateway *ateompb.EgressGateway) (*ActorEgress, error)
PrepareEgress mints the actor's certificate and builds its gateway client. A nil gateway means the actor has no tunneled egress and yields a nil result.