diff --git a/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/bash/ubuntu.sh b/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/bash/ubuntu.sh new file mode 100644 index 00000000000..f5cd2afef19 --- /dev/null +++ b/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/bash/ubuntu.sh @@ -0,0 +1,18 @@ +# platform = multi_platform_ubuntu +# reboot = false +# strategy = restrict +# complexity = low +# disruption = high + +{{{ bash_instantiate_variables("var_nftables_master_config_file") }}} + +{{{ bash_instantiate_variables("var_nftables_family") }}} + +if [ ! -f "${var_nftables_master_config_file}" ]; then + touch "${var_nftables_master_config_file}" +fi + +nft list ruleset > "/etc/${var_nftables_family}-filter.rules" + +grep -qxF 'include "/etc/'"${var_nftables_family}"'-filter.rules"' "${var_nftables_master_config_file}" \ + || echo 'include "/etc/'"${var_nftables_family}"'-filter.rules"' >> "${var_nftables_master_config_file}" diff --git a/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/oval/ubuntu.xml b/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/oval/ubuntu.xml new file mode 100644 index 00000000000..a1aec949bb0 --- /dev/null +++ b/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/oval/ubuntu.xml @@ -0,0 +1,43 @@ + + + {{{ oval_metadata("Make sure that there is permanent nftables configuration file used + to save and re-apply rules on reboot") }}} + + + + + + + + + + + + + + + + ^[\s]*include[\s]+\"([^\s]+)"$ + 1 + + + + + ^.*$ + 1 + + + + + + + + diff --git a/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/rule.yml b/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/rule.yml index 1414ee5c298..c0d61ce7d35 100644 --- a/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/rule.yml +++ b/linux_os/guide/system/network/network-nftables/nftables_rules_permanent/rule.yml @@ -16,7 +16,7 @@ rationale: |- severity: medium -platform: package[nftables] and service_disabled[firewalld] and service_disabled[ufw] +platform: package[nftables] and service_disabled[firewalld] identifiers: cce@sle15: CCE-92485-2