Elastic low stable kql

AWS EKS Suspicious Self-Subject Review via Unusual User Agent

This rule detects when a service account or node attempts to enumerate their own permissions via the selfsubjectaccessreview or selfsubjectrulesreview APIs via an unusual user agent. This is highly unusual behavior for non-human identities like service accounts and nodes. An adversary may have gained access to credentials/tokens and this could be an attempt to determine what privileges they have to facilitate further movement or execution within the cluster.

View Source

Detection Logic

data_stream.dataset : "aws.eks_audit" and
aws.eks.audit.annotations.authorization_k8s_io/decision:"allow" and
aws.eks.audit.verb:"create" and
aws.eks.audit.objectRef.resource:("selfsubjectaccessreviews" or "selfsubjectrulesreviews") and (
  aws.eks.audit.user.username:(system\:serviceaccount\:* or system\:node\:*) or
  aws.eks.audit.impersonatedUser.username:(system\:serviceaccount\:* or system\:node\:*)
) and user_agent.original:(* and not (*kubernetes/$Format))

False Positives

  • ⚠ An administrator may submit this request as an "impersonatedUser" to determine what privileges a particular service account has been granted. However, an adversary may utilize the same technique as a means to determine the privileges of another token other than that of the compromised account.

Field Validations

Loading…

Comments (0)

Loading comments...