Kubernetes Pod Created with hostPath Volume Mount

Alerts on Kubernetes pod creation requests that include a hostPath volume mount.

FreeUnreviewedSigmalowv1
title: Kubernetes Pod Created with hostPath Volume Mount
id: 3a904120-e175-4b16-b28f-355c49cb928a
status: test
description: This rule flags Kubernetes API audit events where a pod is created with a hostPath volume specified. hostPath mounts bind a directory or file from the node into the container, which can enable attackers with pod-creation rights to access host filesystem paths. The detection relies on Kubernetes audit telemetry capturing pod creation requests and the presence of a hostPath field in the request payload.
references:
  - https://microsoft.github.io/Threat-Matrix-for-Kubernetes/techniques/Writable%20hostPath%20mount/
  - https://blog.appsecco.com/kubernetes-namespace-breakout-using-insecure-host-path-volume-part-1-b382f2a6e216
  - https://github.com/SigmaHQ/sigma/blob/master/rules/application/kubernetes/audit/kubernetes_audit_hostpath_mount.yml
author: Leo Tsaousis (@laripping), Huntrule Team
date: 2024-03-26
tags:
  - attack.t1611
  - attack.privilege-escalation
logsource:
  category: application
  product: kubernetes
  service: audit
detection:
  selection:
    verb: create
    objectRef.resource: pods
    hostPath: "*"
  condition: selection
falsepositives:
  - The DaemonSet controller creates pods with hostPath volumes within the kube-system namespace.
level: low
license: DRL-1.1
related:
  - id: 402b955c-8fe0-4a8c-b635-622b4ac5f902
    type: derived

What it detects

This rule flags Kubernetes API audit events where a pod is created with a hostPath volume specified. hostPath mounts bind a directory or file from the node into the container, which can enable attackers with pod-creation rights to access host filesystem paths. The detection relies on Kubernetes audit telemetry capturing pod creation requests and the presence of a hostPath field in the request payload.

Known false positives

  • The DaemonSet controller creates pods with hostPath volumes within the kube-system namespace.

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.