From eb34d3a2ba5bcd219e17118d54f239588681b20a Mon Sep 17 00:00:00 2001 From: Marcus Burghardt Date: Fri, 3 Feb 2023 13:35:44 +0100 Subject: [PATCH 1/2] Change custom zones check in reaction to OpenSCAP change If any default zone is modified by the administrator, the respective zone file is placed in /etc/firewalld/zones dir in order to override the default zone settings. The same directory is applicable for new zones created by the administrator. Therefore, all files in this directory should also allow SSH. This test was updated in a reaction to https://github.com/OpenSCAP/openscap/issues/1923, which changed the behavior of xmlfilecontent probe in OpenSCAP 1.3.7. --- .../oval/shared.xml | 74 +++++++++++++++---- 1 file changed, 60 insertions(+), 14 deletions(-) diff --git a/linux_os/guide/services/ssh/ssh_server/firewalld_sshd_port_enabled/oval/shared.xml b/linux_os/guide/services/ssh/ssh_server/firewalld_sshd_port_enabled/oval/shared.xml index 4adef2e53f5..e3abd5d3287 100644 --- a/linux_os/guide/services/ssh/ssh_server/firewalld_sshd_port_enabled/oval/shared.xml +++ b/linux_os/guide/services/ssh/ssh_server/firewalld_sshd_port_enabled/oval/shared.xml @@ -133,9 +133,10 @@ OVAL resources in order to detect and assess only active zone, which are zones with at least one NIC assigned to it. Since it was possible to easily have the list of active zones, it was cumbersome to use that list in other OVAL objects without introduce a high - level of complexity to make sure environments with multiple NICs and multiple zones are - in use. So, in favor of simplicity and readbility it was decided to work with a static - list. It means that, in the future, it is possible this list needs to be updated. --> + level of complexity to ensure proper assessment in environments where multiple NICs and + multiple zones are in use. So, in favor of simplicity and readbility it was decided to + work with a static list. It means that, in the future, it is possible this list needs to + be updated. --> @@ -145,23 +146,68 @@ - + - - - + + + + + + var_firewalld_sshd_port_enabled_custom_zone_files_with_ssh_count + + + + + + + - /etc/firewalld/zones - ^.*\.xml$ - /zone/service[@name='ssh'] + + /zone/service[@name='ssh'] - - /zone/service[@name='ssh'] - + + + + + + + + + + + + + + + + + /etc/firewalld/zones + ^.*\.xml$ +