Ollama DNS Query to Untrusted Domain

Last updated 5 days ago on 2026-01-09
Created 5 days ago on 2026-01-09

About

Detects Ollama DNS queries to domains outside official infrastructure. Adversaries can redirect Ollama to pull models from attacker-controlled servers via OLLAMA_HOST or custom manifests. Malicious models may contain backdoors, exploit parsing vulnerabilities like CVE-2025-1975, or poison inference outputs.
Tags
Domain: EndpointOS: LinuxOS: macOSOS: WindowsUse Case: Threat DetectionTactic: Command and ControlData Source: Elastic DefendDomain: LLMMitre Atlas: T0010.003Rule Type: BBRLanguage: eql
Severity
low
Risk Score
21
MITRE ATT&CK™

Command and Control (TA0011)(external, opens in a new tab or window)

Initial Access (TA0001)(external, opens in a new tab or window)

License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-endpoint.events.network-*
Related Integrations

endpoint(external, opens in a new tab or window)

Query
text code block:
network where event.action == "lookup_requested" and process.name in ("ollama", "ollama.exe") and dns.question.name != null and not dns.question.name : ( "ollama.ai", "*.ollama.ai", "ollama.com", "*.ollama.com", "github.com", "*.github.com", "*.githubusercontent.com", "*.r2.cloudflarestorage.com", "*.cloudflare.com", "*.cloudflarestorage.com", "localhost", "*.local", "*.internal", "*.localdomain" )

Install detection rules in Elastic Security

Detect Ollama DNS Query to Untrusted Domain in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).