| name | cis-ubuntu1204-v110-8-1-11 |
| description | Collect Unsuccessful Unauthorized Access Attempts to Files |
| category | cis-os-hardening |
| version | 1.1.0 |
| author | cyberstrike-official |
| tags | ["cis","ubuntu",12.04,"linux","logging","auditd","access","unauthorized","eacces","eperm"] |
| cis_id | 8.1.11 |
| cis_benchmark | CIS Ubuntu 12.04 LTS Server Benchmark v1.1.0 |
| tech_stack | ["ubuntu","linux"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
8.1.11 Collect Unsuccessful Unauthorized Access Attempts to Files (Scored)
Profile Applicability
Description
Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation (creat), opening (open, openat) and truncation (truncate, ftruncate) of files. An audit log record will only be written if the user is a nonprivileged user (auid >= 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."
Rationale
Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system.
Audit Procedure
Using Command Line
On 64 bit systems, perform the following command and ensure the output is as shown to determine if there are unsuccessful attempts to access files:
grep access /etc/audit/audit.rules
On 32 bit systems:
grep access /etc/audit/audit.rules
Expected Result
For 64 bit systems:
-a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access
-a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access
-a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access
-a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access
For 32 bit systems:
-a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access
-a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access
Remediation
Using Command Line
For 64 bit systems, add the following lines to the /etc/audit/audit.rules file:
-a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F =-EACCES -F auid>=500 -F auid!=4294967295 -k access
-a always, -F =b32 -S creat -S open -S openat -S -S ftruncate -F =-EACCES -F auid>=500 -F auid!=4294967295 -k access
-a always, -F =b64 -S creat -S open -S openat -S -S ftruncate -F =-EPERM -F auid>=500 -F auid!=4294967295 -k access
-a always, -F =b32 -S creat -S open -S openat -S -S ftruncate -F =-EPERM -F auid>=500 -F auid!=4294967295 -k access
pkill -HUP -P 1 auditd