For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/default_rules/def-000-z6p.md. A documentation index is available at /llms.txt.

Kubernetes service account token created in container

Deprecation Notice (June 5, 2026): This rule is deprecated in favor of the Container escape attack correlation rule, which combines multiple container escape signals into a single, higher-fidelity detection. You automatically benefit from the improved correlation-based detection without any action required.

What happened

A kubectl command was used to create a new service account token, potentially to establish persistence or escalate privileges.

Goal

Detect the use of kubectl commands inside a container to create a new service account token.

Strategy

This detection triggers when kubectl is executed with specific arguments related to creating a new service account token.

Triage and response

  1. Identify the purpose and scope of the service account.
  2. Confirm if the service account token being created is authorized.
  3. Determine the resources involved, such as new containers.
  4. Initiate the incident response process.
  5. Remediate compromised resources and repair the root cause.

Requires Agent version 7.27 or greater