This detection has been marked experimental by the Splunk Threat Research team. This means we have not been able to test, simulate, or build datasets for this detection. Use at your own risk. This analytic is NOT supported.

Try in Splunk Security Cloud


This analytic identifies shell activity within the Kubernetes privilege scope on a worker node. It returns shell processes only if they're consuming CPU resources. The detection uses process metrics from an OTEL collector hostmetrics receiver, pulled from Splunk Observability cloud via the Splunk Infrastructure Monitoring Add-on. The metrics used are process.cpu.utilization and process.memory.utilization. Shell processes can indicate unauthorized activity, posing a security threat. Attackers could compromise the node and the entire Kubernetes cluster via shell access to worker nodes. Monitoring shell processes is crucial for anomaly detection, policy enforcement, and breach mitigation. Unauthorized shell processes on a Kubernetes worker node could severely impact the cluster's security and integrity. Attackers could gain full control over the host's resources and file system, compromising all hosted workloads and data. This access could lead to data theft, service disruption, privilege escalation, lateral movement, and further attacks within the cluster. Attackers could also manipulate configurations, deploy malicious containers, and execute arbitrary code, severely risking the confidentiality, availability, and integrity of applications and sensitive data. A rapid and comprehensive incident response is required to mitigate and recover from such a breach.

  • Type: Anomaly
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2023-12-18
  • Author: Matthew Moore, Splunk
  • ID: cc1448e3-cc7a-4518-bc9f-2fa48f61a22b




ID Technique Tactic
T1204 User Execution Execution
Kill Chain Phase
  • Installation
  • DE.AE
  • CIS 13
| mstats avg(process.cpu.utilization) as process.cpu.utilization avg(process.memory.utilization) as process.memory.utilization where `kubernetes_metrics` AND process.executable.name IN ("sh","bash","csh", "tcsh") by host.name k8s.cluster.name k8s.node.name process.pid process.executable.name span=10s 
| search process.cpu.utilization>0 
| stats avg(process.cpu.utilization) as process.cpu.utilization avg(process.memory.utilization) as process.memory.utilization by host.name k8s.cluster.name k8s.node.name process.pid process.executable.name 
| rename host.name as host 
| `kubernetes_shell_running_on_worker_node_with_cpu_activity_filter` 


The SPL above uses the following Macros:

:information_source: kubernetes_shell_running_on_worker_node_with_cpu_activity_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • process.cpu.utilization
  • process.memory.utilization
  • process.executable.name
  • host.name
  • k8s.cluster.name
  • k8s.node.name
  • process.pid

How To Implement

To implement this detection, follow these steps:

  • Deploy the OpenTelemetry Collector (OTEL) to your Kubernetes cluster.
  • Enable the hostmetrics/process receiver in the OTEL configuration.
  • Ensure that the process metrics, specifically Process.cpu.utilization and process.memory.utilization, are enabled.
  • Install the Splunk Infrastructure Monitoring (SIM) add-on. (ref: https://splunkbase.splunk.com/app/5247)
  • Configure the SIM add-on with your Observability Cloud Organization ID and Access Token.
  • Set up the SIM modular input to ingest Process Metrics. Name this input "sim_process_metrics_to_metrics_index".
  • In the SIM configuration, set the Organization ID to your Observability Cloud Organization ID.
  • Set the Signal Flow Program to the following: data('process.threads').publish(label='A'); data('process.cpu.utilization').publish(label='B'); data('process.cpu.time').publish(label='C'); data('process.disk.io').publish(label='D'); data('process.memory.usage').publish(label='E'); data('process.memory.virtual').publish(label='F'); data('process.memory.utilization').publish(label='G'); data('process.cpu.utilization').publish(label='H'); data('process.disk.operations').publish(label='I'); data('process.handles').publish(label='J'); data('process.threads').publish(label='K')
  • Set the Metric Resolution to 10000.
  • Leave all other settings at their default values.
  • Run the Search Baseline Of Kubernetes Container Network IO Ratio

    Known False Positives


Associated Analytic Story


Risk Score Impact Confidence Message
25.0 50 50 Kubernetes shell with cpu activity running on worker node on host $host$

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.


Test Dataset

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 | version: 1