Credential Access (TA0006)(external, opens in a new tab or window)
text code block:data_stream.dataset:"kubernetes.audit_logs" and kubernetes.audit.verb:"create" and kubernetes.audit.objectRef.resource:"serviceaccounts" and kubernetes.audit.objectRef.subresource:"token" and user.name:(* and not (system\:kube-controller-manager or system\:kube-scheduler or system\:node\:* or system\:serviceaccount\:kube-system\:* or eks\:* or aksService or aks-service or masterclient or nodeclient or system\:serviceaccount\:gke-managed-system\:* or system\:serviceaccount\:gke-connect\:* or system\:serviceaccount\:anthos-identity-service\:* or system\:gke-controller-manager or system\:serviceaccount\:tigera-operator\:* or system\:serviceaccount\:calico-system\:*))
Install detection rules in Elastic Security
Detect Kubernetes Service Account Token Created via TokenRequest API in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).