Pcornel
Security · Linux Security

sudo

Cheat sheet · https://pcornel.dk/topic.php?topic=4565

Back to the Topic

Answer

sudo delegates selected commands or roles under policy with invoking/target identities, host and argument constraints, authentication, environment handling, logging and session lifetime rather than granting unrestricted root by default.

Remember

  • sudo access ≠ root shell intentionally or safely permitted.
  • Command path restricted ≠ arguments, environment, editors or child processes non-escapable.
  • Configuration file present ≠ parsed, loaded and effective runtime state.
  • One allow/deny result ≠ complete DAC, privilege, LSM, firewall and application outcome.

First checks

  • sudo -l -U <user> — rights
  • visudo -c — syntax check
  • grep -r NOPASSWD /etc/sudoers /etc/sudoers.d/ — passwordless rules

Commands

sudo -l

Verify in this order

user → sudoers rule → command as root → logged

Where it usually breaks

First mismatch in platform/workload identity → desired configuration → management/control plane → runtime enforcement → telemetry → workload/resource outcome; preserve identity/policy/pre-state before mutation.

Linux Security → sudo proof map

BoundaryEstablishDoes not establish
ScopeExact host, role, build/kernel, identity, workload and expected controlDoes not prove policy receipt or effective runtime state
Effective stateResultant/loaded policy, precedence, mode, labels/rules/keys and active services/kernel controlsConfiguration presence does not prove enforcement
Runtime evidenceCorrelated events/audit, process/token/credential, packet/syscall and workload resultOne event, clean status or allow/deny does not prove complete security
ClosureOriginal allowed/denied workload works, unsafe state is removed and recovery/regression passCommit, restart, block or compliance result alone is not closure

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4565

Confirmation

Confirm action

Continue?