# Migrate: VPNs (WireGuard, OpenVPN, IPsec/IKEv2)

**What is at stake.** A VPN carries everything else, so a recorded tunnel exposes all of it if its key exchange is ever broken. Each VPN type has its own fix. None of the commands below were run here; they come from the vendors' documentation (checked 2026-12-03) or long-standing tool behaviour. The human applies them (rule 5).

## WireGuard (rule `KEX-VPN-WG-NOPSK`)

WireGuard's key exchange is Curve25519. Its optional pre-shared key mixes a symmetric secret into every handshake, so a recorded session cannot be decrypted without that secret.

1. On a trusted host, choose a new key file in a private directory outside the repository. Generate one key per peer pair using `(umask 077; set -C; wg genpsk > peerA-peerB.psk)`. The restrictive mask protects the file and shell noclobber prevents replacing an existing key. [WireGuard quick start](https://www.wireguard.com/quickstart/)
2. Add `PresharedKey = <contents>` to the `[Peer]` section on **both** sides. Never paste the value into the repo, a ticket or a chat; deliver it out of band.
3. The human reloads both ends together (`wg syncconf` or the service manager). Rollback: remove the line on both ends.

The pre-shared key is only as good as how it was delivered: if it crossed a classic-only channel, that channel is the weak point.

## OpenVPN (rule `KEX-VPN-OVPN`)

- **Hybrid key agreement.** With OpenVPN linked to OpenSSL 3.5.0+, the TLS control channel can use `X25519MLKEM768`. For mixed client bases keep the classic group after it:

  ```
  tls-groups X25519MLKEM768:X25519
  ```

  `tls-groups X25519MLKEM768` alone rejects every client that cannot do it ("no suitable key share"): that is a separate, explicit human decision. OpenVPN 2.7.0+ prints the key agreement in use when a connection starts (`key agreement: X25519MLKEM768`). Source: community.openvpn.net/PQCryptoOpenVPN.
- **tls-crypt-v2.** Wraps the control channel in a per-client symmetric key, so the classic handshake inside it is not visible to someone recording the tunnel without that key. Worth adding where it is not used yet; it does not replace the hybrid group.

## IPsec / IKEv2 (rule `KEX-VPN-IKE`)

- **strongSwan 6.0.0+** supports ML-KEM and multiple IKEv2 key exchanges (RFC 9370). A hybrid proposal adds ML-KEM after the classic exchange, for example `aes256gcm16-prfsha384-x25519-ke1_mlkem768`. Both peers need it. Source: strongSwan 6.0.0 release announcement.
- **Appliances and cloud VPN gateways:** check the vendor docs for "additional key exchange" (RFC 9370) or post-quantum pre-shared keys (PPK, RFC 8784), and put them on the vendor list.

## How to prove

P1 (re-scan closes the config finding) plus a connection log line showing the hybrid or the pre-shared key in use (OpenVPN's `key agreement:` line, strongSwan's negotiated proposal), captured by the human after reload.
