Skip to main content
Splunk Lantern

Kubernetes (Amazon EKS) service accounts with failed or forbidden status

You want to investigate failed or forbidden status accounts on your network to determine if they represent a threat. 


Run the following search.You can optimize it by specifying an index and adjusting the time range. 

sourcetype="aws:cloudwatchlogs:eks" user.groups{}=system:serviceaccounts responseStatus.status=Failure 
| table sourceIPs{} src_user userAgent verb responseStatus.status requestURI 
Search explanation

The table provides an explanation of what each part of this search achieves. You can adjust this query based on the specifics of your environment.

Splunk Search Explanation


Search only AWS EKS Kubernetes data.


Search the service accounts user group.


Search for requests with a failure status.

| table sourceIPs{} src_user userAgent verb responseStatus.status requestURI 

Display the results in a table with columns in the order shown.

Next steps

You can extend this search by using top or rare operators to find trends or rarities in failure status, user agents, source IP addresses, and request URIs. Note that this search can give false positives as there might be inherent issues with authentications and permissions at cluster.

For additional information about this search, such as its applicability to common frameworks and standards, see this project on GitHub for AWS, Azure, or GCP.

Finally, you might be interested in other processes associated with the Monitoring Kubernetes sensitive object access use case.