Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve firewalld support #303

Closed
wants to merge 24 commits into from

Conversation

decoyjoe
Copy link
Contributor

Description

I started out meaning to just fix a couple of bugs with the firewalld provider. I ended up needing to refactor and modernize the firewalld implementation in order to get it into a supportable state. Many bugs were fixed along the way.

Key changes in this release:

  • Rich Rules on firewalld: The firewall_rule resource now creates rich rules on firewalld platforms instead of using the deprecated --direct interface.
  • Flexible firewall selection: The cookbook now uses the default['firewall']['solution'] attribute to determine the firewall solution to use instead of a hardcoded assignment for each platform. It defaults to the platform's native firewall (same as previous hardcoded values).
  • Firewalld 2.0.0: Platforms using firewalld 2.0.0 and later, such as RHEL 10 and Ubuntu 24.04, are now supported.

Added

  • Support for firewalld 2.0.0 and the platforms that use it; RHEL 10 and Ubuntu 24.04.
    • priority, ingress_priority, egress_priority properties added to firewalld_zone.
  • Added firewalld_rich_rule resource for adding/removing rich rules to/from firewalld zones.
  • Support for IPv6 rules on firewalld platforms.
  • Support for using any compatible firewall solution on any platform. Defaults to the operating system's default firewall solution.

Changed

  • Ensure firewalld service remains enabled and started when installed.
  • firewall_rule resource now creates rich rules on firewalld platforms, instead of the using the deprecated --direct firewalld interface.

Fixed

  • Fixed: firewall_rule resource fails with a --zone is an invalid option with --direct error on firewalld.
  • Fixed: New zones created by firewalld_zone unexpectedly have forwarding enabled by default.
  • Fixed: firewalld_* resources ignore properties whose value is false.
  • Fixed: firewalld_* resources were not idempotent when using ports, source_ports, and rich_rules properties.
  • Fixed: ufw provider doesn't ensure ufw service is enabled.

Removed

  • Removed deprecated disabled property from firewall resource.
  • Removed all default['firewall']['firewalld'] attributes. Use the firewalld_zone resource to manage firewalld zone configuration.
  • Removed firewalld action :save from firewall resource. Firewalld rules are now always added permanently.
  • Removed firewalld property permanent from firewall_rule resource. Firewalld rules are now always added permanently.
  • Removed properties disabled_zone and enabled_zone from firewall resource. Use the firewalld_zone resource to manage firewalld zone configuration.
  • Removed recipe firewall::firewalld. Its functionality has been merged into the firewall::default recipe.
  • Removed attributes default['firewall']['ubuntu_iptables'] and default['firewall']['redhat7_iptables']. Use the new default['firewall']['solution'] attribute to set the desired firewall solution to use.

Issues Resolved

Check List

  • A summary of changes made is included in the CHANGELOG under ## Unreleased
  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Suites now correctly test against all compatible platforms for each
firewall solution.

Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
The resource was specifying --zone when creating --direct rules, which
is not allowed for direct rules in firewalld.

Fixes sous-chefs#298

Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Due to firewalld/firewalld#1438

Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
The firewalld_zone resource has been updated to support priority,
ingress_priority, and egress_priority zone options introduced in
firewalld 2.0.0.

As a result, this update extends support to RHEL 10, its derivatives,
and Ubuntu 24.04, all of which utilize firewalld 2.0.0 or later.

Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
@decoyjoe decoyjoe force-pushed the fix-firewalld-support branch 3 times, most recently from db2054d to 886fdbe Compare December 31, 2024 20:52
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Refactors firewalld support to use rich rules instead of the "--direct"
interface, which was deprecated with the firewalld 1.0.0 release [1].

Adds IPv6 support for firewalld platforms (fixes sous-chefs#86).

[1] https://firewalld.org/2021/06/the-upcoming-1-0-0

Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Until chef/chef#14760 is fixed.

Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
@decoyjoe decoyjoe force-pushed the fix-firewalld-support branch 2 times, most recently from 0b87ceb to e6d8da4 Compare December 31, 2024 22:24
Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
@decoyjoe decoyjoe force-pushed the fix-firewalld-support branch from e6d8da4 to 6f34a40 Compare December 31, 2024 22:40
@decoyjoe decoyjoe closed this Dec 31, 2024
@decoyjoe decoyjoe deleted the fix-firewalld-support branch January 3, 2025 16:57
@decoyjoe decoyjoe restored the fix-firewalld-support branch January 4, 2025 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant