Qubes Mirage VPN

Everyone knows and loves Mirage Firewall. Recently, I stumbled upon a mirage OpenVPN unikernel made for Qubes which didn’t seem to get much attention from the community. Their instructions are here.

I wanted to share this find and to know if people are using it, how it went, and with which vpns.

2 Likes

Is there a WireGuard version? Tested for leaks?

2 Likes

This seems to be OpenVPN only. I wouldn’t know if it was tested as there are only five total references to this I’ve found online.

I can confirm that it only targets OpenVPN because the code to use the vpn protocol has to be written with Ocaml. I tested a while ago and the tunnel can be established, and i can use it, but a bug causes the communication to break after a while. Unfortunately, this has not been deeply investigated yet due to time constraints.

To me, all client packets are transmitted through the tunnel, so there are no leaks. This could be an issue because the dns resolver needs to be modified in the clients appVM and doesn’t use Qubes’ default 10.139.1.[12]. I haven’t checked how this is handled with other vpn proposals.

I confirm the breakage after use.

I never presume to speak for the Qubes team.
When I comment in the Forum I speak for myself.

1 Like

Dear @unman , I updated the unikernel to the latest release of mirageOS and so far I don’t observe the tunnel crash anymore (but this may be related to a change in my openVPN server, or set of options used). Would you mind to try Update to Mirage 4.9 by palainp · Pull Request #18 · robur-coop/qubes-miragevpn · GitHub and let me know if you’re still experiencing tunnel issues (which would indicate that certain options are leading to errors, and help correct them :slight_smile: ). If so, you can report your test in the PR or here (or both) according to your preference :slight_smile:

1 Like

I tried this with ovpn configs from VPN Gate - Public Free VPN Cloud by Univ of Tsukuba, Japan
Followed the guide A MirageVPN client for QubesOS - MirageVPN - a VPN as an unikernel
but could not get it to work. Is anyone using this functionally atm?
The guide is suggesting making your own vpn server, but doesn’t seem to say that this can’t be used with any ovpn config?

For me it can’t create vif devices

Dear @James369 , I use from time to time the openVPN unikernel without any issue. So I tried with one ovpn config file provided at VPNGate and the unikernel fails with:

Fatal error: exception Failure("Invalid OpenVPN configuration : Error at byte offset 3465: \"cipher AES-128-CBC\\r\\nauth SHA1\\r\\n\\r\\n\\r\\n#################################################################\"")

I’ve opened an issue to understand what can be the root cause (see Fails to parse VPNGate default config file · Issue #288 · robur-coop/miragevpn · GitHub), and once fixed it should work normally.

@palainp Wow thanks! :smiley:how kind! what a great team.

quote: Indeed, the supported ciphers of MirageVPN are: AES-256-CBC, AES-128-GCM, AES-256-GCM and CHACHA20-POLY1305. You’d need to add the AES-128-CBC case in config.ml and likely at various pattern matches where AES-256-CBC appears.
I think this is far beyond my capabilities though :confused: So I guess I will have to find other configs that work with those ciphers then. I am looking forward to getting it to work though. I really love the idea of unikernel qubes.

I have a branch that adds this cipher. But now, it complains that tls-auth is absent from config file. I still have some work to get the tunnel up, but that sounds doable :slight_smile:

Did you try to just delete the sha and cipher sections on config file before importing? And see if those are even needed? perhaps the server could figure it out?

Unfortunately, that won’t work.

AES-128-CBC encryption is not broken and is implemented in mirage-crypto, so I was able write the code for parsing the configuration file without any issues.

But Reynir, from Robur, then discovered that the absence of tls-auth/tls-crypt/tls-cryptv2 in the configuration file required a new code path for unauthenticated channels (OpenVPN Wire Protocol (work in progress), see the GH issue for details) which is handled by the openvpn client, but not by the mirage implementation.

Until this is written and pushed, the best way to proceed is to find a server and configuration file that contain a tls-auth line.

You said earlier that you are using it, is that with any well known VPN providers?
It seems proton uses cipher AES-256-GCM
https://raw.githubusercontent.com/haugene/vpn-configs-contrib/main/openvpn/protonvpn/ch.protonvpn.tcp.ovpn
Although I am unsure about how to do auth-user-pass

If used Mirage what will be or need? vm <> firewall_1 <> vpn <> firewall_2 <> net or which one? I read is sec. if vpn vm is compromised, or for what?

Dear @James369 , unfortunately I use a private openvpn server and not publicly available config files. My configfile basically contains:

client
proto udp
explicit-exit-notify
remote X.X.X.X YY
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA256
auth-nocache
cipher AES-128-GCM
tls-client
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
verb 3

followed by <ca>, <cert>, <key> keys and a <tls-crypt> static key which authenticates me.

auth-user-pass appears to be a file containing your username/password on two lines. I suppose that in your case, this refers to your Proton VPN login credentials. In the miragevpn repository, there is a test file that incorporates this information instead of having to read another file:

<auth-user-pass>
testuser
testpass
</auth-user-pass>

But I haven’t tested how that can be used with mirage.