Documentation
¶
Overview ¶
Package netguard decides what a VM may reach on the network: the internet, never this machine, its local networks or the other VMs (through this machine's loopback, where their ports are forwarded), unless the user allows it in ~/.agent-vm/network. It runs in the hostagent, where every connection the guest opens is made (Lima's per-instance netstack).
Index ¶
Constants ¶
const FileName = "network"
FileName is the policy's file in agent-vm's state folder.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy struct {
// Open turns isolation off (AGENT_VM_UNSAFE_OPEN_NETWORK=1).
Open bool
// Allow are reachable whatever else: an address or network, every port
// when Port is 0.
Allow []Rule
// Domains, when any, are the only names of the internet the VMs may
// reach, subdomains included: an address is reachable once agent-vm's
// DNS gave it for one of them.
Domains []string
// contains filtered or unexported fields
}
Policy is what the VMs may reach. The zero Policy is the default: the internet only.
func Load ¶
Load reads the policy from the state folder's network file (none: the default), and AGENT_VM_UNSAFE_OPEN_NETWORK.
func (*Policy) Allows ¶
Allows reports whether the guest may reach dst over network ("tcp" or "udp": nothing else is allowed).