Detection: Linux Auditd Service Crash and Restart Burst

Description

This analytic detects repeated Linux process crash events followed by repeated successful executions of the same executable on the same host within 10 seconds. A rapid crash and restart pattern in a service process can indicate exploitation attempts or unstable application behavior and should be correlated with network and application telemetry.

 1`linux_auditd`
 2(
 3    type=ANOM_ABEND
 4    OR
 5    (
 6        type=SYSCALL success="yes"
 7        (
 8            syscall IN ("59", "221", "11")
 9            OR
10            SYSCALL="execve"
11        )
12    )
13)
14
15
16| eval exe=coalesce(exe, executable), event_type=if(type="ANOM_ABEND", "crash", "start")
17
18| eval sig=coalesce(sig, signal)
19
20
21| where event_type="start" OR tonumber(sig) IN (6, 7, 11)
22
23
24| sort 0 _time
25
26
27| streamstats time_window=10s count(eval(event_type="crash")) as crash_count max(eval(if(event_type="crash", _time, null()))) as last_crash_time values(eval(if(event_type="crash", sig, null()))) as crash_signals by host exe
28
29
30| eval restart_after_crash=if(event_type="start" AND _time>last_crash_time, 1, 0)
31
32
33| streamstats time_window=10s sum(restart_after_crash) as restart_count by host exe
34
35
36| where event_type="start" AND crash_count>=2 AND restart_count>=2
37
38
39| stats min(_time) as firstTime max(_time) as lastTime max(crash_count) as crash_count max(restart_count) as restart_count values(crash_signals) as crash_signals values(comm) as process_name values(uid) as uid values(auid) as auid values(ppid) as parent_pid by host exe
40
41
42| rename host as dest
43
44
45| `security_content_ctime(firstTime)`
46
47| `security_content_ctime(lastTime)`
48
49| `linux_auditd_service_crash_and_restart_burst_filter`

Data Source

Name Platform Sourcetype Source
Linux Auditd Syscall Linux icon Linux 'auditd' 'auditd'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
linux_auditd_service_crash_and_restart_burst_filter search *
linux_auditd_service_crash_and_restart_burst_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1499.004 Application or System Exploitation Impact
Actions on Objectives
DE.AE
CIS 10

CVE

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) No
Creates Intermediate Finding (Risk Event) Yes
Anomaly detections generate Intermediate Findings (Risk Events). They do not generate a Finding (Notable) directly.

Implementation

To implement this detection, the process begins by ingesting auditd data, that consists of SYSCALL, TYPE, EXECVE and PROCTITLE events, which captures command-line executions and process details on Unix/Linux systems. These logs should be ingested and processed using Splunk Add-on for Unix and Linux (https://splunkbase.splunk.com/app/833), which is essential for correctly parsing and categorizing the data. The next step involves normalizing the field names to match the field names set by the Splunk Common Information Model (CIM) to ensure consistency across different data sources and enhance the efficiency of data modeling. This approach enables effective monitoring and detection of linux endpoints where auditd is deployed

Known False Positives

Application defects, resource pressure, and supervisor restart policies can produce repeated crashes and restarts. Review the affected executable, user, parent process, host role, and related application or network activity. Tune thresholds or exclude expected workloads with the filter macro.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
Executable [$exe$] crashed and restarted repeatedly on [$dest$] within 10 seconds. dest system 20

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation ✅ Passing N/A N/A N/A
Unit ✅ Passing Dataset auditd auditd
Integration ✅ Passing Dataset auditd auditd

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub |

Version: 1