build: install a firewalld zone for shared mode
Install a NM-specific firewalld zone to be used for interfaces that are used for connection sharing. The zone blocks all traffic to the local machine except some protocols (DHCP, DNS and ICMP) and allows all forwarded traffic.
This commit is contained in:
@@ -67,3 +67,10 @@ if enable_polkit
|
||||
install_dir: polkit_gobject_policydir,
|
||||
)
|
||||
endif
|
||||
|
||||
if enable_firewalld_zone
|
||||
install_data(
|
||||
'nm-shared.xml',
|
||||
install_dir: join_paths(nm_prefix, 'lib', 'firewalld', 'zones')
|
||||
)
|
||||
endif
|
||||
|
23
data/nm-shared.xml
Normal file
23
data/nm-shared.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<zone target="ACCEPT">
|
||||
<short>NetworkManager Shared</short>
|
||||
|
||||
<description>
|
||||
This zone is used internally by NetworkManager when activating a
|
||||
profile that uses connection sharing and doesn't have an explicit
|
||||
firewall zone set.
|
||||
Block all traffic to the local machine except ICMP, ICMPv6, DHCP
|
||||
and DNS. Allow all forwarded traffic.
|
||||
Note that future package updates may change the definition of the
|
||||
zone unless you overwrite it with your own definition.
|
||||
</description>
|
||||
|
||||
<rule priority='32767'>
|
||||
<reject/>
|
||||
</rule>
|
||||
|
||||
<protocol value='icmp'/>
|
||||
<protocol value='ipv6-icmp'/>
|
||||
<service name="dhcp"/>
|
||||
<service name="dns"/>
|
||||
</zone>
|
Reference in New Issue
Block a user