Job miragevpn-server
README
Skip to buildsMirageVPN library purely in OCaml
MirageVPN creates secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It uses TLS to establish a (mutually) authenticated connection, over which material to derive the symmetric keys for packet encryption is exchanged. The protocol is compatible with OpenVPN™.
The goal of this project is to provide:
- A pure library implementing the protocol logic, and the OpenVPN™ config file format to enable interoperabilty and a smooth transition for existing deployments.
- MirageOS unikernels that act as OpenVPN™-compatible client and server.
We provide a handbook to guide you to install MirageVPN.
Our goal is not to implement the complete protocol, but rather a small useful subset with modern crypto and the latest key exchange methods, without deprecated or redundant features (embodying the philosophy of OCaml-tls). An initial draft of the network setup is depicted in the diagram below:
Since OpenVPN™ is not detailed in a protocol specificaton specified, apart from comments in the header files, we have written a specification document in Markdown, still work in progress.
Our configuration parser can be tested with an OpenVPN™ configuration file:
./_build/default/app/openvpn_config_parser.exe my.openvpn.conf
miragevpn_client_lwt
Unix client Included in this repository is a unix program that will connect to an
OpenVPN™ server, open a tun
interface, and tunnel packets between
the two.
Unix client on Linux
There are two ways to open tun
interfaces:
- Using a dynamically allocated interface (
dev tun
). In order to dynamically allocate atun
interface, the process will need privileges to do so. Either by running the client asroot
or with theCAP_NET_ADMIN
privilege. You would then adddev tun
to your configuration file. - Using a preallocated interface (
dev tunX
) This is the recommend configuration. To allocate such an interface fortun5
you can use this command:
You would then addsudo ip tuntap add mode tun user MYUSERNAME name tun5
dev tun5
to your configuration file.
dune build
# Bestowing the binary with CAP_NET_ADMIN if using dynamic tun allocation:
sudo setcap cap_net_admin=ep ./_build/default/app/miragevpn_client_lwt.exe
./_build/default/app/miragevpn_client_lwt.exe -v MY-CONFIG-FILE.CONF
OpenVPN™-compatible config parser
Our goal has been to implement a usable subset (as found in various real-world configuration files available to us during the implementation phase).
As far as possible we have strived to derive a representation that does not
permit ambiguity or conflicting options to be present in the parsed config.
Consult the type 'a k
declaration in openvpn_config.mli
for more
information.
This does not mean that conflicting options cannot be accepted from an on-disk
configuration file, but rather that such conflicts are explicitly handled in
the parser code (specifically in the resolve_conflict
function).
A notable difference from OpenVPN™ configuration parser is that we treat relative
paths in a configuration file to be relative to the configuration file
location, and not relative to the current working directory. OpenVPN™ supports
a --cd
argument, which we do not.
You can check compatibility with your configuration file by executing
dune build
./_build/default/app/openvpn_config_parser.exe MY-CONFIG-FILE.CONF
Discrepancies between MirageVPN and OpenVPN™
The "verify-x509-name name" in OpenVPN™ checks by default only the commonName of the subject in the X.509 certificate. MirageVPN validates the provided host against the set of hostnames in the certificate, namely the union of the commonName and the DNS entries in the SubjectAlternativeName extension.
When using a PKCS#12 file the certificates in it are not used to authenticate
the remote. OpenVPN™ will use the certificates if (and only if) no "ca" option
is specified. If it is desired to use the certificates from the PKCS#12 file
to authenticate the remote the certificates can be added with the "ca" option
by extracting the certificates with e.g. openssl pkcs12
.
For tls clients (as opposed to static key clients) we only support data channel
AEAD ciphers. This means the --auth
option is ignored for data channel
authentication for tls clients. For --tls-auth
it is still used to choose the
hmac used for the control channel while for --tls-crypt
and --tls-crypt-v2
the hmac is hardcoded (as per OpenVPN™).
If a "port" is specified, "lport" and "rport" may not be specified.
If a "remote" is specified with an IP address and no protocol (and thus no address family), and a default "proto" with an IP address family is specified, we ignore that default IP address family:
proto udpv6
remote 127.0.0.1
We consider this as "remote 127.0.0.1 udp4".
Funding
This project was funded in 2019 for six months by the German federal ministry for education and research via the Prototypefund - the amount was 47500 EUR.
In 2023, we received funding from European Union in the Next Generation Internet project (NGI assure, via NLnet. The scope was updating to the current protocol version (tls-crypt-v2 etc.), a QubesOS client, a server implementation, and more documentation. The amount was 57000 EUR. Learn more at the NLnet project page.
Builds
Back to readme- ☑ freebsd-14 2024-12-21 00:02:22Z ovpn-server.hvt
SHA256:f2a474f16e65469cb176437aa1b9bcf8a6867a7109436cd4063857998153ae86
(6.89MB) - ☒ freebsd-14 2024-12-20 00:01:29Z Build failure: exited 1
- ☑ freebsd-14 2024-12-10 00:22:23Z ovpn-server.hvt
SHA256:67597adc9a401fd57cf051a3483476b3a54b0121fcd8c84bd4aa8be5153c9d6c
(6.89MB) - ☒ freebsd-14 2024-12-05 23:50:03Z Build failure: exited 125
- ☒ freebsd-14 2024-12-05 01:19:35Z Build failure: exited 125
- ☒ freebsd-14 2024-12-03 23:48:19Z Build failure: exited 125
- ☒ freebsd-14 2024-12-02 23:47:27Z Build failure: exited 125
- ☒ freebsd-14 2024-12-02 00:33:49Z Build failure: exited 125
- ☒ freebsd-14 2024-12-01 00:32:53Z Build failure: exited 125
- ☒ freebsd-14 2024-11-30 00:16:52Z Build failure: exited 125
- ☑ freebsd-14 2024-11-27 23:43:04Z ovpn-server.hvt
SHA256:14827a7c28667e71bb53619c23acf45d4add43b61406ff9c378a5de7e12e282c
(6.89MB) - ☑ freebsd-14 2024-11-14 23:58:33Z ovpn-server.hvt
SHA256:305c2e9526c632efe5a299842a88f918ecc3116ba6d6ead51c56e9cd4ab862a6
(6.89MB) - ☑ freebsd-14 2024-11-06 23:24:51Z ovpn-server.hvt
SHA256:0189cc8b74ebbd5592aeb24c81a7d6d4c311e8ea36d9b4ae1cd0b55070ebdd6a
(6.89MB) - ☑ freebsd-14 2024-10-22 23:11:37Z ovpn-server.hvt
SHA256:e8fb76585c46fc119898c7d48dda6c50955bad53e443fef0b1691fbaa453754f
(6.89MB) - ☑ freebsd-14 2024-10-14 23:04:33Z ovpn-server.hvt
SHA256:924ecdbf843d060081b1b0efbe528a21fbcd6742f43ac8ca9908521076c2be84
(6.89MB) - ☑ freebsd-14 2024-10-13 23:03:40Z ovpn-server.hvt
SHA256:4d8e988002580a6129c501b9c5dfe59cbcd263f7dc07ce4d9a48643c19987a6b
(6.89MB) - ☑ freebsd-14 2024-10-10 23:00:56Z ovpn-server.hvt
SHA256:987a6a955ac75d7e811bc21af2954c748ebeba974d2521297bc3358ebf272912
(6.89MB) - ☒ freebsd-14 2024-10-02 15:49:51Z Build failure: exited 1
- ☒ freebsd-14 2024-10-01 21:21:04Z Build failure: exited 1
- ☒ freebsd-14 2024-09-30 15:48:00Z Build failure: exited 1
- ☒ freebsd-14 2024-09-29 15:47:05Z Build failure: exited 1
- ☒ freebsd-14 2024-09-28 15:46:07Z Build failure: exited 1
- ☒ freebsd-14 2024-09-27 15:45:14Z Build failure: exited 1
- ☑ freebsd-14 2024-09-27 10:02:37Z ovpn-server.hvt
SHA256:1ffa44465ae59eafae92c0ac078858e661b517759611d113a6842cf4a72d39ff
(7.09MB) - ☑ freebsd-14 2024-09-12 15:33:57Z ovpn-server.hvt
SHA256:6f0057a7d142bdc48cf75fea410a050f79585fb8c8c0382ef2ff337cf11e448f
(7.09MB) - ☑ freebsd-14 2024-08-04 15:31:05Z ovpn-server.hvt
SHA256:13ec86b50380cbfd8a67f4c37aef5581fe7211b2405ec7346b331d7ab8942c04
(7.09MB) - ☑ freebsd-14 2024-07-20 14:43:33Z ovpn-server.hvt
SHA256:55316f9e907898dd0e96038163193ec0a9e1b680fae5d1431ae6ef019d91b2af
(7.09MB)
Excluding failed builds here.