Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddInboundRule ¶
AddInboundRule adds new inbound rule to the platform specific firewall.
func RemoveInboundRule ¶
RemoveInboundRule removes inbound rule from the platform specific firewall.
Types ¶
type IncomingRuleRemove ¶
type IncomingRuleRemove func() error
IncomingRuleRemove type defines function for removal of created rule.
type IncomingTrafficFirewall ¶
type IncomingTrafficFirewall interface { Setup() error Teardown() BlockIncomingTraffic(network net.IPNet) (IncomingRuleRemove, error) AllowURLAccess(rawURLs ...string) (IncomingRuleRemove, error) AllowIPAccess(ip net.IP) (IncomingRuleRemove, error) }
IncomingTrafficFirewall defines provider side firewall, to control which traffic is enabled to pass and which not.
func NewIncomingTrafficFirewall ¶
func NewIncomingTrafficFirewall(enabled bool) IncomingTrafficFirewall
NewIncomingTrafficFirewall creates firewall instance for incoming traffic.
type OutgoingRuleRemove ¶
type OutgoingRuleRemove func()
OutgoingRuleRemove type defines function for removal of created rule.
func AllowIPAccess ¶
func AllowIPAccess(ip string) (OutgoingRuleRemove, error)
AllowIPAccess adds IP based exception.
func AllowURLAccess ¶
func AllowURLAccess(urls ...string) (OutgoingRuleRemove, error)
AllowURLAccess adds exception to blocked traffic for specified URL (host part is usually taken).
func BlockNonTunnelTraffic ¶
func BlockNonTunnelTraffic(scope Scope, outboundIP string) (OutgoingRuleRemove, error)
BlockNonTunnelTraffic effectively disallows any outgoing traffic from consumer node with specified scope.
type OutgoingTrafficFirewall ¶
type OutgoingTrafficFirewall interface { Setup() error Teardown() BlockOutgoingTraffic(scope Scope, outboundIP string) (OutgoingRuleRemove, error) AllowIPAccess(ip string) (OutgoingRuleRemove, error) AllowURLAccess(rawURLs ...string) (OutgoingRuleRemove, error) }
OutgoingTrafficFirewall defines consumer side firewall a.k.a. kill switch. Purpose is to detect traffic which leaves machine and reject it, because during established VPN connection it is expected to leave through tunnel device only.
var DefaultOutgoingFirewall OutgoingTrafficFirewall = &outgoingFirewallNoop{}
DefaultOutgoingFirewall outgoing traffic firewall bootstrapped for global calls.
func NewOutgoingTrafficFirewall ¶
func NewOutgoingTrafficFirewall(enabled bool) OutgoingTrafficFirewall
NewOutgoingTrafficFirewall creates firewall instance for outgoing traffic.