title: Command Execution In A Pod Via exec Or attach
id: 2f1e0d9c-8b7a-4653-9f21-0c3b2a1e4d5f
status: experimental
description: |
    Detects use of the pods/exec or pods/attach subresource, i.e. an interactive command run
    inside a running container. Visible from Request level upward; the executed command and
    target container are in the request URI.
references:
    - https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/
    - https://attack.mitre.org/techniques/T1609/
author: PurpleLog
date: 2026-10-17
tags:
    - attack.execution
    - attack.t1609
logsource:
    product: kubernetes
    service: audit
detection:
    selection:
        objectRef.subresource:
            - 'exec'
            - 'attach'
    condition: selection
falsepositives:
    - Operators and CI pipelines that legitimately exec into pods for debugging
    - Baseline the usual service accounts and users before alerting
level: medium
