Detection: Cisco IOS XE Log Clearing Sequence With Optional Loopback Removal

Description

This analytic detects Cisco IOS-XE command sequences where show logging, clear logging, and exit occur within a short period. It also detects the pattern where a loopback interface is removed before clearing logs and exiting.

 1`cisco_ios`
 2facility IN ("AAA", "HA_EM", "PARSER")
 3mnemonic IN ("AAA_ACCOUNTING_MESSAGE", "LOG", "CFGLOG_LOGGEDCMD")
 4message_text IN ("*show logging*", "*clear logging*", "*exit*", "*no interface Loopback*")
 5
 6
 7| eval cmd=lower(coalesce(command, message_text))
 8
 9| eval event_type=case(
10            like(cmd, "%show logging%"), "show_logging",
11            like(cmd, "%clear logging%"), "clear_logging",
12            like(cmd, "%exit%"), "exit",
13            like(cmd, "%no interface loopback%"), "remove_loopback"
14        )
15
16| where isnotnull(event_type)
17
18| eval dest=coalesce(host, dvc, dest, "unknown")
19
20| bin _time span=2m
21
22| stats count min(_time) as firstTime
23              max(_time) as lastTime
24              values(event_type) as event_types
25              values(message_text) as message_text
26              values(cmd) as cmd
27  by _time dest
28
29| where mvfind(event_types, "clear_logging") >= 0
30        AND
31        mvfind(event_types, "exit") >= 0
32        AND
33        (
34            mvfind(event_types, "show_logging") >= 0
35            OR
36            mvfind(event_types, "remove_loopback") >= 0
37        )
38
39| `security_content_ctime(firstTime)`
40
41| `security_content_ctime(lastTime)`
42
43| `cisco_ios_xe_log_clearing_sequence_with_optional_loopback_removal_filter`

Data Source

Name Platform Sourcetype Source
Cisco IOS Logs Other 'cisco:ios' 'cisco:ios'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
cisco_ios_xe_log_clearing_sequence_with_optional_loopback_removal_filter search *
cisco_ios_xe_log_clearing_sequence_with_optional_loopback_removal_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
T1070.001 Clear Windows Event Logs Stealth
T1562 Impair Defenses Stealth
Exploitation
DE.AE
CIS 13

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

Use the Cisco Catalyst Add-on for Splunk (https://splunkbase.splunk.com/app/7538) to Ingest Cisco IOS-XE syslog with sourcetype "cisco:ios". Command visibility requires AAA command accounting, archive/config logging for configuration commands, or EEM catchall logging.

Known False Positives

No false positives have been identified at this time.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
Cisco IOS-XE log clearing sequence was observed on $dest$. dest system 20

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset ctb:catalyst:syslog cisco:ios
Integration ✅ Passing Dataset ctb:catalyst:syslog cisco:ios

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