Panther medium experimental python
Kubernetes API Activity from Tor Exit Node
This detection monitors for Kubernetes API requests originating from known Indicators of Compromise, specifically Tor exit nodes. Tor usage may indicate attempts to hide the true source of malicious activity or unauthorized access attempts. This detection works across AWS EKS, Azure AKS, and GCP GKE clusters.
Detection Logic
from panther_kubernetes_helpers import is_k8s_log, k8s_alert_context
def rule(event):
# Check if this is a Kubernetes audit log with Tor exit node enrichment
if is_k8s_log(event) and event.deep_get("p_enrichment", "tor_exit_nodes"):
return True
return False
def title(event):
username = event.udm("username") or "<UNKNOWN_USER>"
tor_nodes = event.deep_get("p_enrichment", "tor_exit_nodes", default=[])
tor_ip = tor_nodes[0] if tor_nodes else "<UNKNOWN_IP>"
return f"Kubernetes API activity from Tor exit node [{tor_ip}] by user [{username}]"
def dedup(event):
tor_nodes = event.deep_get("p_enrichment", "tor_exit_nodes", default=[])
tor_ip = tor_nodes[0] if tor_nodes else "<UNKNOWN_IP>"
return f"k8s_tor_{tor_ip}"
def alert_context(event):
return k8s_alert_context(
event,
extra_fields={"tor_exit_nodes": event.deep_get("p_enrichment", "tor_exit_nodes")},
) Field Validations
Loading…
Comments (0)
Loading comments...