Peer-to-peer · built on iroh

Your machines,
directly connected.

Starmole connects your machines to each other by public key, wherever they are. Shells, commands, services and port forwards go straight through NAT and firewalls, with no open ports, no VPN server and no control plane. Who gets in, and to what, is decided by certificates your own network key signs.

laptop
$ starmole status
node    3b6f0d2e8c41a7e9…
network 9a41c7f2b0e6d3a8…
workstation  51f8a2c9e3  direct 192.168.20.31:41641 (6.8ms)
mac          c07e4b1d9a  relay euc1-1.relay.n0.iroh.link (31.2ms)
nas          9d2e7a4f1b  last seen 2h 5m ago

$ starmole shell workstation
john@workstation:~$ 

What Starmole gives you

NAT & firewall traversal

Connections start through a relay and switch to a direct path once hole punching works. Home routers, CGNAT and hotel wifi are fine, and there's nothing to forward.

Bring your own auth

Invite machines with one-time tokens, trust the SSH certificate authority you already run, or have people sign in at your identity provider over OIDC for a short certificate with their groups.

No control plane required

Your network is a key you hold. Machines check each other's certificates offline, pass revocations along among themselves, and decide with their own rules what peers may do.

How it works

Dial a key, not an address.

Each machine has a key, and that key is its address. Connections are QUIC over iroh, which finds peers and punches through NAT. A machine's IP address changes; its key doesn't.

  1. 01

    Keys

    Every machine makes an Ed25519 key with starmole init. Your network has a key too, made once with starmole net init.

  2. 02

    Certificates

    The network key signs each machine a certificate with its name, tags and groups. starmole invite and join hand one out without anyone copying keys around.

  3. 03

    Rules

    Each machine's [[allow]] rules say what certificates may do there: a shell for tag:admin, a service for group:eng.

  4. 04

    Revocation

    Certificates renew themselves and expire. starmole revoke cuts a machine off everywhere within seconds, passed from machine to machine.

Services

Offer things by name. Grant them by group.

A machine offers a program as a named service, and members with the right group or tag open it. Nothing else behind the machine is reachable. With identity = true the program is told who's connecting, so it can tell people apart without a login of its own.

  • Groups come from your identity provider when people sign in
  • Open one on a local port, or over stdin and stdout as an ssh ProxyCommand
  • A machine without access is told the service doesn't exist
workstation · config.toml
[services.grafana]
connect = "127.0.0.1:3000"

[[allow]]
from = ["group:eng"]
caps = ["service:grafana"]
laptop
$ starmole services workstation
grafana
$ starmole open workstation/grafana --port 3000
grafana on workstation at 127.0.0.1:3000 (Ctrl-C to stop)

Use cases

Start with one box. Grow from there.

Per machine

Reach the network behind a node

Port forwards and a SOCKS proxy through a peer, or a tun device with an address per machine. A machine can expose the subnet behind it to peers its rules allow: the NAS, the printer, the lab rack.

Teams and fleets

Access through your identity provider

People sign in at an auth service and get a short certificate with their groups. Servers can sign themselves in and renew on their own. starmole log shows who connected and what they ran.

Library first

Your program can be a node.

The daemon is a Rust crate. Build on it and your program gets its own key and certificate, renewal, revocations and the same rules as everything else, while serving protocols of its own.

  • Async Rust on iroh and QUIC
  • Strangers are turned away before your code runs
  • Invite, retag and revoke machines from code
main.rs
let dir = ConfigDir::new("/var/lib/hello");
let socket = starmole::bind_socket(
    &dir.path().join("daemon.sock")).await?;
let config = dir.load_config()?;
let builder = Builder::new(dir, config);
let peers = builder.peers();

// only members of the network reach Hello
let node = builder
    .serve(ALPN, Access::Members, Hello(peers))
    .start().await?;
node.serve(socket).await?;

Dig out of the NAT. Reach for the stars.

Static binaries for Linux (x86_64 and aarch64) and macOS are on the releases page. Unpack one and put its bin on your PATH. The Nix flake has modules for NixOS, home-manager and nix-darwin.

curl -L https://github.com/starmole-dev/starmole/releases/download/v0.1.0/starmole-0.1.0-x86_64-linux.tar.gz | tar xz
Starmole poster: a mole in a space helmet on an orange streak. Secure access anywhere.