Software networking with isolation for Tart
Go to file
dependabot[bot] 86ccd9f5bf
Bump the all-updates group across 1 directory with 8 updates
Bumps the all-updates group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [dhcproto](https://github.com/bluecatengineering/dhcproto) | ``eece41c`` | ``60719e5`` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.102` | `1.0.103` |
| [sentry](https://github.com/getsentry/sentry-rust) | `0.48.1` | `0.48.3` |
| [sentry-anyhow](https://github.com/getsentry/sentry-rust) | `0.48.1` | `0.48.3` |
| [nix](https://github.com/nix-rust/nix) | `0.31.2` | `0.31.3` |
| [prefix-trie](https://github.com/tiborschneider/prefix-trie) | `0.8.3` | `0.9.2` |
| [log](https://github.com/rust-lang/log) | `0.4.29` | `0.4.33` |
| [serial_test](https://github.com/palfrey/serial_test) | `3.4.0` | `3.5.0` |



Updates `dhcproto` from `eece41c` to `60719e5`
- [Release notes](https://github.com/bluecatengineering/dhcproto/releases)
- [Commits](eece41c9a1...60719e5df1)

Updates `anyhow` from 1.0.102 to 1.0.103
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.102...1.0.103)

Updates `sentry` from 0.48.1 to 0.48.3
- [Release notes](https://github.com/getsentry/sentry-rust/releases)
- [Changelog](https://github.com/getsentry/sentry-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-rust/compare/0.48.1...0.48.3)

Updates `sentry-anyhow` from 0.48.1 to 0.48.3
- [Release notes](https://github.com/getsentry/sentry-rust/releases)
- [Changelog](https://github.com/getsentry/sentry-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-rust/compare/0.48.1...0.48.3)

Updates `nix` from 0.31.2 to 0.31.3
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.31.2...v0.31.3)

Updates `prefix-trie` from 0.8.3 to 0.9.2
- [Release notes](https://github.com/tiborschneider/prefix-trie/releases)
- [Commits](https://github.com/tiborschneider/prefix-trie/commits)

Updates `log` from 0.4.29 to 0.4.33
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.29...0.4.33)

Updates `serial_test` from 3.4.0 to 3.5.0
- [Release notes](https://github.com/palfrey/serial_test/releases)
- [Commits](https://github.com/palfrey/serial_test/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: dhcproto
  dependency-version: 60719e5df11359b12bf74e743b3c7e0831351c2d
  dependency-type: direct:production
  dependency-group: all-updates
- dependency-name: anyhow
  dependency-version: 1.0.103
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-updates
- dependency-name: sentry
  dependency-version: 0.48.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-updates
- dependency-name: sentry-anyhow
  dependency-version: 0.48.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-updates
- dependency-name: nix
  dependency-version: 0.31.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-updates
- dependency-name: prefix-trie
  dependency-version: 0.9.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-updates
- dependency-name: log
  dependency-version: 0.4.33
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-updates
- dependency-name: serial_test
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-28 00:04:18 +00:00
.cargo Introduce --block in addition to --allow (#126) 2025-10-21 17:14:28 +04:00
.github Add CODEOWNERS and group all Dependabot updates in a single PR (#96) 2025-03-31 19:15:04 +04:00
lib --allow: support "@host" syntax (#160) 2026-05-15 16:06:03 +02:00
src --allow: support "@host" syntax (#160) 2026-05-15 16:06:03 +02:00
.cirrus.yml Perform batched reads from host to improve efficiency (#128) 2025-10-28 16:48:05 +04:00
.gitignore Goreleaser Fix (#30) 2024-01-24 19:09:59 +04:00
.goreleaser.yml .goreleaser.yml: require macOS Sequoia (see #128) 2025-10-28 13:49:09 +01:00
Cargo.lock Bump the all-updates group across 1 directory with 8 updates 2026-06-28 00:04:18 +00:00
Cargo.toml Bump vmnet from 0.5.0 to 0.5.1 in the all-updates group (#138) 2026-01-19 14:29:58 +01:00
LICENSE Relicense under FSL-1.1-ALv2 (#166) 2026-06-05 15:37:14 -07:00
README.md README.md: clarify how Softnet restricts networking (#71) 2025-01-10 19:31:08 +04:00
rust-toolchain.toml $ cargo update (#40) 2024-07-23 14:33:31 +04:00

README.md

Softnet

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

It is essentially a userspace packet filter which restricts the VM networking and prevents a class of security issues, such as ARP spoofing. By default, the VM will only be able to:

  • send traffic from its own MAC-address
  • send traffic from the IP-address assigned to it by the DHCP
  • send traffic to globally routable IPv4 addresses
  • send traffic to gateway IP of the vmnet bridge (this would normally be "bridge100" interface)
  • receive any incoming traffic

In addition, Softnet tunes macOS built-in DHCP server to decrease its lease time from the default 86,400 seconds (one day) to 600 seconds (10 minutes). This is especially important when you use Tart to clone and run a lot of ephemeral VMs over a period of one day.

Please check out this blog post for backstory.

Working model

Softnet solves two problems:

  1. VM network isolation
  2. 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 --net-softnet flag is provided when calling tart run.