class LittleGhost::Network::Gateway
Lifecycle contract implemented by filtered-egress gateways. A Gateway is one part of enforcement; the Sandbox must also prevent direct networking.
Attributes
Network policy enforced by this gateway.
Public Class Methods
Source
# File lib/little_ghost/network.rb, line 159 def initialize(policy:) @policy = policy end
Builds a gateway for a normalized network policy.
Public Instance Methods
Source
# File lib/little_ghost/network.rb, line 177 def client_network = nil
Returns an isolated container network name when applicable.
Source
# File lib/little_ghost/network.rb, line 169 def close = nil
Stops owned resources. Calling close more than once must be safe.
Source
# File lib/little_ghost/network.rb, line 173 def environment = {}.freeze
Returns child-process proxy and trust environment variables.
Source
# File lib/little_ghost/network.rb, line 175 def mounts = [].freeze
Returns read-only mounts required by child processes.
Source
# File lib/little_ghost/network.rb, line 167 def open(run: nil) = self
Starts run-scoped gateway resources.
Source
# File lib/little_ghost/network.rb, line 171 def validate! = self
Fails closed when the gateway is no longer ready for a child process.