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 75 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 93 def client_network = nil
Returns an isolated container network name when applicable.
Source
# File lib/little_ghost/network.rb, line 85 def close = nil
Stops owned resources. Calling close more than once must be safe.
Source
# File lib/little_ghost/network.rb, line 89 def environment = {}.freeze
Returns child-process proxy and trust environment variables.
Source
# File lib/little_ghost/network.rb, line 91 def mounts = [].freeze
Returns read-only mounts required by child processes.
Source
# File lib/little_ghost/network.rb, line 83 def open(run: nil) = self
Starts run-scoped gateway resources.
Source
# File lib/little_ghost/network.rb, line 87 def validate! = self
Fails closed when the gateway is no longer ready for a child process.