| name | cis-ubuntu1804-v220-5-2-3-6 |
| version | 2.2.0 |
| date_published | "2024-01-01T00:00:00.000Z" |
| category | cis-logging |
| description | Ensure use of privileged commands are collected |
| author | CIS Benchmarks |
| tags | ["cis","ubuntu","linux","ubuntu-18.04","auditing","auditd"] |
| target | {"platform":"linux","version":"18.04"} |
| severity_boost | {} |
5.2.3.6 Ensure use of privileged commands are collected
Profile Applicability
- Level 2 - Server
- Level 2 - Workstation
Description
Monitor privileged programs, those that have the setuid and/or setgid bit set on execution, to determine if unprivileged users are running these commands.
Rationale
Execution of privileged commands by non-privileged users could be an indication of someone trying to gain unauthorized access to the system.
Impact
Both the audit and remediation section of this recommendation will traverse all mounted file systems that is not mounted with either noexec or nosuid mount options. If there are large file systems without these mount options, such traversal will be significantly detrimental to the performance of the system.
Before running either the audit or remediation section, inspect the output of the following command to determine exactly which file systems will be traversed:
findmnt -n -l -k -it $(awk '/nodev/ { print $2 }' /proc/filesystems | paste -sd,) | grep -Pv "noexec|nosuid"
To exclude a particular file system due to adverse performance impacts, update the audit and remediation sections by adding a sufficiently unique string to the grep statement. The above command can be used to test the modified exclusions.
Audit
On disk configuration
Run the following command to check on disk rules:
RUNNING=0
PARTITION=$(findmnt -n -l -k -it $(awk '/nodev/ { print $2 }' /proc/filesystems | paste -sd,) | grep -Pv "noexec|nosuid" | awk '{print $1}')
for PARTITION in $(findmnt -n -l -k -it $(awk '/nodev/ { print $2 }' /proc/filesystems | paste -sd,) | grep -Pv "noexec|nosuid" | awk '{print $1}'); do
for PRIVILEGED in $(find "${PARTITION}" -xdev -perm /6000 -type f);
grep -qr /etc/audit/rules.d && ||