{{% set inet_protos = ['tcp', 'udp'] %}} {{{ oval_metadata("Make sure firewall rules exist for all open network ports,listening on non-loopback interfaces.") }}} {{% for proto in inet_protos %}} {{% endfor %}} ^.*$ 127.0.0.1 0 ^.*$ ::1 0 0 /etc/firewalld/zones/ `^.+\.xml$` ^[\s]*<interface\s*name=.*$ 1 `` /etc/firewalld/zones/ `^.+\.xml$` ^[\s]*<service name="(\S*)".*$ 1 state_firewalld_zones_with_interfaces .xml {{% for proto in inet_protos %}} {{{ proto }}} ^.*$ 0 state_ipv4_loopback_listening_inet_ports state_ipv6_loopback_listening_inet_ports state_inet_foreign_port_connected var_obj_listening_inet_{{{ proto }}}_ports /usr/lib/firewalld/services/ `` \s*(?:(?:protocol="{{{ proto }}}")|)\s*port="(\d+)"\s*(?:(?:protocol="{{{ proto }}}")|)\s* 1 var_firewalled_service_{{{ proto }}}_ports /etc/firewalld/zones/ `^.+\.xml$` ^[\s]*<port\s*(?:(?:protocol="{{{ proto }}}")|)\s*port="(\d+)"\s*(?:(?:protocol="{{{ proto }}}")|)\s*.*$ 1 state_firewalld_zones_with_interfaces var_firewalled_direct_{{{ proto }}}_ports object_var_firewalled_service_{{{ proto }}}_ports object_var_firewalled_direct_{{{ proto }}}_ports {{% endfor %}}