render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
edecca
From f649b1f8a050402bbd1d28ee78e1522121347977 Mon Sep 17 00:00:00 2001
edecca
Message-Id: <f649b1f8a050402bbd1d28ee78e1522121347977@dist-git>
edecca
From: Laine Stump <laine@laine.org>
edecca
Date: Thu, 14 Feb 2019 15:26:55 -0500
edecca
Subject: [PATCH] network: explicitly allow icmp/icmpv6 in libvirt zonefile
edecca
MIME-Version: 1.0
edecca
Content-Type: text/plain; charset=UTF-8
edecca
Content-Transfer-Encoding: 8bit
edecca
edecca
The libvirt zonefile for firewalld (added in commit 3b71f2e4) does the
edecca
following:
edecca
edecca
1) lists specific services it wants to allow, then
edecca
edecca
2) uses a lower priority <reject/> rule to block all other services to
edecca
   the host, and then finally,
edecca
edecca
3) relies on the zone's default "accept" policy to, accept all
edecca
   forwarded traffic (since forwarded traffic is ignored by the
edecca
   slightly higher priority <reject/> rule in (2)).
edecca
edecca
I had assumed that icmp traffic was either being allowed at the top of
edecca
the rules, or that it would be ignored by the <reject/> rule and
edecca
passed by the default accept policy (similar to forwarded traffic),
edecca
but this assumption was incorrect; the <reject/> rule does block icmp
edecca
traffic. This became apparent when DHCPv6 which requires ICMPv6 in
edecca
addition to udp/dhcpv6) failed to work.
edecca
edecca
This all means that in order to achieve our original goal of "similar
edecca
behavior to a default reject policy, but also allowing forwarded
edecca
traffic", we need to add rules to allow all icmp and icmpv6 traffic to
edecca
the libvirt zone, and that's what this patch does.
edecca
edecca
This is a further refinement of the resolution to
edecca
https://bugzilla.redhat.com/1650320
edecca
edecca
Signed-off-by: Laine Stump <laine@laine.org>
edecca
Acked-by: Eric Garver <eric@garver.life>
edecca
(cherry picked from commit 41adfe8ca932e9fa34cd1b3f238c17b52e6b3888)
edecca
Message-Id: <20190214202655.22715-1-laine@redhat.com>
edecca
Reviewed-by: Ján Tomko <jtomko@redhat.com>
edecca
---
edecca
 src/network/libvirt.zone | 2 ++
edecca
 1 file changed, 2 insertions(+)
edecca
edecca
diff --git a/src/network/libvirt.zone b/src/network/libvirt.zone
edecca
index bf81db1b6e..b1e84b52ec 100644
edecca
--- a/src/network/libvirt.zone
edecca
+++ b/src/network/libvirt.zone
edecca
@@ -15,6 +15,8 @@
edecca
 <rule priority='32767'>
edecca
   <reject/>
edecca
 </rule>
edecca
+<protocol value='icmp'/>
edecca
+<protocol value='ipv6-icmp'/>
edecca
 <service name='dhcp'/>
edecca
 <service name='dhcpv6'/>
edecca
 <service name='dns'/>
edecca
-- 
edecca
2.20.1
edecca