Skip to main content
Dark green background, "Weak Application Security Can Cost You Millions," 3 slanted images of fingers pointing to digital locks, and a "Learn the Basics" button
Dormant SaaS Roles: Hunt and Revoke Before Attackers DoSoftware Supply Chain Security
5 min readFor Supply Chain Risk Managers

Dormant SaaS Roles: Hunt and Revoke Before Attackers Do

Cross-account IAM roles are a common way SaaS platforms access your AWS environment, but they're easy to overlook. A recent attack on Qubole customers highlights the risks. Attackers used compromised credentials from Qubole's AWS account to assume roles that customers had set up during onboarding, accessing data from over a dozen organizations. Researchers at Sentra noted that these roles remained active long after companies stopped using Qubole, allowing attackers to read nearly all the data they wanted.

The roles remained inactive until October 14, with activity continuing until October 26. Attackers used a rented OVH server and Mullvad VPN, not Qubole's network. Wiz described the attackers as opportunistic, downloading whatever data each role could access, sometimes entire buckets in one go. The breach wasn't due to your vendor's perimeter but because your account still trusted it.

This guide shows you how to identify these roles, determine if they're active, and remove them.

What You Need Before Starting

  • Read access to IAM and CloudTrail across all accounts (an AWS Organizations management or delegated admin role is suitable).
  • CloudTrail logs retained long enough to show historical AssumeRole activity. If you only keep 90 days, note this in your findings.
  • An authoritative list of active vendor integrations from procurement and your Vendor Intake records. Expect discrepancies between this list and what IAM shows.
  • A named owner for each vendor relationship to confirm ongoing use.
  • Change approval for IAM modifications, ideally pre-agreed for the disable step.

Step-by-Step Implementation

1. Inventory Every Role That Trusts an External Account

Identify every role whose trust policy names a principal outside your organization. For each account, use:

aws iam list-roles --query 'Roles[].[RoleName,Arn]' --output text
aws iam get-role --role-name <name> --query 'Role.AssumeRolePolicyDocument'

For larger scales, use IAM Access Analyzer with your organization as the zone of trust. Export the findings and record, for each role: external account ID, whether an sts:ExternalId condition exists, attached policies, and creation date.

Map each external account ID to a vendor. Unmapped IDs should be prioritized for review.

2. Find Roles That Haven't Been Used

IAM tracks last-used data per role:

aws iam get-role --role-name <name> --query 'Role.RoleLastUsed'

Roles that have never been used, or haven't been used within your chosen threshold, should be considered for decommissioning. Set this threshold based on Criticality Classification. A starting point is 90 days for roles tied to non-critical tools, longer for seasonal workloads. Document the threshold to support your decision.

For deeper history, query CloudTrail for AssumeRole events where userIdentity.accountId matches the vendor account:

SELECT eventTime, userIdentity.arn, requestParameters
FROM cloudtrail_logs
WHERE eventName = 'AssumeRole'
AND userIdentity.accountId = '<vendor-account-id>'
ORDER BY eventTime DESC

3. Reconcile Against Contracts and Owners

Compare your role inventory to the active vendor list. Categorize each external role into one of three groups:

  1. Active and owned. Business owner confirms use.
  2. Active, no owner. Escalate; someone is using access nobody claims.
  3. Dormant or orphaned. The vendor relationship ended, or the role was never used.

Bucket 3 is where the Qubole-style exposure occurs. Also, check termination checklists. Ensure Access Revocation is a named deliverable in Termination Rights and Wind-Down Plan language.

4. Reduce Blast Radius on Roles You Keep

For active roles, tighten security:

  • Require sts:ExternalId in the trust policy condition, unique per vendor relationship.
  • Limit permissions to specific buckets and prefixes. A role that reads nearly all your data is a design flaw.
  • Set a short MaxSessionDuration.
  • Add condition keys where possible, such as source IP ranges for the vendor's published egress.
  • Review attached policies for wildcards on s3:GetObject and secretsmanager:GetSecretValue.

5. Disable First, Delete Later

Don't delete dormant roles immediately. Attach an explicit deny policy or remove the trust relationship, then wait for a defined observation window (two to four weeks is typical). If nothing breaks and no owner objects, delete the role and archive its configuration. This approach provides a rollback and an audit trail.

6. Check for Customer-Owned Access Keys

Wiz also identified a campaign where customer-owned AWS access keys tied to Qubole integrations were tested against victim environments. Run the credential report and look for long-lived keys created for vendors:

aws iam generate-credential-report
aws iam get-credential-report

Rotate or remove any vendor-associated keys with no confirmed owner. Prefer roles with External ID over static keys wherever supported.

Validation: Verify It Works

  • Re-run the Access Analyzer scan. Disabled roles should no longer appear as active external access, and no unmapped external account IDs should remain.
  • Test the deny. From a sandbox principal in the vendor-trusted position, or via the IAM policy simulator, confirm that sts:AssumeRole fails for disabled roles.
  • Alert on the pattern. Build a detection for AssumeRole calls against any vendor role flagged dormant. Also alert on role session names that look machine-generated or unusual; in this campaign, session names followed a consistent quiam- prefix pattern. Any AssumeRole followed by rapid ListBuckets, ListSecrets, or bulk GetObject calls from an unfamiliar source IP deserves immediate incident escalation.
  • Spot-check S3 data events. Confirm data event logging is enabled on sensitive buckets, since management events alone won't show object reads.

Maintenance: Keep It From Drifting

  • Tie decommissioning to contract events. Add Access Revocation to your Wind-Down Plan template and Vendor Intake, so every integration is born with an expiry owner and an exit step.
  • Quarterly review. Re-run the inventory, last-used checks, and owner reconciliation. Treat new unmapped external accounts as findings.
  • Ingest vendor threat intelligence. When a SaaS provider you integrate with discloses a credential compromise, query CloudTrail for that vendor's account ID immediately, going back to at least the earliest reported activity. Continuous monitoring of active arrangements should include vendor breach notices as a trigger, not just periodic reviews.
  • Contract for it. Include notification obligations and a defined notification timeline in agreements, and align reviews with ISO 27036 supplier relationship controls and SR 23-4 expectations on termination and ongoing oversight.

A role you forgot is a role an attacker can use. Make removal as routine as provisioning.

Promotional banner highlighting failures found in PCI audits and how to spot the gaps

You Might Also Like