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.

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
References
Updated



Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-92569-3
  - low_complexity

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"/>'