Hunting AWS Identity Attack

Hunting AWS Identity Attacks

AWS Identity Attacks target misconfiguration and weaknesses in IAM (Identity and Access Management) settings. Common vectors include compromised access keys, leaked credentials, or abuse of over-permissive IAM policies. Attackers often exploit wildcard permissions (*) to gain unauthorized access to services or escalate privileges. Misconfiguration IAM roles and trust policies can allow external entities to assume sensitive roles via STS. Credential exposure through public GitHub repos is a frequent entry point for attackers. Session hijacking and abuse of temporary credentials can result in short-term but powerful access. Cloud Formation templates can be weaponized to inject backdoor IAM roles or policies. Attackers may use APIs to enumerate users, groups, and policies for further exploitation. Lack of MFA and stale IAM accounts increase the risk of identity compromise. Proper IAM hygiene, least-privilege principles, and CloudTrail monitoring are critical defenses. Identity-Related Attacks in AWS: Detection, Hunting Techniques & Recommendations.

In the era of cloud computing, identity-based attacks have become one of the most prevalent and critical threats to organizations. AWS cloud environments heavily rely on Identity and Access Management (IAM) to control access and permissions across services, making identity-based attacks a primary target for cyber adversaries. This blog explores different types of identity-related attacks in AWS, necessary log sources for detection, hunting techniques, and key recommendations to strengthen cloud security posture.

Types of Identity Attacks in AWS

Identity attacks in AWS typically revolve around unauthorized access, privilege escalation, or abuse of IAM roles. Below are the most common types of identity-related attacks:

AWS Identity Attacks

Attack TypeDescriptionPotential Impact
1. Credential CompromiseLeaked or phished IAM user credentials (access key & secret).Unauthorized access to AWS environment.
2. Over-permissive IAM PoliciesUse of wildcards (*) in IAM policies grants excessive privileges.Full control, lateral movement, escalation.
3. AssumeRole AbuseExploiting trust relationships to assume roles across accounts.Cross-account access, privilege escalation.
4. IAM Trust Policy MisconfigTrust policies allow unintended principals to assume roles.Unauthorized access across services/accounts.
5. Session Token HijackingTemporary credentials (from STS or SDKs) stolen and reused.Temporary but powerful unauthorized access.
6. MFA Not EnforcedUsers log in without Multi-Factor Authentication.Easy credential compromise via brute force/phishing.
7. Privilege Escalation via PolicyLow-privileged user escalates to admin via permission misuse (e.g., attaching policies).Admin-level access gained from a basic role.
8. IAM User EnumerationAttackers use error messages to discover usernames or roles.Precursor to targeted brute-force attacks.
9. Malicious IAM Role CreationAttacker creates roles with elevated privileges.Persistent access & post-exploitation control.
10. Stale IAM CredentialsOld unused keys remain active and unnoticed.Easy entry point for adversaries.
11. CloudFormation Policy InjectionMalicious template provisions over-permissive roles/policies.Persistent IAM backdoors during deployment.
12. IAM Policy Version ExploitationAbuse of older policy versions to revert security changes.Restoration of previous over-permissive access.
13. Abuse of EC2 Instance ProfileMisuse of instance metadata service to obtain IAM role credentials.Lateral movement via EC2 metadata access.
14. Attaching Policies to Other RolesPrivileged user attaches custom policies to escalate permissions.Expansion of access rights.
15. Use of Default IAM RolesDefault roles with excessive permissions are not removed or restricted.Unintended full access to services.
16. IAM Inline Policy AbuseInline policies are misused to grant hidden or temporary permissions.Hidden privilege escalation path.
17. Role ChainingChaining multiple role assumptions to evade detection.Complex, hard-to-trace lateral movement.
18. IAM Access Analyzer BypassDeliberately avoiding triggering IAM Access Analyzer findings.Stealthy persistence without detection.
19. API Gateway ImpersonationAPIs call backend services using elevated IAM roles.Backend compromise via trusted role misuse.
20. Shared Credential ExploitationCredentials reused across systems or shared within teams.Easy for adversaries to pivot once any account is compromised.

Hunting AWS Identity Attacks

