-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 3/9/19 2:58 AM, unman wrote:
> Why do you say this? It's far from my experience.
>
> If you use a minimal Debian template for firewall, then there are
> only iptables rules. It's trivial in that case to add logging. You
> can also implement this by use of appropriate scripts in rc.local
> and /rw/config if you want logging from the start.
Well, these are the hardcoded rules used by Qubes:
> Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target
> prot opt in out source destination 2160K
> 1969M ACCEPT all -- * *
0.0.0.0/0 0.0.0.0/0
> ctstate RELATED,ESTABLISHED 28727 2456K QBS-FORWARD all -- *
> *
0.0.0.0/0 0.0.0.0/0 0 0 DROP all --
> vif+ vif+
0.0.0.0/0 0.0.0.0/0 28727 2456K ACCEPT all --
> vif+ *
0.0.0.0/0 0.0.0.0/0 0 0 DROP all -- *
> *
0.0.0.0/0 0.0.0.0/0
As the logging in iptables is implemented as a separate jump target,
and you can only have one jump target in a rule, so if you want to
log something, you have to create 2 similar rules with the same
filters, but with different actions, as you need to place the logging
rule first, then your desired action just after the logging rule. right?
However iptables rules can be easily added only in front of the
current rules, or after all the existing rules. If you want to add
something in between, you have to calculate the rule numbers - which
is far from trivial.
So one option is to replace the whole ruleset by your own, however you
have to be compatible with the qubes solution otherwise you loose the
default features.
Or you have to parse the qubes generated rules, and insert the logging
ones as you need.
"log everything" is just simply not implemented in iptables, because
to get meaningful logs, you need to use the log-prefix to see if the
logged packet going to be dropped/accepted/rejected in the next rule.
logging just the default drops at the end of the FORWARD chain, might
be easier, as you just have to modify the hardcoded default ruleset.
> I find the Qubes firewall very customisable, and relatively easy to
> manipulate as needed.
Well, I wouldn't call it customisable, as you have to choose between
the very basic features of the qubes provided firewall implementation,
OR you need to create your custom solution.
Not to mention the "always there" style of the DNS NAT, and the ICMP
traffic...
By using nftables it would be a lot easier. The main confusion if
booth are in place, which is a not recommended way. And you most
likely have to place rules using booth framework... So I really not
sure why would we need both?
- --
Laszlo Zrubecz
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEmAe1Y2qfQjTIsHwdVjGlenYHFQ0FAlyF/+EACgkQVjGlenYH
FQ1ULw//Wn495vvTHegT9QK5B79MepEHA1TAPQIIZEKsU51uMckKv599eXCoShWu
G7rX1Ih25xwukE7tYYxvAdwUOnyOfTWSCBHxZLUGMAbOP8gC3q+2B6r/zO9UfQcC
Kr3T6dTPS5JyVw75iPWlCXVgZU8fC6nYqGzdq17EBXlSEzWij11wDawvKiO9XFbt
YwsGgSYPxidMVlvnxztTf3SsQRCspOMXtm6mpTHWIyHzXlt1JE+x1EgpJoBS7zz0
lawxv8FcJMtBImaM4RMsVYF5tKEqeLGPqCwhdiB8YIkJNnufHypVw3oU8QSz/dge
/q1B/R1ehvEcqEuIgFuO4Kk24nOr+BbSeg+cVa+3v95r+lPzUc+YdamNEZswXoSp
CohnGaT4zY9zntBoOFPmJdSDniGCJ7rormZoNlVSj+0lRoywAHAkkJg4vBAm52O7
Tt77R+WpicVoEREqAKkOEN0LXBv4rGTRRGQA+zLBz+y9VgmqjKOp1SYTKMZmJNg9
zoXpzEMVBTR4s9oGyidFCuJUWFIbkg0HnqppOeljoyc7FHzWGa+ERmWwABefJZpr
hzHFf/2fVM9bs2vH8e4YMZMWpS2/CUrC/XQe+ClfcchXwcdEmTGMC1bwkjOrboj0
N7EF+JHJQDUdbcKQj30a2Wx8uEH2rVeCLhJtpLZVB6ORatbum5M=
=JMQb
-----END PGP SIGNATURE-----