Software networking with isolation for Tart
Go to file
Fedor Korotkov e71b32a8dd
Populate Sentry Release (#17)
* Populate Sentry Release

* Reverted new line

* Update src/main.rs

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
2022-12-14 17:17:34 -05:00
lib Ignore ENOBUFS when writing to VM's socket (#18) 2022-12-15 00:15:19 +04:00
src Populate Sentry Release (#17) 2022-12-14 17:17:34 -05:00
.cirrus.yml Populate Sentry Release (#17) 2022-12-14 17:17:34 -05:00
.gitignore Initial revision of Softnet, a software networking for Tart 2022-06-10 16:53:03 +03:00
.goreleaser.yml Sentry integration (#13) 2022-12-12 21:33:45 +04:00
Cargo.lock Upload symbols and sources to Sentry (#15) 2022-12-14 19:34:26 +04:00
Cargo.toml Upload symbols and sources to Sentry (#15) 2022-12-14 19:34:26 +04:00
LICENSE License under AGPL-3.0 (#4) 2022-06-21 15:59:35 +03:00
README.md README.md: clarify installation instructions a bit 2022-10-13 18:30:30 +04:00
rust-toolchain Switch back to nightly toolchain (#16) 2022-12-14 23:18:24 +04:00

README.md

Softnet

Softnet is a software networking for Tart which provides better network isolation and alleviates DHCP shortage on production systems.

Working model

Softnet solves two problems:

  1. VM network isolation
  1. DHCP exhaustion
  • macOS built-in DHCP-server allocates a /24 subnet with 86400 seconds lease time by default, which only allows for ~253 VMs a day (or 1 VM every ~6 minutes) to be spawned without causing a denial-of-service, which is pretty limiting for CI services like Cirrus CI

And assumes that:

  1. Tart gives it's VMs unique MAC-addresses
  2. macOS built-in DHCP-server won't re-use the IP-addresses from it's pool until their lease expire

...otherwise it's possible for two VMs to receive an identical IP-address from the macOS built-in DHCP-server (even in the presence of Softnet's packet filtering) and thus bypass the protections offered by Softnet.

Installing

For proper functioning, Softnet binary requires two things:

  • a SUID-bit to be set on the binary or a passwordless sudo to be configured, which effectively gives the binary root privileges
    • these privileges are needed to create vmnet.framework interface and perform DHCP-related system tweaks
    • the privileges will be dropped automatically to that of the calling user (or those represented by the --user and --group command-line arguments) once all of the initialization is completed
  • the binary to be available in PATH
    • so that the Tart will be able to find it

Running

Softnet is started and managed automatically by Tart if --with-softnet flag is present when calling tart run.