Skip to content

Verify Permissions On /etc/selinux Directory

An XCCDF Rule

Description

To properly set the permissions of /etc/selinux, run the command:

$ sudo chmod 0755 /etc/selinux

Rationale

Setting correct permissions on the /etc/selinux directory is important because this directory hosts SELinux configuration. Protection of this directory is critical for system security. Restricting the permissions ensures exclusive control of the SELinux configuration.

ID
xccdf_org.ssgproject.content_rule_directory_permissions_etc_selinux
Severity
Medium
References
Updated



Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - configure_strategy
  - directory_permissions_etc_selinux

Remediation - Shell Script

# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel; then

find -H /etc/selinux/ -maxdepth 1 -perm /u+s,g+ws,o+wt -type d -exec chmod u-s,g-ws,o-wt {} \;

else