← All rules
SOCLE-CLD-PKG-099// Packagesmediuminventory state

Install sudo Package

Ensures the sudo package is installed, enabling per-user, logged privilege escalation instead of shared root access.

Checked against what is installed or registered, packages present/absent, account databases.

A pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0Ubuntu 22.04CIS 3.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 4 standards

A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.

Why this rule matters

sudo lets administrators grant limited, audited root privileges to users instead of sharing the root password. The basic philosophy is least privilege: give as few rights as possible while still letting users do their work, and log every privileged command for accountability. Without sudo, teams fall back on direct root logins or a shared root password, which destroys per-user attribution and is a classic audit failure.

What Pavois checks

Pavois reads the effective install state from the package database via CINC/InSpec's package resource and asserts sudo is present. The package must exist before any /etc/sudoers policy can take effect, so this package check is the foundation for every downstream sudo-hardening rule (use_pty, logfile, NOPASSWD restrictions).

describe package('sudo') do
  it { should be_installed }
end

How to verify it is applied

Run dpkg -s sudo (Debian/Ubuntu) or rpm -q sudo (RHEL/Alma/Fedora); a compliant host returns the installed version. Confirm the binary works with sudo -V (prints the sudo version and plugin info).

Inspect & investigate

  • Installation is logged in /var/log/dpkg.log or /var/log/dnf.log.
  • sudo invocations (granted and denied) are recorded by syslog in /var/log/auth.log (Debian/Ubuntu) or /var/log/secure (RHEL), and via journalctl _COMM=sudo.

Remediation

The harden plan declares a package resource for sudo with action install; pavois harden apply installs it via the native package manager (apt/dnf). Installing it does not grant anyone privileges by itself, you still define rules in /etc/sudoers.d/.

Pavois applies this with its own harden engine, the plan below, not a shell script:

actioninstall
namesudo
resourcepackage
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

Installing sudo is safe and non-disruptive. The real precaution is in policy: after installing, make sure at least one administrator is in the sudo/wheel group before you disable direct root login or root SSH, or you risk locking yourself out. Always validate sudoers edits with visudo -c to avoid a syntax error that breaks all escalation. No reboot required.

Standards mapping

StandardReferenceTypeVersionConfidence
ANSSI BP-028R33direct2.0high
CIS2.2.6, 5.2.1directper OS, see the benchmark tablehigh
NISTCM-6(a)supporting800-53 Rev 5 · 800-171 Rev 2 (pinned)medium
PCI DSS2.2.6supporting4.0.1medium

Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.

Sources & references