#Attack NameMITRE Technique (Cloud)Log SourceAttribute for Hunting
1Compromised IAM User CredentialsT1078.004 – Valid Accounts: Cloud AccountsCloudTrail, IAM, CloudWatchConsoleLogin, SourceIPAddress, UserAgent, AccessKeyId
2Privilege Escalation via IAM PolicyT1484.001 – Domain Policy ModificationCloudTrailPutUserPolicy, AttachUserPolicy, PutRolePolicy
3Unauthorized AssumeRole UsageT1078.004 – Valid AccountsCloudTrail, STS LogsAssumeRole, RoleArn, SourceIdentity, UserIdentity.type
4Over-permissive Policy DeploymentT1484.001CloudTrailPutPolicy, CreatePolicy, PolicyDocument with *:*
5API EnumerationT1087.004 – Account DiscoveryCloudTrailListUsers, ListRoles, ListPolicies, GetAccountAuthorizationDetails
6Abuse of EC2 Instance RoleT1557.001 – Adversary-in-the-MiddleVPC Flow Logs, CloudTrail169.254.169.254, GetCallerIdentity, sts:AssumeRole
7Role Trust Policy TamperingT1556.001 – Modify Authentication ProcessCloudTrailUpdateAssumeRolePolicy, PutRolePolicy
8Creation of Backdoor IAM UserT1136.003 – Create AccountCloudTrailCreateUser, AttachUserPolicy, CreateAccessKey
9Use of Stale Access KeysT1078.004IAM Access Analyzer, CloudTrailAccessKeyAge, LastUsedDate, anomalies in AccessKeyId usage
10Lack of MFA for Privileged AccountsT1556.006 – Revert Cloud ConfigurationIAM, CloudTrail, ConfigConsoleLogin without MFAUsed=true, non-compliant accounts
11Chaining Role AssumptionsT1078.004STS Logs, CloudTrailMultiple AssumeRole in sequence, sourceIdentity correlation
12Session Token ReplayT1070.004 – Indicator Removal on HostCloudTrailReused sessionToken across geographies or IPs
13Inline Policy InjectionT1484.001CloudTrailPutUserPolicy, PutGroupPolicy with over-permissive actions
14Disabling CloudTrail or LoggingT1562.008 – Disable Cloud MonitoringCloudTrail, CloudWatch LogsStopLogging, DeleteTrail, PutMetricFilter
15Enumeration via SDK/API KeysT1087.004CloudTrailUnusual sequence of List* and Describe* API calls
16IAM Role Creation with Broad AccessT1136.003CloudTrailCreateRole + PutRolePolicy with * permissions
17Reuse of Shared Access KeysT1078.004CloudTrail, IAMSame AccessKeyId used from different IPs or regions
18IAM User without Activity AlertT1082 – System Information DiscoveryCloudTrail, ConfigNo activity in 90+ days, still active access keys
19Temporary Token AbuseT1078.004CloudTrail, STS LogsUse of session credentials for privilege escalation
20IAM Role Deletion After Backdoor SetupT1562.006 – Indicator RemovalCloudTrailDeleteRole, DetachRolePolicy right after role creation
21Unauthorized Console Login AttemptsT1078 – Valid AccountsCloudTraileventName = ConsoleLogin | errorMessage = Failed authentication | userIdentity.type = IAMUser
22Root Account UsageT1078 – Valid AccountsCloudTrailuserIdentity.type = Root| eventName = ConsoleLogin | MFA = False (No MFA Enabled)
23Creating New IAM UsersT1136 – Create AccountCloudTraileventName = CreateUser | userIdentity.arn | requestParameters.userName
24Access Key CreationT1528 – Steal Application Access TokenCloudTraileventName = CreateAccessKey | userIdentity.userName | accessKeyId
25API Calls from Unusual LocationsT1021 – Remote ServicesCloudTrail & VPC Flow LogssourceIPAddress (Unusual Locations) | userIdentity.arn | eventName = ConsoleLogin or API Calls
26S3 Bucket Policy ChangesT1196 – Modify Cloud Compute InfrastructureCloudTraileventName = PutBucketPolicy| requestParameters.bucketName | requestParameters.policy
27Modifying Security Group RulesT1196 – Modify Cloud Compute InfrastructureCloudTraileventName = AuthorizeSecurityGroupIngress | requestParameters.groupId | requestParameters.ipPermissions
28Deleting IAM RolesT1098 – Account ManipulationCloudTraileventName = DeleteRole | userIdentity.userName | requestParameters.roleName
29Detaching Policies from IAM RolesT1098 – Account ManipulationCloudTraileventName = DetachRolePolicy | requestParameters.policyArn | requestParameters.roleName
30Creating Temporary Access TokensT1528 – Steal Application Access TokenCloudTraileventName = GetSessionToken | requestParameters.durationSeconds | sourceIPAddress
31Unauthorized EC2 Key Pair CreationT1098 – Account ManipulationCloudTraileventName = CreateKeyPair | userIdentity.arn | keyName
32Lambda Function Permission ModificationT1196 – Modify Cloud Compute InfrastructureCloudTraileventName = AddPermission | requestParameters.functionName | requestParameters.principal
33CloudTrail Encryption Key DeletionT1485 – Data DestructionCloudTraileventName = ScheduleKeyDeletion | keyId | userIdentity.arn
34Access Denied API CallsT1078 – Valid AccountsCloudTrailerrorMessage = Access Denied | userIdentity.arn
35CloudWatch Alarm DisablingT1562.006 – Indicator BlockingCloudTraileventName = DisableAlarmActions
36Cross-Account Access GrantT1550.002 – Use Alternate Authentication MaterialCloudTraileventName = AssumeRole | requestParameters.roleArn

These entries provide a hunting-first approach where analysts can map detection efforts directly to MITRE

Recommendations to Mitigate Identity Attacks

  • Enforce Multi-Factor Authentication (MFA) for all users, especially root accounts.
  • Implement least privilege access policies by defining fine-grained permissions.
  • Enable AWS GuardDuty to automatically detect abnormal identity-based activities.
  • Regularly audit IAM policies and remove unused roles or permissions.
  • Enable CloudTrail Logging across all AWS regions and set up log integrity validation.
  • Configure CloudWatch Alarms for critical IAM events such as user creation or role assumption.
  • Use AWS Config rules to monitor security configurations and ensure compliance.

Conclusion

AWS Identity attacks pose a significant threat to AWS cloud environments. By leveraging native AWS logging capabilities, threat hunting techniques, and best practices, organizations can enhance their detection and response capabilities. Building a Zero Trust Identity Model combined with proactive log monitoring and continuous IAM audits will help mitigate risks and strengthen the overall cloud security posture.

Core Working Areas :- Threat Intelligence, Digital Forensics, Incident Response, Fraud Investigation, Web Application Security Technical Certifications :- Computer Hacking Forensics Investigator | Certified Ethical Hacker | Certified Cyber crime investigator | Certified Professional Hacker | Certified Professional Forensics Analyst | Redhat certified Engineer | Cisco Certified Network Associates | Certified Firewall Solutions | Certified Network Monitoring Solution | Certified Proxy Solutions

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image