From Fedora Project Wiki
(adding the default content)
Line 1: Line 1:
{{autolang}}
{{autolang}}
= firewalld - default firewall solution =
= firewalld - 默认防火墙解决方案 =


== Summary ==
== 摘要 ==


The purpose of this feature request is to make firewalld the default firewall solution for Fedora 18 and therefore enabled by default.
The purpose of this feature request is to make firewalld the default firewall solution for Fedora 18 and therefore enabled by default.


== Owner ==
== 作者 ==


* Name: [[User:twoerner| Thomas Woerner]]
* Name: [[User:twoerner| Thomas Woerner]]
* email: twoerner@redhat.com
* email: twoerner@redhat.com


== Current status ==
== 当前状态 ==


* Targeted release: [[Releases/18|Fedora 18]]  
* Targeted release: [[Releases/18|Fedora 18]]  
Line 35: Line 35:
* shields-up changes for applet (DONE)
* shields-up changes for applet (DONE)


== FirewallD Features for F-18 ==
== F-18 中FirewallD的特性 ==


* migration of system-config-firewall settings into the default zone for an update (without custom rules) (DONE)
* migration of system-config-firewall settings into the default zone for an update (without custom rules) (DONE)
Line 46: Line 46:
* OPTIONAL: migrate custom rules into direct interface
* OPTIONAL: migrate custom rules into direct interface


== Detailed Description ==
== 详情 ==


Making firewalld the default firewall solution for Fedora 18. The services iptables, iptables-ipv6 and ebtables will be replaced by firewalld. system-config-firewall in it's current form will also be replaced.
Making firewalld the default firewall solution for Fedora 18. The services iptables, iptables-ipv6 and ebtables will be replaced by firewalld. system-config-firewall in it's current form will also be replaced.


=== 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 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.
Line 58: Line 58:
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.


=== 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.
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.
Line 66: Line 66:
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. Connection tracking information is important here and needs to get into account for a future helper interface.  
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. Connection tracking information is important here and needs to get into account for a future helper interface.  


== Benefit to Fedora ==
== 为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.  
Line 74: Line 74:
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 receipt 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). 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 receipt 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.
The iptables and ip6tables services will not be enabled by default anymore. The required changes in the init scripts are simple.
Line 84: Line 84:
An explicit transition is planned after Fedora 19 with dropping support for the static firewall with system-config-firewal/lokkit. A migration from the static firewall model will be needed then.
An explicit transition is planned after Fedora 19 with dropping support for the static firewall with system-config-firewal/lokkit. A migration from the static firewall model will be needed then.


== How To Test ==
== 如何测试 ==


* Install firewalld and firewall-applet
* Install firewalld and firewall-applet
Line 102: Line 102:
The D-BUS interface can also be used directly.
The D-BUS interface can also be used directly.


== User Experience ==
== 用户体验 ==


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


== Dependencies ==
== 依赖 ==


* system-config-firewall (no changes needed)
* system-config-firewall (no changes needed)
Line 120: Line 120:
Migration of most ip*tables and ebtables dependent packages in F-18 alpha state. Planned is to have a soft migration, that either original firewall code or firewalld can be used.
Migration of most ip*tables and ebtables dependent packages in F-18 alpha state. Planned is to have a soft migration, that either original firewall code or firewalld can be used.


== Contingency Plan ==
== 临时计划 ==


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


== Documentation ==
== 文档 ==


See [[FirewallD]]
参见 [[FirewallD]]


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


== Release Notes ==
== 发行注记 ==


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


[[Category:FeatureAcceptedF18]]
[[Category:FeatureAcceptedF18]]

Revision as of 11:44, 23 August 2013

firewalld - 默认防火墙解决方案

摘要

The purpose of this feature request is to make firewalld the default firewall solution for Fedora 18 and therefore enabled by default.

作者

当前状态

  • Targeted release: Fedora 18
  • Last updated: 2012-10-16
  • Percentage of completion: 100%

State:

  • iptables (DONE)
  • libvirtd (DONE, part of libvirt-0.10.1-1.fc18)
  • system-config-printer (patch available, not released), system-config-printer has been partly replaced by gnome printer setup
  • gnome printer setup in gnome-control-center (DONE, part of Fedora 3.4.0-2+ package)
  • wireshark (not DONE)
  • NetworkManager (DONE)
  • initscripts (ifup-post, ifdown-post) (DONE)
  • firewall-applet (DONE)
  • firewall-cmd (DONE)
  • firewall-config (DONE)
  • man-pages firewall-cmd(1), firewalld(1), firewalld.conf(5), firewalld.icmptype(5), firewalld.service(5), firewalld.zone(5): DONE
  • firewalld config DBUS interface (DONE)
  • network-manager-applet zone changes - patch available
  • kde-plasma-networkmanagement zone changes (DONE, part of 0.9.0.4+)
  • shields-up changes for applet (DONE)

F-18 中FirewallD的特性

  • migration of system-config-firewall settings into the default zone for an update (without custom rules) (DONE)
  • firewalld config DBUS interface for persistent firewall configuration (DONE)
  • firewall-config application to configure firewall settings (DONE)
  • shields-up/shields-down switch in the applet to change the default zone (DONE)
  • firewall-cmd extension for persistent zone configuration (DONE)
  • firewall-cmd option cleanup (DONE)
  • OPTIONAL: direct interface enhancements for libvirt (ongoing)
  • OPTIONAL: migrate custom rules into direct interface

详情

Making firewalld the default firewall solution for Fedora 18. The services iptables, iptables-ipv6 and ebtables will be replaced by firewalld. system-config-firewall in it's current form will also be replaced.

为什么使用防火墙守护程序

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.

守护程序

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 onloading 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.

为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). 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 receipt of the answer.

细节

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 with the user land tools 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, NetworkManager, system-config-printer, gnome printer settings

An explicit transition is planned after Fedora 19 with dropping support for the static firewall with system-config-firewal/lokkit. A migration from the static firewall model will be needed then.

如何测试

  • 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 --add-service=ssh
  • Enable samba for 10 seconds:
 firewall-cmd --add-service=samba --timeout=10
  • Enable ipp-client:
 firewall-cmd --add-service=ipp-client
  • Disable ipp-client:
 firewall-cmd --remove-service=ipp-client
  • To restore the static firewall with lokkit again simply use:
 lokkit --enabled

The D-BUS interface can also be used directly.

用户体验

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

依赖

  • system-config-firewall (no changes needed)
  • iptables (simple changes needed)
  • libvirtd (some changes might be needed)
  • system-config-printer
  • gnome printer setup
  • wireshark

maybe others

Migration plan for dependant packages:

Migration of most ip*tables and ebtables dependent packages in F-18 alpha state. Planned is to have a soft migration, that either original firewall code or firewalld can be used.

临时计划

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

文档

参见 FirewallD

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

发行注记

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