Elastic unknown experimental kql
Secrets Manager High Frequency of Programmatic GetSecretValue API Calls
This hunting query identifies when a high frequency of `GetSecretValue` API calls are made to the AWS Secrets Manager service programmatically. The `GetSecretValue` API call retrieves the secret value for a specified secret. High frequency of these calls may indicate an adversary attempting to access sensitive information stored in AWS Secrets Manager via a compromised account or automated tooling.
Detection Logic
from logs-aws.cloudtrail*
| where @timestamp > now() - 7 day
| where
event.provider == "secretsmanager.amazonaws.com"
and event.action == "GetSecretValue"
and user_agent.name not in ("Chrome","Firefox","Safari", "Edge", "Brave", "Opera")
| dissect aws.cloudtrail.request_parameters "%{}secret:%{secret_value}}"
| stats request_counts = count(*) by event.action, aws.cloudtrail.user_identity.arn, source.ip, user_agent.name
| sort request_counts asc False Positives
- ⚠ Use the `secret_value` field to identify the secret value that was accessed by adding it to the `stats` statement
- ⚠ Review the `aws.cloudtrail.user_identity*` fields to identify the user making the requests and their role permissions
- ⚠ `user_agent.name` field can provide additional context on the tool or application making the API calls. If not `aws-sdk` or known application, investigate further.
- ⚠ Review the `source.*` fields for the IP address and geographical location of the request and compare with the user's typical behavior
- ⚠ The `aws.cloudtrail.user_identity.arn` field can provide additional context on the user making the request and their role permissions. Recent changes to role permissions or unusual logins may indicate a compromised account
- ⚠ `user_agent.name` field can provide additional context on the tool or application making the API calls. If not `aws-sdk` or known application, investigate further.
Field Validations
Loading…
Comments (0)
Loading comments...