CCyberwiki

Cloud discovery

Cloud discovery
ClassReconnaissance, Secrets
Also known asCloud enumeration; cloud infrastructure discovery; cloud service discovery
MITRE ATT&CKT1580 Cloud Infrastructure Discovery; T1526 Cloud Service Discovery
Typical severityLow on its own; it precedes the damaging steps
AffectsAWS, Google Cloud and Azure accounts reached with a stolen access key, service account key or sign-in

A cloud access key copied from a readable environment file carries no label saying whose it is or what it opens. Cloud discovery is the stage in which the holder of the key finds out, by sending the provider's own read-only API calls: which account and identity the key belongs to, which permissions it holds, which services are switched on and which servers, storage buckets, databases and snapshots exist.12 The answers decide what the attacker goes after next: data and credentials in the services found, or the security and logging tools that would record the intrusion.2

The calls are ordinary features of the provider's API,2 so detection looks at who sends them, from where and how many arrive in a row.1 Discovery follows the first use of a stolen key described in Stolen cloud credentials, and the key may come from an exposed file or from a cloud server's metadata service (Cloud instance metadata service).

Identity first

On AWS a common first request is GetCallerIdentity, the AWS version of whoami. It returns the caller's user ID, the 12-digit account number and the ARN, the resource name that spells out the account and the name of the user or role.3 A related call, GetAccessKeyInfo, takes only the first part of a key, the access key ID, and returns the account it belongs to. An ID that starts with AKIA is a long-term key of an IAM user or the root user; one that starts with ASIA is temporary. The call does not say whether the key is still active.4

Infrastructure and services

The listing comes in two kinds. Infrastructure discovery reads the parts inside services the account already uses: servers, virtual machines, snapshots, buckets and databases.1 Service discovery asks which services are running at all, including build pipelines, serverless functions, the identity directory, and security and logging services such as GuardDuty, Microsoft Defender for Cloud, CloudTrail and Google Cloud Audit Logs.2 Knowing that a logging service runs tells the attacker what to switch off before acting (Disabled and deleted logs).

Table 1. Examples of discovery calls by provider1
ProviderCall or commandReturns
AWSDescribeInstancesServers in the account
AWSListBuckets, HeadBucket, GetPublicAccessBlockBuckets owned by the caller, whether one exists and what the caller may do with it, its public access settings
AWSDescribeDBInstancesSize, owner, permissions and network rules of databases
Google Cloudgcloud compute instances listCompute Engine servers in a project
Azureaz vm listVirtual machines

On Azure, the Microsoft Graph API and the Azure Resource Manager API list the applications, management groups, resources and policy definitions an identity can reach, and open-source tools such as Pacu for AWS and Stormspotter for Azure automate the listing.2

Testing permissions

The name of the user or role, or the place where the key was found, hints at what it may do but gives no full list. The blunt method is to try calls one by one: the open-source tool enumerate-iam sends a long series of get and list requests, taking the list of calls from Amazon's JavaScript library for the AWS API, and records which succeed. The successful calls are the key's permissions.5 Google Cloud offers a direct route, projects.testIamPermissions, which takes a list of named permissions and returns those the caller holds on a project.6

Cases

In the extortion campaign Unit 42 described in August 2024, every operation began with GetCallerIdentity. The attackers then called ListUsers for IAM users to move to later and ListBuckets for buckets to copy out (Data exfiltration), and queried the email service with GetSendQuota, ListIdentities and three similar calls. That told them the stolen credential lacked administrator rights but could create roles and attach policies, which they used to make a role named lambda-ex with full access.3

Storm-0501, in a case Microsoft published in August 2025, used the account that copies the company's on-premises directory to Entra ID, Microsoft's cloud directory, to list users, roles and Azure resources with AzureHound, a tool that maps permissions and the paths between them. After repeating the listing in a second Entra ID tenant (a separate directory) of the same company, the group found a non-human account holding Global Administrator, the top role in Entra ID, with no second factor registered, which became the way in. Once in control, the group mapped the data stores, the backup resources and the protections around them: Azure policies, resource locks and storage immutability policies. When locks and immutability policies blocked some deletions, it deleted those protections and went on deleting the data (Deleting backups).7

Traces in the logs

Each discovery call is an API request, and CloudTrail records it. A CloudTrail entry marks whether the operation was read-only and, for a refused request, carries an errorCode.8 Trying calls one by one, as enumerate-iam does, fills the log with such entries.5 Amazon GuardDuty raises Discovery:IAMUser/AnomalousBehavior, at low default severity, when a get, describe or list call such as DescribeInstances or ListAccessKeys is made in an unusual way, and separate findings when such calls come from the Tor network or an address on a threat list.9 Other signs are a new identity sending discovery calls, an unfamiliar location, many services listed in quick succession, and a snapshot or server change soon after.1

Limiting what a key reveals

Service discovery uses ordinary features and cannot be blocked outright.2 What a key can list follows from its permissions, so the main control is Principle of least privilege: few identities with administrator roles, few permanent privileged assignments, and regular reviews of users, roles and policies.1 AWS IAM shows when each allowed service was last used, so permissions nobody uses can be removed.10

See also

References

  1. a b c d e f MITRE (version 1.3, modified 4 November 2026). "Cloud Infrastructure Discovery, Technique T1580". MITRE ATT&CK.
  2. a b c d e f MITRE (version 1.4, modified 12 May 2026). "Cloud Service Discovery, Technique T1526". MITRE ATT&CK.
  3. a b Unit 42 (15 August 2024). "Leaked Environment Variables Allow Large-Scale Extortion Operation in Cloud Environments". Palo Alto Networks.
  4. back Amazon Web Services. "GetAccessKeyInfo". AWS Security Token Service API Reference.
  5. a b Frichette, N. (20 December 2020, updated 28 December 2022). "Brute Force IAM Permissions". Hacking The Cloud.
  6. back Google Cloud (updated 11 June 2025). "Method: projects.testIamPermissions". Resource Manager documentation.
  7. back Microsoft Threat Intelligence (27 August 2025). "Storm-0501's evolving techniques lead to cloud-based ransomware". Microsoft Security Blog.
  8. back Amazon Web Services. "CloudTrail record contents for management, data, and network activity events". AWS CloudTrail User Guide.
  9. back Amazon Web Services. "GuardDuty IAM finding types". Amazon GuardDuty User Guide.
  10. back Amazon Web Services. "Refine permissions in AWS using last accessed information". AWS Identity and Access Management User Guide.