Attack scenario · AWS identity & access

Cloud credential persistence

How do attackers keep access to AWS after a key is revoked? After initial access, the adversary creates additional keys, login profiles and roles so that rotating the original credential does not end the intrusion.

Fictional, educational scenarioPersistent accessLast updated · ATT&CK v20.1

Attack path · 4 stages

  1. 1

    Use the initial credential

    T1078.004

  2. 2

    Create spare credentials

    T1098.001

  3. 3

    Create a backdoor role

    T1136.003T1098.003

  4. 4

    Return after remediation

    T1078.004

For leadership

Executive summary

Rotating the leaked password or key feels like closing the door — but a capable adversary will already have created spare keys. If responders only revoke what they know about, the attacker returns days later. This scenario explains why incident response in AWS must enumerate every identity change made during the intrusion window and revoke active sessions, not just the original credential. Organizations that cannot quickly answer "what identities and credentials changed in the last 30 days, and by whom?" are exposed to repeat compromise. Declaring an incident closed too early is costly: customers and auditors are told the issue is resolved, and a second intrusion through the same backdoor is far harder to explain.

For engineers

Technical summary

With IAM write access the adversary adds access keys to other users (T1098.001), creates new IAM users or roles (T1136.003), attaches policies (T1098.003) or adds an external principal to a role trust policy. STS sessions already issued remain valid until expiry unless explicitly revoked.

Environment and assumptions

Fictional company: the security team detects a leaked key and deactivates it within an hour. During that hour, the adversary, using the key’s iam:* permissions, created a second access key for an unused service user, created a role trusting an external account, and attached an administrator policy to it.

  • The original credential had IAM write permissions.
  • Responders initially revoke only the leaked key.
  • Fictional and simplified for education.

Interactive

Attack sequence

Select a stage, or use the arrow keys, to see preconditions, evidence and controls.

Stage 1

Use the initial credential

The adversary authenticates with the leaked key.

Preconditions
  • Active credential
Required access
  • Leaked key.
Potential evidence
  • CloudTrail activity from the key on unfamiliar infrastructure
Defensive controls
  • Short-lived credentials
  • Anomaly alerting
Text version of the attack sequence
  1. Use the initial credential (T1078.004). The adversary authenticates with the leaked key. Preconditions: Active credential. Evidence: CloudTrail activity from the key on unfamiliar infrastructure. Controls: Short-lived credentials; Anomaly alerting.
  2. Create spare credentials (T1098.001). New access keys are created on dormant users that nobody monitors. Preconditions: iam:CreateAccessKey on other users. Evidence: CloudTrail: CreateAccessKey with requestParameters.userName different from the caller. Controls: SCP restricting key creation; Alert on CreateAccessKey.
  3. Create a backdoor role (T1136.003, T1098.003). A new role trusting an adversary-controlled account is created and given administrator permissions. Preconditions: iam:CreateRole and iam:AttachRolePolicy. Evidence: CloudTrail: CreateRole with an external principal in the trust policy; AttachRolePolicy AdministratorAccess. Controls: Permission boundaries required on role creation; Alert on roles trusting unknown accounts.
  4. Return after remediation (T1078.004). After the original key is disabled, the adversary uses the backdoor role or spare key to continue. Preconditions: Backdoors not discovered during response. Evidence: AssumeRole from the external account into the new role. Controls: Response runbook covering all identity changes in the intrusion window; Session revocation.

Technique mapping

MITRE ATT&CK and ATLAS techniques referenced in this scenario
IDTechniqueTactics (official)Stages
T1078.004Valid Accounts: Cloud AccountsInitial Access, Persistence, Privilege Escalation, Stealth1, 4
T1098.001Account Manipulation: Additional Cloud CredentialsPersistence, Privilege Escalation2
T1136.003Create Account: Cloud AccountPersistence3
T1098.003Account Manipulation: Additional Cloud RolesPersistence, Privilege Escalation3

Technique names and tactic assignments come from the imported MITRE data. Mapping a stage to a technique is Securitain’s analysis.

Why the attack can succeed

  • Incident response focused on the known credential rather than on all changes it made.
  • Dormant users and unmonitored role creation give the adversary quiet places to hide.
  • Active STS sessions continue after the source key is disabled.

What prevents or limits the attack

What may detect the attack

Detection signals and telemetry sources
SignalTelemetry sourceNotes
CreateAccessKey, CreateUser, CreateRole, CreateLoginProfileCloudTrail management events—
Trust policy granting an unknown external accountCloudTrail + IAM Access Analyzer external access findings—
Use of previously dormant users or keysCloudTrail; IAM last-used data—

Telemetry only helps if it is enabled before the incident and someone acts on it. Listing a signal here does not mean it is collected or monitored in your environment.

What Securitain may assess

  • Securitain can assess todayInventory of IAM users, roles, groups, policies, access-key configuration and trust relationships across connected AWS accounts. Learn more
  • Securitain can assess todayRisky trust relationship analysis, including roles trusted by external accounts and missing or unscoped ExternalId. Learn more
  • Securitain can assess todayPrivilege-escalation risk analysis for supported combinations such as iam:PassRole with Lambda, EC2, ECS or CloudFormation. Learn more
  • Outside Securitain’s current scopeReal-time detection of attacker activity in CloudTrail is not part of Securitain’s current assessment — use GuardDuty, a SIEM or your SOC for that.

For leadership

Executive implications

integrity
The adversary may retain administrative control even after the team believes the incident is closed.
operations
Repeat compromises extend incident duration and cost.
compliance
Incomplete eradication undermines incident reports and attestations.

No financial loss estimates are given; impact depends on the data, contracts and regulation involved.

Next steps

  1. During response, list all IAM changes in the intrusion window, not only the original credential’s.
  2. Revoke active role sessions (deny on aws:TokenIssueTime) for affected roles.
  3. Remove dormant IAM users and keys now, before an incident.

References

MITRE ATT&CK® and ATT&CK® are registered trademarks of The MITRE Corporation. ATT&CK data © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation (ATT&CK v20.1). Securitain is not affiliated with or endorsed by MITRE. Explanations, scenarios and control mappings on this page are Securitain’s own analysis. Sources and licensing

Stay in the loop

Cloud security insights, early access & compliance updates

Weekly InsightsEarly AccessExpert Content
No spam, everUnsubscribe anytimeWeekly updates
Chat with Securitain