Skip to content

Commit

Permalink
network: rewrite qubes-firewall daemon
Browse files Browse the repository at this point in the history
This rewrite is mainly to adopt new interface for Qubes 4.x.
Main changes:
 - change language from bash to python, introduce qubesagent python package
 - support both nftables (preferred) and iptables
 - new interface (https://qubes-os.org/doc/vm-interface/)
 - IPv6 support
 - unit tests included
 - nftables version support running along with other firewall loaded

Fixes QubesOS/qubes-issues#1815
QubesOS/qubes-issues#718
  • Loading branch information
marmarek committed Sep 12, 2016
1 parent b50cba3 commit ee0a292
Show file tree
Hide file tree
Showing 10 changed files with 1,124 additions and 59 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ install-common:
$(MAKE) -C autostart-dropins install
install -m 0644 -D misc/fstab $(DESTDIR)/etc/fstab

# force /usr/bin before /bin to have /usr/bin/python instead of /bin/python
PATH="/usr/bin:$(PATH)" python setup.py install -O1 --root $(DESTDIR)
mkdir -p $(DESTDIR)$(SBINDIR)
mv $(DESTDIR)/usr/bin/qubes-firewall $(DESTDIR)$(SBINDIR)/qubes-firewall

install -D -m 0440 misc/qubes.sudoers $(DESTDIR)/etc/sudoers.d/qubes
install -D -m 0440 misc/sudoers.d_qt_x11_no_mitshm $(DESTDIR)/etc/sudoers.d/qt_x11_no_mitshm
install -D -m 0644 misc/20_tcp_timestamps.conf $(DESTDIR)/etc/sysctl.d/20_tcp_timestamps.conf
Expand Down Expand Up @@ -200,7 +205,6 @@ install-common:


install -d $(DESTDIR)/$(SBINDIR)
install network/qubes-firewall $(DESTDIR)/$(SBINDIR)/
install network/qubes-netwatcher $(DESTDIR)/$(SBINDIR)/

install -d $(DESTDIR)$(BINDIR)
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Depends:
net-tools,
psmisc,
python2.7,
python-daemon,
python-gi,
python-xdg,
python-dbus,
Expand Down
2 changes: 2 additions & 0 deletions network/ip6tables
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
:INPUT DROP [1:72]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
:QBS-FORWARD - [0:0]
-A INPUT -i lo -j ACCEPT
-A FORWARD -j QBS-FORWARD
COMMIT
# Completed on Tue Sep 25 16:00:20 2012
2 changes: 2 additions & 0 deletions network/iptables
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ COMMIT
:INPUT ACCEPT [168:11399]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [128:12536]
:QBS-FORWARD - [0:0]
-A INPUT -i vif+ -p udp -m udp --dport 68 -j DROP
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i vif+ -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i vif+ -j REJECT --reject-with icmp-host-prohibited
-A INPUT -j DROP
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -j QBS-FORWARD
-A FORWARD -i vif+ -o vif+ -j DROP
-A FORWARD -i vif+ -j ACCEPT
-A FORWARD -j DROP
Expand Down
58 changes: 0 additions & 58 deletions network/qubes-firewall

This file was deleted.

Empty file added qubesagent/__init__.py
Empty file.
Loading

0 comments on commit ee0a292

Please sign in to comment.