172 Commits

Author SHA1 Message Date
linse
64a7fe7056 WIP 2019-06-08 01:44:09 +02:00
linse
dee0d32549 Changes to adapt to pf change that models port ranges as options. 2019-06-08 01:26:37 +02:00
linse
8f392a5ae1 TCP connect denied test. 2019-06-08 01:09:43 +02:00
linse
63315ff1cc Add TCP connect test. 2019-06-08 00:44:25 +02:00
Mindy
6e991f4184 implement a test for port range of size >1 2019-06-10 11:00:40 -05:00
Mindy
8f2bee4fb1 restore space to firewall test log name 2019-06-10 10:39:13 -05:00
Mindy
dce19f2c90 set log levels to minimize noise 2019-06-10 10:39:05 -05:00
Mindy
b164a1a5ab change output for corrupted UDP packet response case 2019-06-10 09:46:09 -05:00
Mindy
959fb31173 pass the source port when sending UDP fetch test packet 2019-06-10 09:35:21 -05:00
linse
934dd81edf WIP 2019-06-07 15:44:45 +02:00
Mindy
056873e25b WIP: changing output to be more human-readable
Don't build the firewall with -l "*:debug", and try to emit more
reasonable test output from the test unikernel.  Unfortunately we don't
get any output from the tests themselves for reasons as yet unknown.
2019-06-04 11:55:42 -05:00
Mindy
faa5b37139 add update-firewall script 2019-06-04 11:05:48 -05:00
Mindy
43960c6080 add notes on setup program flow 2019-05-31 14:19:45 -05:00
Mindy
010e5945a6 try to read rules dynamically 2019-05-30 19:05:48 -05:00
Mindy
27de63ffed make rules a mutable field in client_link; don't read and set them at connect time 2019-05-30 18:08:59 -05:00
Mindy
b15dd32df8 apply rules to incoming traffic (but...)
...we try to read them before they've been written to QubesDB, so we
think there aren't any.  To get useful results, we'll need to either
delay the rule read, or implement a proper watcher for the firewall
rules using the QubesDB watch interface.
2019-05-23 17:40:09 -05:00
linse
068c5dca9b WIP. 2019-05-23 21:31:20 +02:00
linse
83026f4067 Parse firewall rules from QubesDB (but don't apply them yet :D) 2019-05-18 04:06:09 +02:00
linse
a63fcf0dbb Set up everything for rule reading from QubesDB (but don't do it yet ;-)
)
2019-05-18 02:49:30 +02:00
Mindy
bf8f7c7fd2 test against udp echo server 2019-05-22 10:56:22 -05:00
Mindy
5379b91b5a add comments about what to do next 2019-05-22 10:56:01 -05:00
linse
aca6ac84d8 WIP. 2019-05-18 01:29:50 +02:00
linse
41126c9a6b Handle the exception to check if it was thrown when expected. 2019-05-17 23:58:51 +02:00
linse
09139518fb Rename to test.sh, break if build fails. 2019-05-17 23:17:04 +02:00
linse
1599f63838 Initial test setup. :) 2019-05-17 01:35:11 +02:00
linse
47e3c6c64c Add test directory and setup instructions in setup.sh 2019-05-17 00:48:04 +02:00
Mindy
3ac145c1ff add some docstrings for host type options 2019-05-16 17:48:26 -04:00
Mindy
45ffee89e1 fix merge mistake :) 2019-05-16 17:48:17 -04:00
Mindy
0d54f80b6b try to make the packet type difference a bit clearer 2019-05-16 17:44:58 -04:00
Mindy
ad48a0f78a remove commented out thing 2019-05-16 17:24:19 -04:00
Mindy
f2c309c923 packet.mli yay 2019-05-16 17:23:38 -04:00
Mindy
1fb1d35170 it builds yey 2019-05-16 17:23:19 -04:00
Mindy
1e7d894cf9 wip moremake 2019-05-16 17:06:25 -04:00
Mindy
199bc32516 Merge branch 'static-pf-rules' of github.com:yomimono/qubes-mirage-firewall into static-pf-rules 2019-05-16 15:56:35 -04:00
linse
6464d9b05e WIP 2019-05-16 21:53:54 +02:00
Mindy
1e7adb4a72 begin changing the info type to something we find more comprehensible 2019-05-16 15:53:48 -04:00
linse
5119a22ca4 Make a dummy rule that drops all traffic. 2019-05-15 00:02:15 +02:00
Mindy
a7ddc548f3 build against pf with qubes-ready rule definitions 2019-05-14 16:05:34 -04:00
Thomas Leonard
a93bb954d7
Merge pull request #54 from talex5/rule-examples
Allow naming hosts and add examples to rules.ml
2019-05-07 10:03:42 +01:00
Thomas Leonard
691c4ae745 Update build hash 2019-05-06 10:37:24 +01:00
Thomas Leonard
e15fc8c219 Make example rule more restrictive
In the (commented-out) example rules, instead of allowing any client to
continue a TCP flow with any other client, just allow Untrusted to reply
to Dev. This is all that is needed to make the SSH example work.
2019-05-06 10:35:51 +01:00
Thomas Leonard
eec1e985e5 Add overview of the main components of the firewall 2019-05-06 10:35:51 +01:00
Thomas Leonard
b60d098e96 Give exact types for Packet.src
Before, the packet passed to rules.ml could have any host as its src.
Now, `from_client` knows that `src` must be a `Client`, and `from_netvm`
knows that `src` is `External` or `NetVM`.
2019-05-06 10:35:51 +01:00
Thomas Leonard
189a736368 Add some types to the rules
Before, we inferred the types from rules.ml and then the compiler
checked that it was consistent with what firewall.ml expected. If it
wasn't it reported the problem as being with firewall.ml, which could be
confusing to users.
2019-05-06 10:35:51 +01:00
Thomas Leonard
acf46b4231 Allow naming hosts and add examples to rules.ml
Previously we passed in the interface, from which it was possible (but
a little difficult) to extract the IP address and compare with some
predefined ones. Now, we allow the user to list IP addresses and named
tags for them, which can be matched on easily.

