ID | Technique | Tactic |
---|---|---|
T1595 | Active Scanning | Reconnaissance |
Detection: Ollama Possible API Endpoint Scan Reconnaissance
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 API reconnaissance and endpoint scanning activity against Ollama servers by identifying sources probing multiple API endpoints within short timeframes, particularly when using HEAD requests or accessing diverse endpoint paths, which indicates systematic enumeration to map the API surface, discover hidden endpoints, or identify vulnerabilities before launching targeted attacks.
Search
1`ollama_server` "[GIN]"
2| bin _time span=5m
3| stats count as total_requests, values(dest) as dest, values(http_method) as methods, values(status) as status_codes by _time, src, host
4| where total_requests > 120
5| eval severity="medium"
6| eval attack_type="API Activity Surge"
7| stats count by _time, host, src, total_requests, dest, methods, status_codes, severity, attack_type
8| `ollama_possible_api_endpoint_scan_reconnaissance_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_possible_api_endpoint_scan_reconnaissance_filter | search * |
ollama_possible_api_endpoint_scan_reconnaissance_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 web application clients or mobile apps that access multiple API endpoints as part of normal functionality, monitoring and health check systems probing various endpoints for availability, load balancers performing health checks across different paths, API testing frameworks during development and QA processes, or users navigating through web interfaces that trigger multiple API calls may generate similar patterns during normal operations.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message:
API reconnaissance activity detected from $src$ on $host$ with $total_requests$ requests across different endpoints using methods $methods$ and receiving status codes $status_codes$, indicating systematic endpoint enumeration to map API attack surface and identify potential vulnerabilities.
Risk Object | Risk Object Type | Risk Score | Threat Objects |
---|---|---|---|
src | system | 10 | No Threat Objects |
References
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | Not Applicable | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | server.log |
ollama:server |
Integration | ✅ Passing | Dataset | server.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