How to audit AWS for signs of past compromise (after the Qubole breach)
This week, Wiz published details of a supply-chain attack on customers of Qubole, a big-data platform. Between October 14 and October 26, an attacker used IAM credentials belonging to Qubole's own AWS account to assume the integration roles that Qubole's customers had created for it, then read secrets and S3 data from those customer accounts. The activity ran for about two weeks, and Wiz published its findings on November 9. For any affected customer, that is a window in which someone held valid access to their account.
If you give any third party a cross-account role, the useful question this week is not "could this happen to me" but "how would I know if it already had?" This post is a practical audit you can run in about an hour: what to check, with commands that work, and what the Qubole case teaches about the checks that matter most.
What happened, briefly
According to Wiz's writeup, the attacker called sts:AssumeRole against customer accounts using credentials from the vendor's account. The customers' trust policies still trusted that account, so the calls succeeded. Once inside, the attacker listed resources, read Lambda environment variables, Secrets Manager secrets and SSM parameters, and downloaded S3 objects, in some cases whole buckets in a single session. Credentials found along the way were tested against AWS, Entra ID and Okta.
Two details are worth sitting with. First, every role assumption the attacker made included the correct External ID, and every one succeeded. Second, Wiz's assessment of the single most effective control is blunt: a source IP condition on the trust policy "would have blocked every role assumption we observed."
Step 1: Check that you have the logs to answer the question
You can only audit what was recorded. Before anything else, confirm three things:
- A trail exists and covers all regions. Without a trail, CloudTrail Event history only keeps 90 days of management events, and you can query it per region.
- The trail covers every account. An organization trail is the simplest way to be sure a member account was not left out.
- S3 data events are on for sensitive buckets. Reading an object (
GetObject) is a data event, and data events are off by default. If they are off, a thief can download your data and your logs will show nothing.
If the third one fails, you cannot rule out data theft from the logs, only from other evidence. That is useful to know now rather than during an incident.
Step 2: Inventory every role that trusts another account
Every role whose trust policy names an outside account is a door. List them, with their conditions:
aws iam list-roles --output json | jq -r --arg me "$(aws sts get-caller-identity --query Account --output text)" '.Roles[] | .RoleName as $n | (.AssumeRolePolicyDocument.Statement | if type=="array" then .[] else . end) | select(.Effect=="Allow" and .Principal.AWS != null) | [(.Principal.AWS | if type=="array" then . else [.] end | map(select(contains($me) | not)) | join(",")), (.Condition // {} | tostring)] | select(.[0] != "") | [$n] + . | @tsv'
Each output line is a role name, the outside principal that can assume it, and any conditions. For each one, ask whether you still use the integration, whether the principal is the account root or a specific role, and whether there is any network condition at all. A line ending in only an External ID is the Qubole shape: trusted by account, no network restriction.
Step 3: Look for outside accounts assuming your roles
Now check who has actually used those doors. This pulls AssumeRole events from CloudTrail since October 1 and keeps only the ones made by another account from a real IP address (calls from AWS services show a service name instead of an IP):
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=AssumeRole --start-time 2026-10-01T00:00:00Z --output json | jq -r --arg me "$(aws sts get-caller-identity --query Account --output text)" '.Events[].CloudTrailEvent | fromjson | select(.userIdentity.accountId != $me and (.sourceIPAddress | test("^[0-9.:a-f]+$"))) | [.eventTime, .sourceIPAddress, .userIdentity.accountId, .requestParameters.roleArn, (.requestParameters.roleSessionName // "-")] | @tsv'
Event history is per region and rate limited, so for a large account run the same query in Athena or CloudTrail Lake instead. What you are looking for is a source IP that does not belong to the vendor, especially a VPN exit node or a commodity hosting provider. Wiz's report lists the specific indicators from this campaign, including the vendor account ID, two IAM principal IDs, and the source addresses, so check your results against them as well.
If a legitimate vendor is calling from a stable set of addresses, this list should be short and boring. Anything from a new network is worth a conversation with the vendor.
Step 4: For every suspicious session, read what it did
Take each role session you cannot explain and look at everything that happened under it. The Qubole attacker's pattern is a good template for what to search for:
- Credential harvesting:
GetSecretValueandListSecrets(Secrets Manager),GetParameterandDescribeParameters(SSM), andGetFunctionConfiguration(Lambda environment variables). - Discovery: bursts of
List*andDescribe*calls across many services in a short window. - Data access:
ListBuckets,ListObjectsandGetObject(the last one only appears if data events are on). - Credential testing:
GetCallerIdentitycalls, which is how a thief checks whether a key they found still works.
Step 5: Check for persistence and reused secrets
Someone who had access may have left a way back. Search the same period for CreateAccessKey, CreateUser, CreateRole, UpdateAssumeRolePolicy, AttachRolePolicy, and PutRolePolicy, and for new Lambda layers or functions you did not deploy.
Then assume every secret the role could read is compromised. In the Qubole case, the attacker validated discovered credentials against Entra ID and Okta as well as AWS, so rotation has to follow the secret wherever it is used, not stop at your AWS account.
Step 6: Rotate, then revoke the sessions
This one is easy to get wrong. Rotating credentials does not end role sessions that were already issued. If a session was created before you rotated, it stays valid until it expires. For each affected role, use the IAM console's "Revoke active sessions" action, which attaches a policy denying credentials issued before that moment. Do this after you have removed or fixed the trust, otherwise the attacker simply assumes the role again.
Step 7: Close the door properly
Findings from the audit lead to a short list of fixes, in rough order of value:
- Add a source IP condition (
aws:SourceIporaws:SourceVpce) to the trust policy, limited to the vendor's published ranges. Ask vendors for their egress ranges; a vendor that cannot provide them is telling you something. - Trust a specific principal, not the account root. Trusting
:rootmeans any identity in the vendor account that has permission to call AssumeRole can use your role. - Remove integrations you no longer use. A trust policy that is still in place keeps working whether or not anyone is using the integration. In the Qubole case the policies were still there, so the requests succeeded.
- Cut the role's permissions to what the integration needs. The Qubole attacker could read secrets and whole buckets because the roles allowed it.
- Use a unique External ID per role, but do not treat it as a secret. It protects against the confused-deputy problem, where one customer tricks a vendor into acting on another customer's account. It does nothing against an attacker who already holds the vendor's credentials, and it appears in plaintext in CloudTrail.
- Alert on role assumption from new networks. This is the detection most likely to flag the very first call, rather than weeks later.
Apply this to us, too
SpikeCatcher asks customers to create a cross-account role as well, so everything above applies to us, and you should hold us to it. When the Qubole details came out we audited our own role against this list. The templates are public (for example install_single.yaml, install_org_all.yaml and member_account_role.yaml) so you can read exactly what you would be granting. How the role is built:
- Who can assume the role. It still requires a per-customer External ID, and now also accepts only SpikeCatcher's own application roles. An IAM user or any other identity in our account cannot assume it, even with the External ID. We tested that. This is a condition on role names, not on source IP, because our functions do not run from fixed addresses. It protects against a stolen user key in our account. It would not protect against the compromise of one of our application roles.
- What it can read. No S3 object reads (
s3:GetObject), no Secrets Manager secret values, no SSM parameter reads and no Lambda configuration reads. That holds for every template we publish, including the member-account role for AWS Organizations, which uses an explicit list of actions rather than a broad managed policy. Listing Lambda functions is optional and off by default, because AWS has no list permission that hides function environment variables. Turning it on enables arm64 and Compute Optimizer recommendations for Lambda. - It stays that way. Our tests parse every template and fail if a role regains any of those data-reading actions or loses the trust condition.
If you think the role should be tighter still, tell us.
On the detection side, SpikeCatcher's CloudTrail monitoring raises a medium-severity finding when an identity from an outside account assumes a role in your account, mapped to MITRE ATT&CK T1199 (Trusted Relationship). It does not judge the source IP, and if you allow-list a vendor to quiet the alert, it will stay quiet when that vendor's stolen credentials are used. The network condition in Step 7 is what closes that gap, so treat the alert as a second layer, not a substitute. 14-day free trial, 5-minute setup, read-only IAM.
Related articles
The access key nobody retired: how to find and kill stale AWS keys
A vendor key, never retired, found in their environment. Audit commands to find unused AWS access keys, check what they did, and retire them safely.
The first thing attackers do after stealing AWS credentials: switch off your alarms
Intruders often disable GuardDuty, stop AWS Config or delete logs first. The CloudTrail events to alert on, plus a copy-paste EventBridge rule.
Bought the wrong Savings Plan? You have a short window to return it
AWS lets you return a mistaken Savings Plan for a limited time. The exact rules, the calendar-month trap, and which plans cannot be returned.
Protect your AWS account — 14-day free trial
Real-time threat and cost anomaly detection. Detects credential theft, cryptomining, and runaway costs in under 15 minutes. 5-minute setup via CloudFormation.
No credit card. Cancel anytime.