Added example rules showing how to block access to an external service
or allow SSH between AppVMs.

Requested at
https://groups.google.com/d/msg/qubes-users/BnL0nZGpJOE/61HOBg1rCgAJ.
2019-05-06 10:35:51 +01:00
Thomas Leonard
433f3e8f01
Merge pull request #61 from talex5/fix-mac
Force backend MAC to fe:ff:ff:ff:ff:ff to fix HVM clients
2019-05-06 10:32:50 +01:00
Thomas Leonard
d7b376d373 Respond to ARP requests for *.*.*.1
This is a work-around to get DHCP working with HVM domains.
See: https://github.com/QubesOS/qubes-issues/issues/5022
2019-05-06 09:57:47 +01:00
Thomas Leonard
8b4cc6f5a9 Improve logging 2019-05-06 09:56:02 +01:00
Thomas Leonard
0a4dd7413c Force backend MAC to fe:ff:ff:ff:ff:ff to fix HVM clients
Xen appears to configure the same MAC address for both the frontend
and backend in XenStore. e.g.

    [tal@dom0 ~]$ xenstore-ls /local/domain/3/backend/vif/19/0
    frontend = "/local/domain/19/device/vif/0"
    mac = "00:16:3e:5e:6c:00"
    [...]

    [tal@dom0 ~]$ xenstore-ls /local/domain/19/device/vif/0
    mac = "00:16:3e:5e:6c:00"

This works if the client uses just a simple ethernet device, but fails
if it connects via a bridge. HVM domains have an associated stub domain
running qemu, which provides an emulated network device. The stub domain
uses a bridge to connect qemu's interface with eth0, and this didn't
work.

Force the use of the fixed version of mirage-net-xen, which no longer
uses XenStore to get the backend MAC, and provides a new function to get
the frontend one.
2019-05-06 09:52:46 +01:00
yomimono
65b79208a1
Merge pull request #60 from talex5/await-net-config
Wait if dom0 is slow to set the network configuration
2019-04-30 16:18:08 -05:00