Install sudo Package
An XCCDF Rule
Description
Thesudo
package can be installed with the following command:
$ apt-get install sudo
Rationale
sudo
is a program designed to allow a system administrator to give
limited root privileges to users and log root activity. The basic philosophy
is to give as few privileges as possible but still allow system users to
get their work done.
- ID
- xccdf_org.ssgproject.content_rule_package_sudo_installed
- Severity
- Medium
- References
- Updated
Remediation Templates
An Ansible Snippet
- name: Ensure sudo is installed
package:
name: sudo
state: present
when: ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
tags:
A Puppet Snippet
include install_sudo
class install_sudo {
package { 'sudo':
ensure => 'installed',
}
}
OS Build Blueprint
[[packages]]
name = "sudo"
version = "*"
A Shell Script
# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
DEBIAN_FRONTEND=noninteractive apt-get install -y "sudo"
else
>&2 echo 'Remediation is not applicable, nothing was done'
fi