Skip to content
Threat Feed
medium advisory updated

Detection of AWS EC2 Deprecated AMI Discovery

Detection of reconnaissance activity where AWS users or roles query the EC2 API for deprecated Amazon Machine Images, a technique used by adversaries to identify vulnerable or outdated system images for potential exploitation.

What's new

  • 1. added detection rule: Detect AWS EC2 Route Table Modification or Deletion Sep 19, 13:29 via elastic
  • 2. added detection rule: Detect AWS EC2 Full Network Packet Capture Sep 18, 19:32 via elastic

This detection brief addresses the reconnaissance technique where an AWS identity queries for deprecated Amazon Machine Images (AMIs). Attackers often perform this discovery during the post-compromise or initial access phases to identify outdated or unpatched system images that may contain known vulnerabilities. By leveraging the DescribeImages API call with the includeDeprecated parameter set to true, an adversary can enumerate images that are no longer recommended for use but may still be available in the environment. While these queries are not inherently malicious and can occur during legitimate maintenance or security assessments, they provide a strong signal of unauthorized discovery when originating from unexpected identities or sources. Defenders should monitor these API calls to correlate them with subsequent instance launch activity or lateral movement attempts within the AWS account.

Impact

Successful reconnaissance of deprecated AMIs can lead to the identification of legacy systems that lack critical security patches, potentially exposing the environment to RCE or privilege escalation if an attacker manages to launch and compromise these instances. Monitoring this activity assists in reducing the attack surface by identifying images that should be decommissioned or restricted via IAM policies.

Recommendation

  • Deploy the provided detection rule to monitor CloudTrail logs for the DescribeImages API action with the includeDeprecated parameter enabled.
  • Restrict IAM permissions for the ec2:DescribeImages action to ensure only authorized service principals and administrators can perform these lookups.
  • Perform a quarterly audit of all AMIs in use within the AWS environment to identify and replace deprecated images with current, hardened versions.
  • Use the aws.cloudtrail.user_identity.arn and source.ip fields to investigate the context of flagged queries, cross-referencing these with any subsequent RunInstances API calls.

Immediate actions

Deploy the Sigma rule to monitor for DescribeImages API calls with includeDeprecated=true

Detection Engineering 72h

Threat Hunt

Identify all IAM identities that have performed DescribeImages with includeDeprecated=true in the last 30 days

T1580 medium high confidence hunt now

Data: CloudTrail logs

Mitigations

Review and restrict IAM policies allowing DescribeImages

medium_term Cloud Security

T1580

Detection coverage 3

AWS EC2 Deprecated AMI Discovery

low

Detects when an AWS identity queries for deprecated Amazon Machine Images via the DescribeImages API call.

sigma tactics: discovery techniques: T1580 sources: cloudtrail, aws

Detect AWS EC2 Full Network Packet Capture

medium

Detects successful creation of an Amazon EC2 Traffic Mirroring session, which can be abused for covert network sniffing.

sigma tactics: exfiltration techniques: T1040, T1537 sources: cloud, aws

Detect AWS EC2 Route Table Modification or Deletion

low

Detects potentially unauthorized modifications or deletions of AWS route tables via CloudTrail events which may indicate persistence or network disruption attempts.

sigma tactics: persistence techniques: T1578.005 sources: cloud, aws

Detection queries are available on the platform. Get full rules →