Skip to content

Verify Group Who Owns /etc/sudoers.d Directory

An XCCDF Rule

Description

To properly set the group owner of /etc/sudoers.d, run the command:

$ sudo chgrp root /etc/sudoers.d

Rationale

The ownership of the /etc/sudoers.d directory by the root group is important because this directory hosts sudo configuration. Protection of this directory is critical for system security. Assigning the ownership to root ensures exclusive control of the sudo configuration.

ID
xccdf_org.ssgproject.content_rule_directory_groupowner_etc_sudoersd
Severity
Medium
References
Updated



Remediation - Ansible

- name: Ensure group owner on /etc/sudoers.d/
  file:
    path: /etc/sudoers.d/
    state: directory
    group: root
  tags:

Remediation - Shell Script

find -H /etc/sudoers.d/ -maxdepth 1 -L -type d -exec chgrp -L root {} \;