Documentation
¶
Index ¶
Constants ¶
const ( DefaultLogLevel = "info" DefaultMaxDebuglets = 100 )
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.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
}
ExecutorConfig represents the structure of executor.toml
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.
type IdentityConfig ¶
type LoggingConfig ¶
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 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"`
Delay int64 `toml:"delay"` // epoch duration, in seconds
// ChainLength is the number of epochs the hash chain covers. Zero
// derives it from Delay 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"`
}