Detection rules › Splunk
ASL AWS IAM AccessDenied Discovery Events
The following analytic identifies excessive AccessDenied events within an hour timeframe for IAM users in AWS. It leverages AWS CloudTrail logs to detect multiple failed access attempts from the same source IP and user identity. This activity is significant as it may indicate that an access key has been compromised and is being misused for unauthorized discovery actions. If confirmed malicious, this could allow attackers to gather information about the AWS environment, potentially leading to further exploitation or privilege escalation.
Known false positives
- It is possible to start this detection will need to be tuned by source IP or user. In addition, change the count values to an upper threshold to restrict false positives.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Rule body
name: ASL AWS IAM AccessDenied Discovery Events
id: a4f39755-b1e2-40bb-b2dc-4449c45b0bf2
version: 7
creation_date: '2022-10-04'
modification_date: '2026-05-13'
author: Patrick Bareiss, Splunk
status: production
type: Anomaly
description: The following analytic identifies excessive AccessDenied events within an hour timeframe for IAM users in AWS. It leverages AWS CloudTrail logs to detect multiple failed access attempts from the same source IP and user identity. This activity is significant as it may indicate that an access key has been compromised and is being misused for unauthorized discovery actions. If confirmed malicious, this could allow attackers to gather information about the AWS environment, potentially leading to further exploitation or privilege escalation.
data_source:
- ASL AWS CloudTrail
search: |-
`amazon_security_lake` api.response.error=AccessDenied OR api.response.error=OperationNotPermittedException OR api.response.error=*Unauthorized* actor.user.type=IAMUser
| bucket _time span=1h
| stats count as failures min(_time) as firstTime max(_time) as lastTime dc(api.operation) as dc_operation, dc(api.service.name) as dc_service values(api.operation) as api.operation values(api.service.name) as api.service.name values(http_request.user_agent) as http_request.user_agent values(src_endpoint.ip) as src_ip values(actor.user.account.uid) as actor.user.account.uid values(cloud.provider) as cloud.provider values(cloud.region) as cloud.region
BY _time actor.user.uid
| where failures >= 5 AND dc_operation >= 1 AND dc_service >= 1
| rename actor.user.uid as user api.operation as action api.service.name as dest http_request.user_agent as user_agent src_endpoint.ip as src actor.user.account.uid as vendor_account cloud.provider as vendor_product cloud.region as vendor_region
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `asl_aws_iam_accessdenied_discovery_events_filter`
how_to_implement: The detection is based on Amazon Security Lake events from Amazon Web Services (AWS), which is a centralized data lake that provides security-related data from AWS services. To use this detection, you must ingest CloudTrail logs from Amazon Security Lake into Splunk. To run this search, ensure that you ingest events using the latest version of Splunk Add-on for Amazon Web Services (https://splunkbase.splunk.com/app/1876) or the Federated Analytics App.
known_false_positives: It is possible to start this detection will need to be tuned by source IP or user. In addition, change the count values to an upper threshold to restrict false positives.
references:
- https://aws.amazon.com/premiumsupport/knowledge-center/troubleshoot-iam-permission-errors/
intermediate_findings:
entities:
- field: user
type: user
score: 20
message: User $user$ is seen to perform excessive number of discovery related api calls- $failures$, within an hour where the access was denied.
threat_objects:
- field: src_ip
type: ip_address
analytic_story:
- Suspicious Cloud User Activities
asset_type: AWS Account
mitre_attack_id:
- T1580
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: cloud
security_domain: access
Stages and Predicates
Stage 1: search
`amazon_security_lake` api.response.error=AccessDenied OR api.response.error=OperationNotPermittedException OR api.response.error=*Unauthorized* actor.user.type=IAMUser
Stage 2: bucket
| bucket _time span=1h
Stage 3: stats
| stats count as failures min(_time) as firstTime max(_time) as lastTime dc(api.operation) as dc_operation, dc(api.service.name) as dc_service values(api.operation) as api.operation values(api.service.name) as api.service.name values(http_request.user_agent) as http_request.user_agent values(src_endpoint.ip) as src_ip values(actor.user.account.uid) as actor.user.account.uid values(cloud.provider) as cloud.provider values(cloud.region) as cloud.region
BY _time actor.user.uid
Stage 4: where
| where failures >= 5 AND dc_operation >= 1 AND dc_service >= 1
Stage 5: rename
| rename actor.user.uid as user api.operation as action api.service.name as dest http_request.user_agent as user_agent src_endpoint.ip as src actor.user.account.uid as vendor_account cloud.provider as vendor_product cloud.region as vendor_region
Stage 6: search
| `security_content_ctime(firstTime)`
Stage 7: search
| `security_content_ctime(lastTime)`
Stage 8: search
| `asl_aws_iam_accessdenied_discovery_events_filter`
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
actor.user.type | eq |
| field:"actor.user.type" kind:eq value:"IAMUser" |
api.response.error | eq |
| field:"api.response.error" kind:eq |
dc_operation | ge |
| field:"dc_operation" kind:ge value:"1" |
dc_service | ge |
| field:"dc_service" kind:ge value:"1" |
failures | ge |
| field:"failures" kind:ge value:"5" |
sourcetype | eq |
| field:"sourcetype" kind:eq value:"aws:asl" |