# Crake: your VPN, only where it's needed

A VPN router that learns. Crake learns which hosts only answer from inside your company and sends just those through the tunnel. Everywhere else it stays out of the way, and each time it tells you why, in one sentence.

- Open source, GPL-3.0, free: no account, no paid tier, nothing to sell
- Runs on Ubuntu, Debian, Fedora, Arch and NixOS; macOS and Windows 11 in preview
- Code: https://github.com/dorhawk-software/crake
- Latest release and notes: https://github.com/dorhawk-software/crake/releases/latest
- Video, 90 seconds: https://youtu.be/VRwNp1UAEfM

## How it decides

Two signals; nothing goes through a tunnel without one. Most VPNs send everything through the company, or only the networks someone wrote into a list beforehand. Crake starts with nothing and waits for one of two signs that a host lives inside:

1. **A name only the company knows.** You open `wiki.acme.internal`; public DNS has never heard of it, only ACME's DNS knows it. Crake routes it through ACME before the first packet.
2. **A host that doesn't answer.** Your database client connects to `10.62.0.18`; there's no answer directly in 3 seconds, but through ACME it answers in 31 ms. Crake sends it through ACME.

## It says what it did

Every decision is a sentence, and every sentence can be undone. The reason is under it, with the one number that matters. When something doesn't work, you copy the day for your helpdesk in plain text, with host names left out if you like.

## Several tunnels at once

Your employer, your client and your home lab, side by side. Each host goes through the one tunnel that answers for it. You set the order; when two answer, Crake asks you, takes the faster, or keeps to the order.

- **Learned hosts expire.** A week without traffic and a host goes direct again. Pin what should stay.
- **Ask me first, if you'd rather.** A notification for each new host, and nothing moves until you say so.
- **Never through a tunnel.** Your bank, your home network: on a list Crake never touches.

## Your IT stays in charge

IT writes the rule once; Crake shows it and keeps to it. A managed tunnel says who set it up and what it may learn, in plain words. You can switch it on and off; nobody can widen it from the app. Or IT asks for a full tunnel, and Crake doesn't learn there at all.

```toml
# /etc/crake/managed.d/acme.toml
display_name = "ACME"
organisation = "ACME IT"
gateway = "vpn.acme.example"
sign_in = "browser"
learn = ["**.acme.internal", "10.40.0.0/16"]
```

## The VPNs you already have

Type the gateway, and Crake asks it what it speaks. Built on openconnect, so it speaks to the gateways your company already runs, and drives OpenVPN 3 through its own services. Sign in with your browser, a password and one-time code, or a certificate kept in your keyring.

| Gateway | Protocol | Status |
|---|---|---|
| Cisco AnyConnect | anyconnect | Used against real gateways |
| ocserv | anyconnect | Used against real gateways |
| OpenVPN 3 | openvpn3 | Used against real gateways |
| GlobalProtect | gp | Beta |
| Ivanti Connect Secure | pulse | Beta |
| Juniper Network Connect | nc | Beta |
| Fortinet SSL VPN | fortinet | Beta |
| F5 BIG-IP | f5 | Beta |
| Array Networks | array | Beta |

Beta: openconnect speaks it, but Crake hasn't been used against a real gateway of that kind yet. It should work; if yours is one, write to ondrej@dorhawk.software and say how it went.

## What stays, and what goes

Everything Crake decides, it decides on your computer. No account, no cloud, no telemetry. Ever.

What it keeps:

- **The log**: which hosts you reached, through which tunnel, and when. In `/var/lib/crake/log` (Linux), `/var/db/crake/log` (macOS), `C:\ProgramData\Crake\log` (Windows). Readable by Crake's service and the computer's administrators. Kept 30 days, or 7, or 1, or none: your choice in Settings, where Clear log empties it.
- **The hosts it learned**: which host goes through which tunnel, in `hosts.json` next to the log. Kept until a week without traffic (your choice in Settings), or until you forget them. Pinned hosts stay.
- **Passwords and certificates**: in your login keyring (GNOME Keyring on Linux, Keychain on macOS, Credential Manager on Windows), never in Crake's own files. Readable by you while you're logged in; kept until you remove the tunnel.

What it sends:

