Verify User Who Owns /etc/nftables Directory
An XCCDF Rule
Description
To properly set the owner of /etc/nftables
, run the command:
$ sudo chown root /etc/nftables
Rationale
The ownership of the /etc/nftables directory by the root user is important because this directory hosts nftables configuration. Protection of this directory is critical for system security. Assigning the ownership to root ensures exclusive control of the nftables configuration.
- ID
- xccdf_org.ssgproject.content_rule_directory_owner_etc_nftables
- Severity
- Medium
- References
- Updated
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-86311-8
- configure_strategy
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q nftables; then
find -H /etc/nftables/ -maxdepth 1 -type d -exec chown -L 0 {} \;
else