AWS Builder Center

If Someone Compromises Your AWS Account, What Would You Check First?

Cloud security is not just about preventing attacks. It is also about knowing what to do when something goes wrong. Imagine receiving an alert about an unexpected login, an unfamiliar IAM user, or an unusual API call in your AWS account. What would you investigate first? When an AWS account is potentially compromised, visibility, containment, and investigation become critical.

AWS Student Captain | Cloud & AI Builder | Cybersecurity | Always Building, Always Learning
 
1. Review AWS CloudTrail Logs
AWS CloudTrail records account activity and API calls, helping investigators understand what actions occurred and which identities performed them.
Look for:
  • Unusual API calls or activity from unfamiliar locations.
  • Unexpected changes to security configurations.
  • Attempts to disable logging or modify audit settings.
  • Unrecognized resource creation or deletion.
CloudTrail provides valuable evidence for reconstructing a timeline of suspicious activity.

2. Investigate IAM Users, Roles, and Credentials

Compromised credentials can allow an attacker to access resources using legitimate permissions.
Check for:
  • Unknown IAM users or roles.
  • Unexpected access keys or credential changes.
  • New policies granting excessive permissions.
  • Unusual privilege escalation activity.
  • Unrecognized identity federation or role-assumption activity.
Reviewing IAM changes can help identify how unauthorized access may have been obtained or expanded.

3. Check for Unexpected AWS Resources

Attackers may create resources to run workloads, maintain access, or misuse cloud infrastructure.
Investigate:
  • Unexpected EC2 instances.
  • Unfamiliar Lambda functions.
  • Unrecognized S3 buckets or changes to bucket policies.
  • Unusual security group or network configuration changes.
  • Unexpected resource launches across AWS Regions.
Reviewing resource activity can help identify unauthorized changes and potential misuse of the account.

4. Examine Amazon GuardDuty Findings

Amazon GuardDuty continuously analyzes supported data sources for indicators of suspicious activity and potential threats.
Review findings related to:
  • Potentially compromised credentials.
  • Suspicious API activity.
  • Unusual network connections.
  • Possible malicious workloads.
  • Unexpected behavior involving AWS resources.
GuardDuty findings can help prioritize an investigation, but each finding should be assessed in context.

5. Investigate S3 Access and Data Exposure

Cloud account compromise can also create risks to stored data.
Review:
  • Unexpected changes to S3 bucket policies.
  • Changes to Block Public Access settings.
  • Unusual object downloads or deletions.
  • Unauthorized changes to encryption or access configurations.
  • Relevant CloudTrail S3 data events, if enabled.
Remember that object-level activity may not be visible in CloudTrail unless the appropriate data events have been configured.

6. Contain the Incident and Secure the Account

Investigation is important, but stopping ongoing unauthorized activity is equally critical.
Depending on the incident:
  • Follow your organization's incident response process.
  • Secure or revoke compromised credentials and access keys.
  • Restrict suspicious identities and unauthorized access paths.
  • Preserve relevant logs and evidence.
  • Review affected resources and restore secure configurations.
  • Rotate exposed secrets and investigate the original entry point.
Containment should be performed carefully to avoid disrupting legitimate services or destroying evidence.

7. Prevent the Same Incident From Happening Again

After containment and recovery, identify the root cause and strengthen security controls.
Important preventive measures include:
  • Enforcing least-privilege IAM permissions.
  • Enabling multi-factor authentication (MFA).
  • Using AWS CloudTrail for account activity visibility.
  • Configuring Amazon GuardDuty for threat detection.
  • Setting up alerts for important security events.
  • Protecting audit logs and reviewing security configurations regularly.

Final Thoughts

An AWS account compromise is not just a technical problem. It is an incident that requires a structured response, reliable evidence, and careful decision-making.
The first goal is to understand what happened, contain unauthorized access, and protect affected resources. The next is to identify the root cause and prevent a recurrence.
In cloud security, detecting an incident matters. Knowing where to look first can make all the difference.
What would you investigate first in a potentially compromised AWS account: CloudTrail logs, IAM permissions, or GuardDuty findings?
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article