| name | cis-ubuntu2004-v300-6-3-3-6 |
| description | Ensure use of privileged commands are collected |
| category | cis-logging |
| version | 3.0.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu","linux","ubuntu-20.04","auditing","auditd"] |
| cis_id | 6.3.3.6 |
| cis_benchmark | CIS Ubuntu Linux 20.04 LTS Benchmark v3.0.0 |
| tech_stack | ["ubuntu","linux"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
6.3.3.6 Ensure use of privileged commands are collected (Automated)
Profile
- 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:
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 Procedure
Command Line
On disk configuration - Run the following script to check on disk rules:
#!/usr/bin/env bash
{
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); do
grep -qr "${PRIVILEGED}" /etc/audit/rules.d && printf "OK: '' found in auditing rules.\n" ||
}