- **Your sign-in** (password, code or certificate) to your company's gateway, when you switch the tunnel on.
- **Names** public DNS doesn't know, to each tunnel's DNS through that tunnel, while it's on. With the tunnel off, your company's names aren't asked of public DNS: they just fail, quietly.
- **Traffic to the hosts that need a tunnel**, through your company's tunnel. To find those hosts, a connection that gets no answer directly is tried once through each tunnel allowed to take it. Everything else goes the way it did before Crake.
- **One question of its own**, "Is there a newer Crake?", to packages.dorhawk.software once a day, only where no package manager keeps Crake up to date. The server sees your address and the time; nothing about your tunnels or hosts. Off in Settings → General.

Crake's folder goes when you remove Crake for good: `sudo apt purge crake`, `brew uninstall --zap crake`, the Mac's uninstaller, or removing it on Fedora or Arch. On Windows, delete `C:\ProgramData\Crake` yourself.

## Nothing to clean up

Switch it off, and your computer is as it was. While a tunnel is on, Crake adds only its own nftables table (`inet crake`), one `ip rule`, routes on its own interface (`crake-acme`) and a DNS routing domain on that interface. Untouched either way: your default route, `/etc/resolv.conf`, NetworkManager's connections, your firewall's own rules, kernel modules. Stop Crake, and everything it added is gone. [A test checks exactly that](https://github.com/dorhawk-software/crake/blob/main/crates/crake/src/scenarios/checks.rs), on every system, with every release.

## The app

Opened rarely, readable on a helpdesk screen share. A panel under the tray icon, and windows for when you want to look closer: Traffic, Learning, Routing (learn as it goes, ask first, only a list, or everything), Managed by IT, an OpenVPN 3 profile editor, "Is it safe?" in About, and sign-in prompts in plain words. Light or dark, as your desktop is.

## Install

Linux first; Windows and macOS in preview. Each release is installed and tested on every system below before it goes out.

**Ubuntu and Debian** (Ubuntu 26.04, 24.04, 22.04; Debian 13, 12), from Crake's own signed repository:

```sh
sudo install -d /etc/apt/keyrings
curl -fsSL https://packages.dorhawk.software/key.asc | sudo tee /etc/apt/keyrings/dorhawk.asc >/dev/null
curl -fsSL https://packages.dorhawk.software/apt/dorhawk.sources | sudo tee /etc/apt/sources.list.d/dorhawk.sources >/dev/null
sudo apt update && sudo apt install crake
```

On Ubuntu 22.04 sign in with a password or a certificate: its openconnect is too old for browser sign-in.

**Fedora** (45, 44, 43):

```sh
sudo dnf config-manager addrepo --from-repofile=https://packages.dorhawk.software/rpm/dorhawk.repo
sudo dnf install crake
```

**Arch**: the PKGBUILD in the repository for now, the AUR soon. **NixOS**: the flake's module, `services.crake.enable = true;`

**macOS** (preview; Apple Silicon and Intel), signed and notarized; Homebrew brings openconnect along:

```sh
brew install --cask dorhawk-software/tap/crake
```

**Windows 11** (preview; Intel or AMD, and ARM): the installer from the [latest release](https://github.com/dorhawk-software/crake/releases/latest), openconnect and OpenVPN included. It isn't code-signed yet, so your browser and then Windows ask before running it: keep it, then More info, Run anyway.

What it needs: the packages bring openconnect and the rest along. On Linux, a desktop with a tray: GNOME with the AppIndicator extension, or KDE. OpenVPN 3 if you use its profiles.

**Code signing.** The Windows installers aren't code-signed yet, so Windows asks before running them. Each is built by [GitHub Actions](https://github.com/dorhawk-software/crake/actions/workflows/release.yml) from the public source; what it holds is listed [file by file](https://github.com/dorhawk-software/crake/blob/main/docs/engineering/windows-inventory.md).

## Free, and staying free

Crake has no account, no paid tier and nothing to sell you. If it saved you a helpdesk ticket, a coffee keeps it going: https://buymeacoffee.com/software.dorhawk

*crake (n.): the corncrake, Crex crex, a meadow bird heard far more often than seen.*

[All Dorhawk Software apps](https://dorhawk.software/)
