firewall_single_service_active: add firewalld support and fix tests#14894
firewall_single_service_active: add firewalld support and fix tests#14894vojtapolasek wants to merge 2 commits into
Conversation
Note that as of now, the rule is not present in any rhel benchmark, but tests are here in case it appears in the future.
|
This datastream diff is auto generated by the check Click here to see the full diffNew content has different text for rule 'xccdf_org.ssgproject.content_rule_firewall_single_service_active'.
--- xccdf_org.ssgproject.content_rule_firewall_single_service_active
+++ xccdf_org.ssgproject.content_rule_firewall_single_service_active
@@ -6,7 +6,7 @@
The system must have exactly one active firewall service running to avoid conflicts
and ensure consistent packet filtering. Only one of the following services should
be enabled and active at any time:
-ufw - Uncomplicated Firewall (Ubuntu/Debian default)iptables - Classic Linux firewallnftables - Next Generation Firewall replacement for iptables
+firewalld - Dynamic Firewall Manager (RHEL/Fedora/SUSE default)ufw - Uncomplicated Firewall (Ubuntu/Debian default)iptables - Classic Linux firewallnftables - Next Generation Firewall replacement for iptables
Having zero active firewalls leaves the system vulnerable, while having multiple
active firewalls can lead to rule conflicts and security gaps.
|
|
@vojtapolasek Currently the rule is used only in Debian and Ubuntu content (in Debian 12, 13 and Ubuntu 24.04 CIS profiles). What is the idea behind adding RHEL default firewall to the rule that isn't used in RHEL? Do we want to add the rule to any RHEL or Fedora content? Is that firewalld component available in Debian and Ubuntu? Shouldn't the regex in OVAL to be different based on the product? Do Debian and Ubuntu CIS Benchmarks requirements allow firewalld as acceptable option? |
|
@vojtapolasek: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description:
firewalldto the list of recognized firewall services in thefirewall_single_service_activerule. Previously, the OVAL check and rule description only coveredufw,iptables, andnftables, missing the default firewall on RHEL/Fedora/SUSE systems.firewalld_single.pass.sh,firewalld_multiple.fail.sh) targeting RHEL and Fedora platforms.platformandpackagesmetadata, replace hardcodedapt installcalls withpackagesdirectives, and add2>/dev/null || trueguards forsystemctl stopcalls to handle services that may not exist.Rationale:
firewalld, the default firewall manager on RHEL and Fedora. This meant RHEL/Fedora systems withfirewalldactive were not being evaluated, and conflicts betweenfirewalldand another firewall service were missed.apt install) without declaring platform constraints, andsystemctl stopcalls would fail on systems where a given service was not installed.Review Hints:
firewalldto the service name regex inoval/shared.xml.rule.ymlchange addsfirewalldto the description list.