Documentation
¶
Index ¶
- Constants
- type ClockConfig
- type ConnectivityConfig
- type CredentialConfig
- type DatabaseConfig
- type DispatcherConfig
- type ExecutorConfig
- type IdentityConfig
- type LoggingConfig
- type MetadataConfig
- type NetworkConfig
- type OutputConfig
- type PolicyConfig
- type PricingConfig
- type ResourcesConfig
- type TLSConfig
- type TeslaConfig
Constants ¶
const ( DefaultLogLevel = "info" DefaultMaxDebuglets = 100 // DefaultClockMaxErrorMS matches hostprobe.DefaultClockErrorBound. DefaultClockMaxErrorMS = 100 // MaxClockMaxErrorMS is one minute, well beyond any disciplined clock. MaxClockMaxErrorMS = 60_000 )
Documented defaults for keys the configuration file may omit.
const DefaultConfigPath = "/etc/debuglet/executor/executor.toml"
const MaxChainLength = int64(tesla.DefaultChainHorizon / time.Second)
MaxChainLength bounds an explicitly configured TESLA chain. It matches one epoch per second over tesla.DefaultChainHorizon, the longest chain the executor derives on its own, and keeps the precomputed chain in memory bounded. Zero still derives the length from the epoch duration.
const MaxDisclosureWindow = tesla.DefaultChainHorizon
MaxDisclosureWindow bounds d·I, the time a key stays secret after its epoch. Beyond the default chain horizon every key of a default chain would be disclosed only after it expired.
MaxEpochSeconds bounds the epoch length: one day, so the default chain still covers a week of epochs.
const MinDisclosureMargin = 10 * time.Second
MinDisclosureMargin bounds (d−1)·I from below, the time the key of a packet's previous epoch stays secret after the packet's epoch ends. A verifier refuses a key the dispatcher may have accepted, which it does up to 5 seconds early (clockSkew in internal/dispatcher/tag), before the capture time plus its own clock tolerance (1 second by default in tools/verify_pcap.py). A smaller margin makes tags of whole epochs unverifiable: at one-second epochs, d = 2 verifies nothing.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClockConfig ¶ added in v0.3.0
type ClockConfig struct {
MaxErrorMS int64 `toml:"max_error_ms"`
}
ClockConfig bounds the kernel's estimated clock error the executor accepts before it reports its clock readiness as degraded. Readiness is reported, not enforced: a degraded clock does not stop admission.
func (ClockConfig) MaxErrorBound ¶ added in v0.3.0
func (cfg ClockConfig) MaxErrorBound() time.Duration
MaxErrorBound is the configured bound as a duration; zero selects DefaultClockMaxErrorMS.
type ConnectivityConfig ¶ added in v0.3.0
type ConnectivityConfig struct {
IPv4Reflector string `toml:"ipv4_reflector"`
IPv6Reflector string `toml:"ipv6_reflector"`
Listeners bool `toml:"listeners"`
SCIONPathTarget string `toml:"scion_path_target"`
// ObserveAddresses (default true) lets the dispatcher observe this
// executor's address in each family: every 10 minutes, for each family
// without a configured reflector, the executor resolves dispatcher.addr
// and calls the address reflection over that family. It feeds the
// listing's address_v4 and address_v6 only, never admission.
ObserveAddresses bool `toml:"observe_addresses"`
}
ConnectivityConfig contains only operator-selected controlled peers. These values cannot be supplied by a measurement or by the dispatcher at runtime.
func (ConnectivityConfig) Validate ¶ added in v0.3.0
func (c ConnectivityConfig) Validate(plaintext bool) error
type CredentialConfig ¶
type CredentialConfig struct {
CACert string `toml:"ca_cert"`
ClientCert string `toml:"client_cert"`
ClientKey string `toml:"client_key"`
// EnrollmentToken is the single-use token an operator created for this
// executor's ID on the dispatcher host. It is presented once, in the
// first Hello, to bind this node's client certificate to that ID; after
// that it is spent and the key can be removed.
EnrollmentToken string `toml:"enrollment_token"`
}
type DatabaseConfig ¶
type DatabaseConfig struct {
Path string
}
type DispatcherConfig ¶
type ExecutorConfig ¶
type ExecutorConfig struct {
Identity IdentityConfig
Dispatcher DispatcherConfig
TLS TLSConfig
Resources ResourcesConfig
Tesla TeslaConfig
Network NetworkConfig
Logging LoggingConfig
Credentials CredentialConfig
Database DatabaseConfig
Pricing PricingConfig
Output OutputConfig
Isolation isolation.Config
Clock ClockConfig
Metadata MetadataConfig
Connectivity ConnectivityConfig
}
ExecutorConfig represents the structure of executor.toml
func DecodeConfig ¶ added in v0.3.0
func DecodeConfig(data []byte) (*ExecutorConfig, configcheck.Document, error)
DecodeConfig applies startup defaults and validation without connecting to a network or discovering the default interface. LoadConfig resolves an omitted interface afterwards, when the daemon starts.
func LoadConfig ¶
func LoadConfig(path string) (*ExecutorConfig, error)
LoadConfig reads and parses the executor configuration from the given path
func (*ExecutorConfig) Validate ¶
func (cfg *ExecutorConfig) Validate() error
Validate reports the first unusable configuration field. Defaults for omitted keys are applied by LoadConfig before this runs. Resource, TESLA and payment semantics stay with the subsystems that own them; this checks the values the daemon needs before it opens storage, connects or acquires a packet counter.
func (*ExecutorConfig) ValidateIsolation ¶ added in v0.3.0
func (cfg *ExecutorConfig) ValidateIsolation() error
ValidateIsolation keeps unsupported parent transports outside the shared resource profile, including when Node is constructed without loading a file.
type IdentityConfig ¶
type LoggingConfig ¶
type MetadataConfig ¶ added in v0.3.0
type MetadataConfig struct {
LocationOptOut bool `toml:"location_opt_out"`
// AddressOptOut makes the executor private (is_public false): the public
// listing then withholds its observed addresses. Prefix, ASN and
// location stay public, as for a private RIPE Atlas probe.
AddressOptOut bool `toml:"address_opt_out"`
// HostTags describe the host from the fixed vocabulary wire.HostTags,
// such as home or datacentre and dsl or fibre. They are public.
HostTags []string `toml:"host_tags"`
}
MetadataConfig controls publication of automatically derived location and of the addresses the dispatcher observes.
type NetworkConfig ¶
type NetworkConfig struct {
PacketCounter string `toml:"packet_counter"` // empty and auto retain interface discovery
// DisableSCIONEnvironment skips external configuration loading; it does
// not restrict traffic or enforce a network policy.
DisableSCIONEnvironment bool `toml:"disable_scion_environment"`
Interface string
PublicHost string `toml:"public_host"` // public IP or domain for TCP/UDP listeners; empty disables listening
PublicPorts string `toml:"public_ports"` // allowed public listener ports as comma-separated ranges, e.g. "2022,2025-3005,56000-62000"
// Policy is the operator's traffic policy for guests.
Policy PolicyConfig `toml:"policy"`
}
func (NetworkConfig) Validate ¶
func (cfg NetworkConfig) Validate() error
Validate checks the network keys, including the listener range the port manager parses and the interface the packet counter attaches to.
func (NetworkConfig) ValidatePacketCounter ¶
func (cfg NetworkConfig) ValidatePacketCounter() error
type OutputConfig ¶ added in v0.3.0
type OutputConfig struct {
ControlReserveBytes int64 `toml:"control_reserve_bytes"`
RunBytes int64 `toml:"run_bytes"`
RunFrames int64 `toml:"run_frames"`
SpoolBytes int64 `toml:"spool_bytes"`
RetainedRuns int64 `toml:"retained_runs"`
RateBytesPerSecond int64 `toml:"rate_bytes_per_second"`
BurstBytes int `toml:"burst_bytes"`
}
OutputConfig bounds emitted data and its retained spool. Zero selects the documented default. Metadata remains after end acknowledgement, but its spool charge and retained_runs slot are released.
func (OutputConfig) Limits ¶ added in v0.3.0
func (c OutputConfig) Limits() outputstore.Limits
func (OutputConfig) Rate ¶ added in v0.3.0
func (c OutputConfig) Rate() (int64, int)
func (OutputConfig) Validate ¶ added in v0.3.0
func (c OutputConfig) Validate() error
type PolicyConfig ¶
type PolicyConfig struct {
TCP *bool `toml:"tcp"`
TLS *bool `toml:"tls"`
UDP *bool `toml:"udp"`
ICMP *bool `toml:"icmp"`
SCION *bool `toml:"scion"`
Inbound *bool `toml:"inbound"`
// LocalTargets keeps loopback destinations reachable. It belongs to the
// local profile, where the guest, the executor and the measured target run
// on one machine; an executor that serves submitters it does not trust
// sets it to false.
LocalTargets *bool `toml:"local_targets"`
// DeniedDestinations are operator denials in addition to the reserved and
// internal ranges, as a comma-separated list of CIDR blocks, IP addresses
// and DNS names. A name denies the name and the addresses it resolves to,
// which is how a destination that opted out stays unreachable.
DeniedDestinations string `toml:"denied_destinations"`
// PermittedPorts are the destination ports a guest may reach, written as
// comma-separated ports and ranges. Empty permits every port.
PermittedPorts string `toml:"permitted_ports"`
}
PolicyConfig is the operator's network policy for guest traffic: which transports a guest may use and which destinations it may reach on them. It is independent of the destinations a submitter declares for a run; both are checked, and either one refusing is a refusal.
Every switch is optional and keeps its documented default when the file omits it. The defaults are the local profile's: the transports this build supports are on, SCION is off, and loopback destinations are reachable while the other reserved and internal ranges are not.
func (PolicyConfig) Compile ¶
func (cfg PolicyConfig) Compile() (netpolicy.Operator, error)
Compile returns the policy the executor applies to every guest transport.
func (PolicyConfig) Spec ¶
func (cfg PolicyConfig) Spec() netpolicy.Spec
Spec resolves the omitted switches to netpolicy.Defaults and returns the policy as the enforcement path takes it.
type PricingConfig ¶
type ResourcesConfig ¶
type TLSConfig ¶
type TLSConfig struct {
Disable bool
// ServerName overrides the dispatcher name verified in the certificate
// presented on both control channels. Empty verifies the host part of
// dispatcher.addr and dispatcher.yamux_addr, which is what a certificate
// issued for the dispatcher's own name carries. Set it when the executor
// dials an address that is not that name, such as a literal IP or the
// service name of a TLS terminator standing in front of the dispatcher.
ServerName string `toml:"server_name"`
}
type TeslaConfig ¶
type TeslaConfig struct {
Seed string `toml:"seed"`
// EpochSeconds is the epoch length I in seconds: each chain key signs
// for one epoch. Zero keeps tesla.DefaultEpochLength.
EpochSeconds int64 `toml:"epoch_seconds"`
// Delay is the deprecated name of EpochSeconds, read when EpochSeconds is
// unset. It never was a disclosure delay; see DisclosureDelayEpochs.
Delay int64 `toml:"delay"`
// DisclosureDelayEpochs is the disclosure delay d: the key of epoch i is
// disclosed once epoch i+d starts. Zero derives the smallest d whose
// d·EpochSeconds covers tesla.DefaultDisclosureWindow; an explicit value
// must be at least tesla.MinDisclosureDelay.
DisclosureDelayEpochs int64 `toml:"disclosure_delay_epochs"`
// ChainLength is the number of epochs the hash chain covers. Zero
// derives it from EpochSeconds so the chain lasts tesla.DefaultChainHorizon.
// The schedule stops advancing once the chain runs out, and packets
// tagged after that point can never be verified, so this must exceed
// the executor's expected uptime between restarts.
ChainLength int64 `toml:"chain_length"`
}
func (TeslaConfig) EpochLength ¶ added in v0.3.0
func (c TeslaConfig) EpochLength() time.Duration
EpochLength returns the configured epoch length, zero for the default. It reads the deprecated delay key only when epoch_seconds is unset.