Features/firewalld

From FedoraProject

< Features(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
 
With Fedora 15 the dynamic firewall with firewalld was introduced with the proof of concept implementation in Python as an optional component.
 
With Fedora 15 the dynamic firewall with firewalld was introduced with the proof of concept implementation in Python as an optional component.
  
The purpose of this feature request is to replace this proof of concept implementation with a version written in C and to make it the default firewall solution.
+
The purpose of this feature request is to replace this proof of concept implementation with a more comprehensive version.
  
Other features planned for this version are:
+
Features planned for this version are:
  
 
* D-BUS interface cleanup and extensions (especially for libvirt)
 
* D-BUS interface cleanup and extensions (especially for libvirt)
* Finalize firewall-applet and firewall-config
+
* Finalize firewall-applet and later on firewall-config
 
* Permanent and temporary firewall rules
 
* Permanent and temporary firewall rules
 
* Network Zone support
 
* Network Zone support
Line 21: Line 21:
 
== Current status ==
 
== Current status ==
  
* Targeted release: [[Releases/16|Fedora 16]]  
+
* Targeted release: [[Releases/17|Fedora 17]]  
* Last updated: 2011-05-20
+
 
* Percentage of completion: 10%
+
* Last updated: 2012-01-23
 +
* Percentage of completion: 60%
  
 
== Detailed Description ==
 
== Detailed Description ==
Line 35: Line 36:
 
The firewall daemon on the other hand manages the firewall dynamically and applies changes without restarting the whole firewall. Therefore there is no need to reload all firewall kernel modules. But using a firewall daemon requires that all firewall modifications are done with that daemon to make sure that the state in the daemon and the firewall in kernel are in sync. The firewall daemon can not parse firewall rules added by the ip*tables and ebtables command line tools.
 
The firewall daemon on the other hand manages the firewall dynamically and applies changes without restarting the whole firewall. Therefore there is no need to reload all firewall kernel modules. But using a firewall daemon requires that all firewall modifications are done with that daemon to make sure that the state in the daemon and the firewall in kernel are in sync. The firewall daemon can not parse firewall rules added by the ip*tables and ebtables command line tools.
  
The daemon provides information about the current active firewall settings via D-BUS and also accepts changes via D-BUS using PolicyKit authentication methods. SELinux access restrictions are also planned.
+
The daemon provides information about the current active firewall settings via D-BUS and also accepts changes via D-BUS using PolicyKit authentication methods. SELinux access restrictions are also planned for a later version.
  
 
=== The Daemon ===
 
=== The Daemon ===
  
Applications, daemons and the user can request to enable a firewall feature over D-BUS. A feature could either be one of the predefined firewall features like services, port and protocol combinations, trusted interfaces/hosts/network areas, port/packet forwarding, masquerading, icmp blocking or even a custom rule. The feature can be enabled for a certain amount of time or can be disabled by again.
+
Applications, daemons and the user can request to enable a firewall feature over D-BUS. A feature could either be one of the predefined firewall features like services, port and protocol combinations, trusted interfaces/hosts/network areas, port/packet forwarding, masquerading and icmp blocking. The feature can be enabled for a certain amount of time or till it gets disabled again.
  
New chains for virtualization, network settings, services, ports, masquerading, port forwarding, icmp filtering and virtualization are added to make the firewall setup more flexible, safe and robust. Adding a rule with the firewall daemon to one of these chains will most likely not interefere with rules of other chains. The order of the chains and how they are used is fixed.
+
New chains for applications, zones a deny and allow model are added to make the firewall setup more flexible, safe and robust. The deny and allow model reduces the risk of intereference of rules. The order of the chains and how they are used is fixed.
  
The netfilter firewall helpers, that are for example used for amanda, ftp, samba and tftp services, are also handled by the daemon as long as they are part of a predefined service. Loading of additional helpers is not part of the current interface. For some of the helpers onloading is only possible after all connections that are handled by the module are closed. Therefore connection tracking information is important here and needs to get into account.
+
The netfilter firewall helpers, that are for example used for amanda, ftp, samba and tftp services, are also handled by the daemon as long as they are part of a predefined service. Loading of additional helpers is not part of the current interface. For some of the helpers unloading is only possible after all connections that are handled by the module are closed. Connection tracking information is important here and needs to get into account for a future helper interface.
  
 
== Benefit to Fedora ==
 
== Benefit to Fedora ==
  
 
The dynamic firewall mode with firewalld will make it possible to change firewall settings without the need to restart the firewall and will make persistent connections possible.  
 
The dynamic firewall mode with firewalld will make it possible to change firewall settings without the need to restart the firewall and will make persistent connections possible.  
 
 
This is for example very useful for services, that need to add additional firewall rules. libvirtd is one of them and also openvpn in the future. With the static firewall model these rules are lost if the firewall gets modified or restarted. The firewall daemon holds the current configuration internally and is able to modify the firewall without the need to recreate the complete firewall configuration; it is also able to restore the configuration in a service restart and reload case.
 
This is for example very useful for services, that need to add additional firewall rules. libvirtd is one of them and also openvpn in the future. With the static firewall model these rules are lost if the firewall gets modified or restarted. The firewall daemon holds the current configuration internally and is able to modify the firewall without the need to recreate the complete firewall configuration; it is also able to restore the configuration in a service restart and reload case.
  
Another use case for the dynamic firewall mode is printer discovery. For this the discovery program will be started locally that sends out a broadcast message. It will most likely get an answer from an unknown address (the new printer). This answer will be filtered by the firewall, because the answer is not related to the broadcast and the port of the program that was sending out the message is dynamic and therefore a fixed rule can not be created for this. With the dynamic firewall mode a time limited rule could be requested by the discovery program to allow the receival of the answer.
+
Another use case for the dynamic firewall mode is printer discovery. For this the discovery program will be started locally that sends out a broadcast message. It will most likely get an answer from an unknown address (the new printer or printer server). This answer will be filtered by the firewall, because the answer is not related to the broadcast and the port of the program that was sending out the message is dynamic and therefore a fixed rule can not be created for this. With the dynamic firewall mode a time limited rule could be requested by the discovery program to allow the receival of the answer.
  
 
== Scope ==
 
== Scope ==
Line 58: Line 58:
  
 
system-config-firewall will not be installed by default anymore, but firewalld will be installed by default. The needed changes in comps are simple.
 
system-config-firewall will not be installed by default anymore, but firewalld will be installed by default. The needed changes in comps are simple.
 
+
Services which are adding firewall rules directly with iptables commands need to be changed to benefit from firewalld. These are: libvirtd
Services which are adding firewall rules directly with iptables commands need to be changed. These are: libvirtd
+
  
 
== How To Test ==
 
== How To Test ==
Line 101: Line 100:
 
== Release Notes ==
 
== Release Notes ==
  
Fedora 16 adds support for firewalld daemon, that provides a dynamic firewall management with a D-Bus interface.
+
Fedora 17 adds support for firewalld daemon, that provides a dynamic firewall management with a D-Bus interface.
  
[[Category:FutureFeatureForWrangler]]
+
[[Category:FeatureReadyForWrangler]]

Revision as of 17:10, 23 January 2012

Contents

firewalld - Dynamic Firewall

Summary

With Fedora 15 the dynamic firewall with firewalld was introduced with the proof of concept implementation in Python as an optional component.

The purpose of this feature request is to replace this proof of concept implementation with a more comprehensive version.

Features planned for this version are:

  • D-BUS interface cleanup and extensions (especially for libvirt)
  • Finalize firewall-applet and later on firewall-config
  • Permanent and temporary firewall rules
  • Network Zone support

Owner

Current status

  • Last updated: 2012-01-23
  • Percentage of completion: 60%

Detailed Description

Replacement of the proof of concept implementation. Using firewalld as the primary firewall solution.

Why A Firewall Daemon

The current firewall model is static and every change requires a complete firewall restart. This includes also to unload the firewall netfilter kernel modules and to load the modules that are needed for the new configuration. The unload of the modules is breaking stateful firewalling and established connections.

The firewall daemon on the other hand manages the firewall dynamically and applies changes without restarting the whole firewall. Therefore there is no need to reload all firewall kernel modules. But using a firewall daemon requires that all firewall modifications are done with that daemon to make sure that the state in the daemon and the firewall in kernel are in sync. The firewall daemon can not parse firewall rules added by the ip*tables and ebtables command line tools.

The daemon provides information about the current active firewall settings via D-BUS and also accepts changes via D-BUS using PolicyKit authentication methods. SELinux access restrictions are also planned for a later version.

The Daemon

Applications, daemons and the user can request to enable a firewall feature over D-BUS. A feature could either be one of the predefined firewall features like services, port and protocol combinations, trusted interfaces/hosts/network areas, port/packet forwarding, masquerading and icmp blocking. The feature can be enabled for a certain amount of time or till it gets disabled again.

New chains for applications, zones a deny and allow model are added to make the firewall setup more flexible, safe and robust. The deny and allow model reduces the risk of intereference of rules. The order of the chains and how they are used is fixed.

The netfilter firewall helpers, that are for example used for amanda, ftp, samba and tftp services, are also handled by the daemon as long as they are part of a predefined service. Loading of additional helpers is not part of the current interface. For some of the helpers unloading is only possible after all connections that are handled by the module are closed. Connection tracking information is important here and needs to get into account for a future helper interface.

Benefit to Fedora

The dynamic firewall mode with firewalld will make it possible to change firewall settings without the need to restart the firewall and will make persistent connections possible. This is for example very useful for services, that need to add additional firewall rules. libvirtd is one of them and also openvpn in the future. With the static firewall model these rules are lost if the firewall gets modified or restarted. The firewall daemon holds the current configuration internally and is able to modify the firewall without the need to recreate the complete firewall configuration; it is also able to restore the configuration in a service restart and reload case.

Another use case for the dynamic firewall mode is printer discovery. For this the discovery program will be started locally that sends out a broadcast message. It will most likely get an answer from an unknown address (the new printer or printer server). This answer will be filtered by the firewall, because the answer is not related to the broadcast and the port of the program that was sending out the message is dynamic and therefore a fixed rule can not be created for this. With the dynamic firewall mode a time limited rule could be requested by the discovery program to allow the receival of the answer.

Scope

The iptables and ip6tables services will not be enabled by default anymore. The required changes in the init scripts are simple.

system-config-firewall will not be installed by default anymore, but firewalld will be installed by default. The needed changes in comps are simple. Services which are adding firewall rules directly with iptables commands need to be changed to benefit from firewalld. These are: libvirtd

How To Test

  • Install firewalld and firewall-applet
  • Start the firewalld service
  • Start the tray applet firewall-applet
  • Use firewall-cmd to enable for example ssh:
 firewall-cmd --enable --service=ssh
  • Enable samba for 10 seconds:
 firewall-cmd --enable --service=samba --timeout=10
  • Enable ipp-client:
 firewall-cmd --enable --service=ipp-client
  • Disable ipp-client:
 firewall-cmd --disable --service=ipp-client
  • To restore your static firewall with lokkit again simply use:
 lokkit --enabled

You can also use the D-BUS interface directly. This is required for libvirt (and later on also NetworkManager).

User Experience

Connections will be persistent even after changing firewall settings using the firewall daemon.

Dependencies

  • system-config-firewall (no changes needed)
  • iptables (simple changes needed)
  • libvirtd

Contingency Plan

The current static firewall will still be available as a fallback firewall solution.

Documentation

See https://fedoraproject.org/wiki/FirewallD/

The fedorahosted site is here: https://fedorahosted.org/firewalld/

Release Notes

Fedora 17 adds support for firewalld daemon, that provides a dynamic firewall management with a D-Bus interface.