This feature adds a simple configuration setting for firewalld to be able to lock down configuration changes from local applications.
- Name: Thomas Woerner
- Email: email@example.com
- Targeted release: Fedora 19
- Last updated: 2013-03-20
- Percentage of completion: 80%
- The feature is limited to milestone 1 (base): configuration with files, no cli and no D-Bus interface
- Firewalld milestones for rich language and lockdown features, the milestones 1 and 2 (base and cli) a planned for F-19. Milestone 3 (gui) is planned for F-20.
- Milestone 1: Rich config language via config files; minimal lockdown ~ end of March
- Milestone 2: New config language via D-BUS interfaces with command line client ~ end of May
- Milestone 3: GUI early to mid July
Local applications or services are able to change the firewall configuration if they are running as root (example: libvirt). With this feature the administator can lock the firewall configuration so that either none or only applications that are in the allowed list are able to request firewall changes.
The lockdown feature is a very light version of user and application policies for firewalld and is turned off by default. Comprehensive user and application policies will be added later on.
Benefit to Fedora
An easy way to lock the firewall configuration for local applications.
Only needs changes in firewalld and it's components.
How To Test
1) Set Lockdown=yes in /ec/firewalld/firewalld.conf
2) Try to enable the service imaps in the default zone:
Results in: Error: ACCESS_DENIED: lockdown is enabled
3) Add this to /etc/firewalld/lockdown-whitelist.xml to the whitelist element:
<command name="/usr/bin/python /usr/bin/firewall-cmd*"/>
4) Reload firewalld
5) Try to enable service imaps again in the default zone:
The lock down settings defaults to disabled. If enabled the user can be sure that there are no unwanted configuration changes for the firewall from local applications or services.
This is a simple firewalld setting, which can be enabled or dropped easily.
With the lockdown feature changes to the firewall configutaion can be blocked or limited to a white list. The white list is empty by default and can contain commands, users, user ids and selinux contexts. The lockdown access check is limited to D-Bus methods that are chainging firewall rules. Query, list and get methods are not limited
<?xml version="1.0" encoding="utf-8"?> <whitelist> <command name="/usr/bin/python /bin/firewall-cmd*"/> <selinux context="system_u:system_r:NetworkManager_t:s0"/> <user id="815"/> <user name="user"/> </whitelist>
Importand for the command tag is the path. As root /bin/firewall-cmd is used, as a normal user /usr/bin/firewall-cmd will be used. The '*' at the end of the name attribute of command means that all matches, that start with this string. If the '*' is not there the absolute command inclusive arguments must match.
To get the context of a running application use
ps -e --context
Then add the context of the application with <selinux context="<context>"/> to the white list to white list this application. Important: If the context is unconfined, then this will open access for more than the desired application.
Fedora 19 includes the latest firewalld version that supports the firewalld lockdown feature to be able to lock the firewall configuration for local applications.