| name | cis-ubuntu1604-v200-6-2-6 |
| description | Ensure users' home directories permissions are 750 or more restrictive |
| category | cis-iam |
| version | 2.0.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu","linux","ubuntu-16.04","user-management","maintenance"] |
| cis_id | 6.2.6 |
| cis_benchmark | CIS Ubuntu Linux 16.04 LTS Benchmark v2.0.0 |
| tech_stack | ["ubuntu","linux"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
CIS Ubuntu Linux 16.04 LTS Benchmark v2.0.0 - Control 6.2.6
Profile
- Level: 1 - Server
- Level: 1 - Workstation
- Assessment Status: Automated
Description
While the system administrator can establish secure permissions for users' home directories, the users can easily override these.
Rationale
Group or world-writable user home directories may enable malicious users to steal or modify other users' data or to gain another user's system privileges.
Audit Procedure
Command Line
Run the following script and verify no results are returned:
#!/bin/bash
awk -F: '($1!~/(halt|sync|shutdown)/ && $7!~/^(\/usr)?\/sbin\/nologin(\/)?\$/
&& $7!~/(\/usr)?\/bin\/false(\/)?\$/) {print $1 " " $6}' /etc/passwd | while
read -r user dir; do
if [ ! -d "$dir" ]; then
echo "User: \"$user\" home directory: \"$dir\" doesn't exist"
else
dirperm=$(stat -L -c "%A" "$dir")
if [ "$(echo "$dirperm" | cut -c6)" != "-" ] || [ "$(echo "$dirperm" |
cut -c8)" != "-" ] || [ "$(echo "$dirperm" | cut -c9)" != "-" ] || [ "$(echo
"$dirperm" | cut -c10)" != ];