Verify User Who Owns /etc/sestatus.conf File
An XCCDF Rule
Description
To properly set the owner of /etc/sestatus.conf
, run the command:
$ sudo chown root /etc/sestatus.conf
Rationale
The ownership of the /etc/sestatus.conf file by the root user is important because this file hosts SELinux configuration. Protection of this file is critical for system security. Assigning the ownership to root ensures exclusive control of the SELinux configuration.
- ID
- xccdf_org.ssgproject.content_rule_file_owner_etc_sestatus_conf
- Severity
- Medium
- References
- Updated
Remediation - Ansible
- name: Test for existence /etc/sestatus.conf
stat:
path: /etc/sestatus.conf
register: file_exists
when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
tags:
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
chown -L 0 /etc/sestatus.conf
else