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