Verify User Who Owns /etc/ipsec.secrets File
An XCCDF Rule
Description
To properly set the owner of/etc/ipsec.secrets
, run the command: $ sudo chown root /etc/ipsec.secrets
Rationale
The ownership of the /etc/ipsec.secrets file by the root user is important because this file 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_file_owner_etc_ipsec_secrets
- Severity
- Medium
- References
- Updated
Remediation Templates
An Ansible Snippet
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-86400-9
- configure_strategy
A Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q libreswan; then
chown 0 /etc/ipsec.secrets
else
>&2 echo 'Remediation is not applicable, nothing was done'
fi