Detection: Splunk Authentication Token Exposure in Debug Log

Description

The following analytic identifies exposed authentication tokens in debug logs within Splunk Enterprise. It leverages logs from the splunkd component with a DEBUG log level, specifically searching for event messages that validate tokens. This activity is significant because exposed tokens can be exploited by attackers to gain unauthorized access to the Splunk environment. If confirmed malicious, this exposure could lead to unauthorized data access, privilege escalation, and potential compromise of the entire Splunk infrastructure. Monitoring and addressing this vulnerability is crucial for maintaining the security and integrity of the Splunk deployment.

1`splunkd` component=JsonWebToken log_level=DEBUG eventtype="splunkd-log" event_message="Validating token:*" 
2| rex "Validating token: (?<token>.*)\.$" 
3| search token!=None 
4| stats count min(_time) as firstTime max(_time) as lastTime values(log_level) as log_level values(event_message) as event_message by index, sourcetype, host, token 
5| `security_content_ctime(firstTime)` 
6| `security_content_ctime(lastTime)` 
7| `splunk_authentication_token_exposure_in_debug_log_filter`

Data Source

Name Platform Sourcetype Source Supported App
N/A N/A N/A N/A N/A

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
splunk_authentication_token_exposure_in_debug_log_filter search *
splunk_authentication_token_exposure_in_debug_log_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
T1654 Log Enumeration Discovery
KillChainPhase.EXPLOITAITON
NistCategory.DE_CM
Cis18Value.CIS_10
APT5
Volt Typhoon

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 Notable Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Risk Event True
This configuration file applies to all detections of type TTP. These detections will use Risk Based Alerting and generate Notable Events.

Implementation

Requires access to internal Splunk indexes.

Known False Positives

Only applies to affected versions of Splunk Enterprise below 9.2.1, 9.1.4, and 9.0.9

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
Possible JsonWebToken exposure, please investigate affected $host$ 50 50 100
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset /opt/splunk/var/log/splunk/splunkd.log splunkd
Integration ✅ Passing Dataset /opt/splunk/var/log/splunk/splunkd.log splunkd

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: 2