TMAegisBeta
More rules for ros

ROS (Robot Operating System)

TMA-ROS1-1.3.3

Ensure sudo log file exists

MediumLevel 1Automatedros

Description

sudo can use a custom log file The audit requires a "Defaults logfile=<path>" entry in /etc/sudoers or /etc/sudoers.d/*. Host-level control from the CIS ROS Melodic benchmark (Ubuntu 18.04 robot hosts); run as root.

How it is checked

Audit method: Shell command

shell
grep -Pqs -- '^\s*Defaults\s+([^#]+,\s*)?logfile=\S+' /etc/sudoers /etc/sudoers.d/* && echo compliant || echo 'Defaults logfile= is not set'
Expected output
compliant

How it is fixed

Fix method: Guidance or infrastructure patch

edit the file /etc/sudoers or a file in /etc/sudoers.d/ and add the following line: Defaults logfile="<PATH TO CUSTOM LOG FILE>" Example Defaults logfile="/var/log/sudo.log"

Properties

Operating systems
Any
Tags
rosros1melodicsystem
Reference
CIS ROS Melodic Benchmark v1.0.0 - 1.3.3 Ensure sudo log file exists

Check this host

Run this on a machine you are allowed to audit. The scan is read-only.

shell
tmaegis scan --target ros