| name | cis-ubuntu1604-v200-6-2-7 |
| description | Ensure users' dot files are not group or world writable |
| category | cis-iam |
| version | 2.0.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu","linux","ubuntu-16.04","user-management","maintenance"] |
| cis_id | 6.2.7 |
| 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.7
Profile
- Level: 1 - Server
- Level: 1 - Workstation
- Assessment Status: Automated
Description
While the system administrator can establish secure permissions for users' "dot" files, the users can easily override these.
Rationale
Group or world-writable user configuration files 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
for file in "$dir"/.*; do
if [ ! -h "$file" ] && [ -f "$file" ]; then
fileperm=$(stat -L -c "%A" "$file")
if [ "$(echo "$fileperm" | cut -c6)" != "-" ] || [ "$(echo
"$fileperm" | cut -c9)" != "-" ]; then
echo "User: \"\" file: \"\" has permissions:
\"\""