Skip to content

Ensure That the sudo Binary Has the Correct Permissions

An XCCDF Rule

Description

To properly set the permissions of /usr/bin/sudo, run the command:

$ sudo chmod 4111 /usr/bin/sudo

Rationale

The sudoers program should only be usable by people who have the correct permissions.

ID
xccdf_org.ssgproject.content_rule_file_permissions_sudo
Severity
Medium
References
Updated



Remediation - Ansible

- name: Gather the package facts
  package_facts:
    manager: auto
  tags:
  - CCE-86950-3
  - configure_strategy

Remediation - Shell Script

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

chmod 4110 /usr/bin/sudo

else