Set nftables Configuration for Loopback Traffic
An XCCDF Rule
Description
Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network.
warning alert: Warning
Changing firewall settings while connected over network can
result in being locked out of the system.
Keep in mind the remediation makes changes only to the running
system, in order to keep the changes need to take care to save
the nft settings to the relvant configutation files.
Rationale
Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure.
- ID
- xccdf_org.ssgproject.content_rule_set_nftables_loopback_traffic
- Severity
- Medium
- Updated
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- PCI-DSS-Req-1.4.1
- low_complexity
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if ( rpm --quiet -q nftables ); then
grubfile="/boot/grub2/grub.cfg"
# Implement the loopback rules: