ASL AWS IAM AccessDenied Discovery Events

Original Source: [splunk source]
Name:ASL AWS IAM AccessDenied Discovery Events
id:a4f39755-b1e2-40bb-b2dc-4449c45b0bf2
version:1
date:2025-01-08
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(src_endpoint.ip) as src_endpoint.ip values(cloud.region) as cloud.region by actor.user.uid _time
| where failures >= 5 AND dc_operation >= 1 AND dc_service >= 1
| rename actor.user.uid as user, src_endpoint.ip as src_ip, cloud.region as 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/
drilldown_searches:
name:'View the detection results for - "$user$"'
search:'%original_detection_search% | search user = "$user$"'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
name:'View risk events for the last 7 days for - "$user$"'
search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
tags:
  analytic_story:
    - 'Suspicious Cloud User Activities'
  asset_type:AWS Account
  confidence:50
  impact:20
  message:User $user$ is seen to perform excessive number of discovery related api calls- $failures$, within an hour where the access was denied.
  mitre_attack_id:
    - 'T1580'
  observable:
    name:'src_ip'
    type:'IP Address'
    - role:
      - 'Attacker'
    name:'user'
    type:'User'
    - role:
      - 'Victim'
  product:
    - 'Splunk Enterprise'
    - 'Splunk Enterprise Security'
    - 'Splunk Cloud'
  required_fields:
    - 'api.operation'
    - 'actor.user.uid'
    - 'src_endpoint.ip'
    - 'cloud.region'
  risk_score:10
  security_domain:access

tests:
name:'True Positive Test'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1580/aws_iam_accessdenied_discovery_events/asl_ocsf_cloudtrail.json
  sourcetype: aws:asl
  source: aws_asl
manual_test:None

Related Analytic Stories


Suspicious Cloud User Activities