2019-04-08 17:05:39 -04:00
Mirage Firewall
===============
A unikernel firewall for Qubes OS.
This site will help collecting information about the mirage firewall, an interesting project from "talex5".
To learn more about the Mirage Firewall, please make sure to read
- https://github.com/mirage/qubes-mirage-firewall
- https://github.com/mirage/qubes-mirage-firewall/blob/master/README.md
The Mirage Firewall for Qubes OS is a low ressource firewall, which uses a much smaller footprint
compared to the default ("fat") sys-firewall.
This page is only to write down how to build the mirage firewall for Qubes OS.
Please make sure to read the above links to understand more about it.
2019-04-09 02:49:44 -04:00
Most information from here has been put together reading the original docs above and following the discussion in the Qubes OS User Mailinglist / Google Groups:
https://groups.google.com/forum/#!topic/qubes-users/xfnVdd1Plvk
2019-04-08 17:05:39 -04:00
Build process on Qubes 4
========================
```
2019-04-18 18:15:31 -04:00
MirageFWBuildVM=my-mirage-buildvm
2019-04-09 02:49:44 -04:00
TemplateVM=fedora-29
2019-04-18 18:15:31 -04:00
MirageFWAppVM=sys-mirage-fw2
# create a new VM
qvm-create $MirageFWBuildVM --class=AppVM --label=red --template=$TemplateVM
2019-04-09 02:49:44 -04:00
2019-04-08 17:05:39 -04:00
# Resize private disk to 10 GB
2019-04-18 18:15:31 -04:00
qvm-volume resize $MirageFWBuildVM:private 10GB
2019-04-08 17:05:39 -04:00
# Create a symbolic link to safe docker into the home directory
2019-04-18 18:15:31 -04:00
qvm-run --auto --pass-io --no-gui $MirageFWBuildVM \
2019-04-09 02:49:44 -04:00
'sudo mkdir /home/user/var_lib_docker && \
sudo ln -s /var/lib/docker /home/user/var_lib_docker'
2019-04-08 17:05:39 -04:00
2019-04-18 18:15:31 -04:00
# Install docker and git ~2min
qvm-run --pass-io --no-gui $MirageFWBuildVM \
'sudo qvm-sync-clock & & \
sudo dnf -y install docker git'
2019-04-08 17:05:39 -04:00
# Launch docker
2019-04-18 18:15:31 -04:00
qvm-run --pass-io --no-gui $MirageFWBuildVM \
2019-04-09 02:49:44 -04:00
'sudo systemctl start docker'
2019-04-08 17:05:39 -04:00
2019-04-18 18:15:31 -04:00
# Download and build mirage for qubes ~11min
qvm-run --pass-io --no-gui $MirageFWBuildVM \
2019-04-09 02:49:44 -04:00
'git clone https://github.com/mirage/qubes-mirage-firewall.git & & \
2019-04-08 17:05:39 -04:00
cd qubes-mirage-firewall & & \
2019-04-09 02:49:44 -04:00
git pull origin pull/52/head & & \
sudo ./build-with-docker.sh'
# Copy the new kernel to dom0
cd /var/lib/qubes/vm-kernels
2019-04-18 18:15:31 -04:00
qvm-run --pass-io $MirageFWBuildVM 'cat qubes-mirage-firewall/mirage-firewall.tar.bz2' | tar xjf -
2019-04-08 17:26:02 -04:00
2019-04-18 18:15:31 -04:00
# create a new mirage fw appvm
2019-04-09 02:49:44 -04:00
qvm-create \
--property kernel=mirage-firewall \
--property kernelopts=None \
--property memory=32 \
--property maxmem=32 \
--property netvm=sys-net \
--property provides_network=True \
--property vcpus=1 \
--property virt_mode=pv \
--label=green \
--class StandaloneVM \
$MirageFWAppVM
2019-04-08 17:26:02 -04:00
2019-04-18 18:15:31 -04:00
# Change default NetVM to Mirage FW
2019-04-09 02:49:44 -04:00
qvm-start $MirageFWAppVM
2019-04-18 18:15:31 -04:00
qubes-prefs --set default_netvm $MirageFWAppVM
2019-04-09 03:07:23 -04:00
```