ID | Technique | Tactic |
---|---|---|
T1571 | Non-Standard Port | Command And Control |
Detection: Ollama Abnormal Network Connectivity
EXPERIMENTAL DETECTION
This detection status is set to experimental. The Splunk Threat Research team has not yet fully tested, simulated, or built comprehensive datasets for this detection. As such, this analytic is not officially supported. If you have any questions or concerns, please reach out to us at research@splunk.com.
Description
Detects abnormal network activity and connectivity issues in Ollama including non-localhost API access attempts and warning-level network errors such as DNS lookup failures, TCP connection issues, or host resolution problems that may indicate network-based attacks, unauthorized access attempts, or infrastructure reconnaissance activity.
Search
1`ollama_server` level=WARN (msg="*failed*" OR msg="*dial tcp*" OR msg="*lookup*" OR msg="*no such host*" OR msg="*connection*" OR msg="*network*" OR msg="*timeout*" OR msg="*unreachable*" OR msg="*refused*")
2| eval src=coalesce(src, src_ip, "N/A")
3| stats count as incidents, values(src) as src, values(msg) as warning_messages, latest(_time) as last_incident by host
4| eval last_incident=strftime(last_incident, "%Y-%m-%d %H:%M:%S")
5| eval severity="medium"
6| eval attack_type="Abnormal Network Connectivity"
7| stats count by last_incident, host, incidents, src, warning_messages, severity, attack_type
8| `ollama_abnormal_network_connectivity_filter`
Data Source
Name | Platform | Sourcetype | Source |
---|---|---|---|
Ollama Server | N/A | 'ollama:server' |
'server.log' |
Macros Used
Name | Value |
---|---|
ollama_server | (sourcetype="ollama:server") |
ollama_abnormal_network_connectivity_filter | search * |
ollama_abnormal_network_connectivity_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
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 Risk Event | True |
Implementation
Ingest Ollama logs via Splunk TA-ollama add-on by configuring file monitoring inputs pointed to your Ollama server log directories (sourcetype: ollama:server), or enable HTTP Event Collector (HEC) for real-time API telemetry and prompt analytics (sourcetypes: ollama:api, ollama:prompts). CIM compatibility using the Web datamodel for standardized security detections.
Known False Positives
Legitimate remote access from authorized users or applications connecting from non-localhost addresses, temporary network infrastructure issues causing DNS resolution failures, firewall or network configuration changes resulting in connection timeouts, cloud-hosted Ollama instances receiving valid external API requests, or intermittent connectivity problems during network maintenance may trigger this detection during normal operations.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message:
Abnormal network activity detected on $host$ with $incidents$ incidents from $src$. Investigation needed for network errors: $warning_messages$.
Risk Object | Risk Object Type | Risk Score | Threat Objects |
---|---|---|---|
host | system | 10 | src |
References
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | Not Applicable | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | app.log |
ollama:server |
Integration | ✅ Passing | Dataset | app.log |
ollama:server |
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