Do you think there are situations, where [/etc/xen/vif-route-qubes](https://github.com/marmarek/qubes-core-agent-linux/blob/2eb0ed2be14350d6df1fce2af855805133a4a416/network/vif-route-qubes)'s use of [iptables-restore](https://github.com/marmarek/qubes-core-agent-linux/blob/2eb0ed2be14350d6df1fce2af855805133a4a416/network/vif-route-qubes#L57-L58) could interfere with Whonix's firewall?
Description
Details
- Impact
- High
Related Objects
Event Timeline
Depending what you mean by "interfere". In terms of rules itself - as
long as Whonix doesn't use "raw" table (I guess it doesn't), it
shouldn't be a problem. But some race condition making either of
iptables-restore call fail may be possible.
Theoretically iptables-restore is used instead of iptables exactly
to prevent such problem
(https://github.com/QubesOS/qubes-issues/issues/42), but it isn't clear
to me that it is really effective. We have flock in vif-route-qubes
because of this uncertainty. Maybe iptables --wait would be a better
option - now it is available in Debian too (>=jessie). But according to
iptables sources, I think iptables --wait still could race against
iptables-restore - the later doesn't use any locking.
What is Debian solution for such problem (different programs/startup
scripts adding iptables rules simultaneously)? The Fedora way is to use
firewalld...
marmarek (Marek Marczykowski-Górecki):
Depending what you mean by "interfere".
I mean by "interfere" here:
"Somehow loading firewall rules inappropriate to Whonix that could in
worst case lead to leaks."
as
long as Whonix doesn't use "raw" table (I guess it doesn't)
Whonix doesn't use the "raw" table indeed.
What is Debian solution for such problem (different programs/startup
scripts adding iptables rules simultaneously)?
Dunno if there is...
Asked on debian-users mailing list:
"Are there packages that modify iptables rules?"
https://lists.debian.org/debian-user/2015/11/msg00416.html
Answer for now:
fail2ban
miniupnpd
Asked a follow up question on debian-users mailing list:
"How do packages that modify iptables rules prevent race conditions?"
https://lists.debian.org/debian-user/2015/11/msg00418.html
Whonix doesn't use the "raw" table indeed.
So I think it is safe.
Asked a follow up question on debian-users mailing list:
"How do packages that modify iptables rules prevent race conditions?"
https://lists.debian.org/debian-user/2015/11/msg00418.html
But the answer for this question would be helpful for bugs like this:
https://github.com/QubesOS/qubes-issues/issues/1067
https://github.com/QubesOS/qubes-issues/issues/740