Skip to content

Ensure a Table Exists for Nftables

An XCCDF Rule

Description

Tables in nftables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of six families. Red Hat Enterprise Linux 8 uses firewalld for firewall management. When nftables is the firewall backend used by firewalld, an family table called is used. To verify that the nftables table used by firewalld exists, run the following command:

$ sudo nft list tables
table 
                  
                
This table is automatically created by firewalld when it is started.

warning alert: Warning

Adding or editing rules in a running nftables can cause loss of connectivity to the system.

warning alert: Warning

Both the SCE check and remediation for this rule only consider runtime settings. There is no specific file to check as it depends on each site's policy. Therefore, check and remediation use the nft command directly. The fix is not persistent across system reboots.

warning alert: Functionality Warning

SCE check does not support variables, therefore the SCE check in this rule only checks the address family, regardless of the table name.

Rationale

Nftables doesn't have any default tables. Without a table being built, nftables will not filter network traffic.

ID
xccdf_org.ssgproject.content_rule_set_nftables_table
Severity
Medium
Updated



Remediation - Shell Script

# Remediation is applicable only in certain platforms
if rpm --quiet -q nftables; then

var_nftables_family='<xccdf-1.2:sub xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_nftables_family" use="legacy"/>'

var_nftables_table='<xccdf-1.2:sub xmlns:xccdf-1.2="http://checklists.nist.gov/xccdf/1.2" idref="xccdf_org.ssgproject.content_value_var_nftables_table" use="legacy"/>'

Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - low_complexity
  - low_disruption