Top 10 AWS Security Misconfigurations Hackers Exploit (and How to Fix Them)
AWS security misconfigurations are the settings, permissions and defaults that leave a cloud account open to attackers even though AWS itself is working as designed. In practice, attackers rarely break AWS; they find a leaked access key, an over-powered role, a public bucket, an open database port or a server that hands out credentials to anyone who can trick it. This guide ranks the ten misconfigurations that show up most in real incidents and research, explains how each one gets abused at a defensive level, and gives you the detection checks, policy snippets and guardrails to close them, plus an audit script you can adapt to your own exports.
- Why Misconfigurations Beat Exploits in the Cloud
- How Attackers Chain Small Mistakes
- Identity and Credentials: Misconfigurations 1 to 4
- Data Exposure: Misconfigurations 5 and 6
- Compute and Network: Misconfigurations 7 and 8
- Visibility and Secrets: Misconfigurations 9 and 10
- Finding Them With Code
- Guardrails That Prevent Repeats
- If a Key Leaks: First-Hour Response
- Prioritization and a 90-Day Roadmap
- Frequently Asked Questions
AWS operates on a shared responsibility model. AWS secures the cloud itself: data centers, hardware, the hypervisor and the managed-service internals. You secure what you put in it: identities, permissions, network rules, data protection, patching of your own workloads and the configuration of every service you turn on. Almost every public AWS breach story is a failure on the customer side of that line.
Hypervisor and core network
Managed-service infrastructure
Global regions and availability zones
Bucket, database and snapshot exposure
Security groups and network paths
Patching of guest OS and applications
Logging, monitoring and response
Attackers prefer configuration weaknesses because they are quiet. A stolen key used through the normal API looks like a legitimate administrator at work, so it bypasses malware defenses and often lands without a single exploit. The same pattern appears in identity-centric attacks covered in Insider Threat Detection.
One misconfiguration is rarely the whole story. Real incidents chain several, each opening the next door. Defending the chain at any link stops the attack.
Identity is the new perimeter in AWS, so four of the ten problems live here. Each card gives the risk, how it is abused, how to detect it, and the fix.
The problem: IAM users with static access keys that never rotate, keys pasted into code or config files, and keys nobody uses but nobody deletes. Datadog's 2025 data found 59% of IAM users had an active key older than a year, and over half of those had not used it in more than 90 days.
How it gets abused: Keys leak through public repositories, build logs, laptops and old backups. Halcyon reported the Codefinger ransomware gang using exposed or compromised AWS keys with read and write rights on S3 to encrypt victims' objects with a key the attacker controlled and set deletion timers, as covered by The Register. No AWS vulnerability was needed, only the key.
Detect: The IAM credential report lists key age and last use; flag keys older than 90 days or unused. Turn on secret scanning in your code hosting platform and watch for GuardDuty findings about credential use from unusual locations.
Fix: Replace static keys with IAM roles and short-lived credentials (STS, IAM Identity Center, instance and workload roles). Where a key is unavoidable, rotate it regularly, scope it narrowly and restrict by source IP or VPC. Delete unused keys.
The problem: Policies with "Action": "*" on "Resource": "*", AdministratorAccess attached to workloads or developers, and powerful permissions such as iam:PassRole, iam:CreateAccessKey or iam:AttachUserPolicy granted broadly.
How it gets abused: Once any identity is compromised, broad permissions let the attacker read every bucket, create new admin users, or modify logging. Certain IAM permissions allow privilege escalation by themselves, so a "limited" role can quietly become an admin.
Detect: Run IAM Access Analyzer for unused access and external access findings, review policies for wildcards, and list roles with administrator policies.
Fix: Start from zero and add only what the workload needs; use Access Analyzer to generate policies from CloudTrail activity. Add permission boundaries and service control policies so even a mistake cannot exceed a ceiling. Require separate roles for humans and workloads.
The problem: The root user has no MFA or has access keys, human users sign in with only a password, or the root account is used for daily work.
How it gets abused: Phished or reused passwords become full account access. Root can do things no IAM policy can restrict, such as closing the account or changing the billing contact.
Detect: The credential report shows MFA status and root key presence; alert on any root sign-in or API call.
Fix: Enable a hardware or passkey MFA on root, delete root access keys, lock the credentials away, and use IAM Identity Center with phishing-resistant MFA for humans. Add an alert for root activity.
The problem: Roles that trust a whole account instead of a specific role, third-party access roles without an external ID, and OIDC trust for CI/CD systems such as GitHub Actions with wildcard conditions that let any repository assume the role.
How it gets abused: Anyone who controls the trusted principal, or a repository in the same provider, can assume the role. A vendor's compromise can become your compromise.
Detect: IAM Access Analyzer flags roles that external principals can assume. Review every trust policy for wildcards and missing conditions.
Fix: Trust specific roles, require an external ID for third parties, and pin OIDC trusts to the exact repository and branch:
{
"Effect": "Allow",
"Principal": {"Federated": "arn:aws:iam::ACCOUNT_ID:oidc-provider/token.actions.githubusercontent.com"},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com",
"token.actions.githubusercontent.com:sub": "repo:YOUR_ORG/YOUR_REPO:ref:refs/heads/main"
}
}
}
Pair this with vendor risk reviews from Third-Party Risk Management.
The problem: Buckets readable or writable by anyone through ACLs or bucket policies, no account-wide Block Public Access, and buckets with no versioning or object lock. AWS has applied Block Public Access and disabled ACLs by default on new buckets since April 2023, but older buckets and explicit overrides remain.
How it gets abused: Attackers scan for open buckets and download customer data, backups and credentials stored inside. With stolen write access, they can overwrite or encrypt objects; the Codefinger case used S3's server-side encryption with customer-provided keys (SSE-C) so the victim could not decrypt the data.
Detect: Use S3 Block Public Access settings reports, IAM Access Analyzer for S3 and AWS Config rules for public read or write.
Fix: Turn on Block Public Access for the whole account, serve public content through CloudFront with origin access control, enable versioning and Object Lock on critical buckets, and deny SSE-C where you do not use it:
aws s3control put-public-access-block --account-id ACCOUNT_ID \
--public-access-block-configuration \
BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true
# Bucket policy statement: deny uploads that use customer-provided encryption keys (SSE-C)
{
"Effect": "Deny",
"Principal": "*",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::YOUR_BUCKET/*",
"Condition": {"Null": {"s3:x-amz-server-side-encryption-customer-algorithm": "false"}}
}
The problem: RDS or OpenSearch instances with public endpoints, EBS and RDS snapshots shared publicly, public AMIs containing credentials, and databases reachable from the internet through permissive security groups.
How it gets abused: Internet scanners find open database ports within minutes. Public snapshots can be copied and mounted by anyone, exposing entire disks including secrets.
Detect: Check the publicly-accessible flag on every database, list public snapshots and AMIs, and use Config rules and Security Hub checks.
Fix: Place databases in private subnets, disable public accessibility, share snapshots only with named accounts, enable snapshot sharing block settings, encrypt with customer-managed KMS keys, and require TLS.
The problem: The instance metadata service hands role credentials to code running on the instance. Version 1 answers simple requests, so a server-side request forgery bug or open proxy in an application can trick the instance into returning those credentials. IMDSv2 requires a session token and blocks that simple pattern. Datadog found only 49% of EC2 instances enforced IMDSv2 in 2025, although 82% had used only IMDSv2 in the previous two weeks and could likely enforce it without breaking anything.
How it gets abused: A web application flaw becomes a cloud credential theft, as in the Capital One chain. The stolen role's power then decides the damage, which ties back to misconfiguration 2.
Detect: Review instance metadata options and the CloudWatch metric that counts IMDSv1 calls, and run Config or Security Hub checks for IMDSv2.
Fix: Require tokens on every instance, set the hop limit to 1 for non-container hosts, make IMDSv2 the account default for new launches (AWS announced an account-level default in March 2024, and Amazon Linux 2023 uses IMDSv2 by default), and block launches that allow v1 with a service control policy:
aws ec2 modify-instance-metadata-options --instance-id INSTANCE_ID \
--http-tokens required --http-put-response-hop-limit 1 --http-endpoint enabled
# SCP statement: deny launching instances that allow IMDSv1
{
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {"StringNotEquals": {"ec2:MetadataHttpTokens": "required"}}
}
Works through simple request-forgery bugs
No session, no extra header needed
Risk: high
The token must be sent on later requests
Hop limit stops forwarding off the instance
Risk: much lower
The problem: Rules that allow 0.0.0.0/0 on SSH (22), RDP (3389), databases (3306, 5432, 1433, 6379, 27017) or admin consoles, plus default security groups left in use.
How it gets abused: Internet-wide scanning finds exposed services quickly, then brute force, stolen credentials or unpatched vulnerabilities do the rest. Exposed management ports are also a common route to crypto-mining and ransomware.
Detect: List security groups with world-open ingress to sensitive ports; use VPC Reachability Analyzer and Config rules.
Fix: Remove direct administrative access and use AWS Systems Manager Session Manager or a VPN; restrict sources to known ranges or other security groups; keep data stores in private subnets; and use AWS Firewall Manager to apply baseline rules across accounts.
The problem: CloudTrail not enabled in every region, no organization-wide trail, log file validation off, no S3 data events on sensitive buckets, VPC Flow Logs and DNS logs missing, GuardDuty and Security Hub disabled, and logs stored in the same account an attacker can reach.
How it gets abused: Attackers work in unused regions where nobody is looking, delete or stop trails, and operate for weeks. Without logs you cannot answer what was accessed.
Detect: Check that an organization trail is multi-region, validated and delivering to a protected account, and that GuardDuty is enabled everywhere.
Fix: Create an organization trail, send logs to a dedicated log-archive account with Object Lock, enable GuardDuty, Security Hub and Config in all regions, and alert on high-risk events such as trail changes, root use and new access keys. Route findings into your SOC.
The problem: Passwords and keys in source code, Terraform state, EC2 user data, Lambda environment variables, container images, CI logs and shared AMIs.
How it gets abused: User data and environment variables are readable by anyone with describe permissions or access to the metadata service. Leaked repositories and artifacts hand attackers working credentials without any scanning of AWS itself.
Detect: Run secret scanners in code repositories and build pipelines, scan images and state files, and review user data for sensitive strings.
Fix: Store secrets in AWS Secrets Manager or Systems Manager Parameter Store, grant access by role, rotate them automatically, encrypt Terraform state with restricted access, and fail the build when a secret is committed.
You can check most of the Top 10 from read-only exports: the IAM credential report, security group descriptions, bucket public-access settings, instance metadata options, database flags and CloudTrail trail settings. The script below shows the logic on synthetic data, rating each finding and summarizing the result. In production, prefer managed services such as AWS Config, Security Hub, IAM Access Analyzer and Prowler-style scanners, and use a script like this for custom checks or reporting. The output is the real output of the code.
# aws_misconfig_audit.py: flag common AWS misconfigurations in exported account data. # Works on JSON/CSV you export with read-only commands (iam get-credential-report, ec2 describe-*, # s3api get-public-access-block, cloudtrail describe-trails). Data below is synthetic. from datetime import date TODAY = date(2026, 11, 1) SENSITIVE_PORTS = {22: "SSH", 3389: "RDP", 3306: "MySQL", 5432: "PostgreSQL", 1433: "SQL Server", 6379: "Redis", 27017: "MongoDB"} DATA = { "iam_users": [ # name, mfa, key_created, key_last_used (None = never) ("root", False, None, None), ("alice", True, date(2026, 8, 3), date(2026, 10, 30)), ("ci-deployer", False, date(2023, 2, 9), date(2025, 12, 1)), ("legacy-app", False, date(2022, 6, 1), None), ], "security_groups": [ # id, port, cidr ("sg-0a1", 22, "0.0.0.0/0"), ("sg-0b2", 443, "0.0.0.0/0"), ("sg-0c3", 5432, "0.0.0.0/0"), ("sg-0d4", 3389, "10.0.0.0/16"), ], "buckets": [ # name, block_public_access, versioning ("prod-customer-exports", False, False), ("app-logs", True, True), ("marketing-assets", False, True), ], "instances": [ # id, imds_tokens ("required" = IMDSv2 only), has_admin_role ("i-01", "optional", True), ("i-02", "required", False), ("i-03", "optional", False), ], "rds": [("orders-db", True), ("reports-db", False)], # name, publicly_accessible "cloudtrail": {"multi_region": False, "log_validation": False, "s3_data_events": False}, "policies": [("DevAccess", [("*", "*")]), ("ReadOnlyApp", [("s3:GetObject", "arn:aws:s3:::app-data/*")])], } findings = [] def add(sev, item, msg): findings.append((sev, item, msg)) for name, mfa, created, used in DATA["iam_users"]: if name == "root": add("CRITICAL", "root", "root account has no MFA" if not mfa else "root MFA on") continue if not mfa: add("HIGH", name, "IAM user without MFA") if created: age = (TODAY - created).days if age > 90: add("HIGH" if age > 365 else "MEDIUM", name, f"access key is {age} days old (rotate or replace with roles)") if used is None: add("MEDIUM", name, "access key never used (delete it)") for sg, port, cidr in DATA["security_groups"]: if cidr == "0.0.0.0/0" and port in SENSITIVE_PORTS: add("CRITICAL" if port != 22 else "HIGH", sg, f"{SENSITIVE_PORTS[port]} ({port}) open to the internet") for b, bpa, ver in DATA["buckets"]: if not bpa: add("HIGH", b, "S3 Block Public Access is off") if not ver: add("MEDIUM", b, "versioning off (no recovery from overwrite or SSE-C style ransomware)") for iid, tokens, admin in DATA["instances"]: if tokens != "required": add("HIGH" if admin else "MEDIUM", iid, "IMDSv1 still allowed" + (" and the role is admin" if admin else "")) for db, public in DATA["rds"]: if public: add("CRITICAL", db, "database is publicly accessible") ct = DATA["cloudtrail"] if not ct["multi_region"]: add("HIGH", "cloudtrail", "trail is not multi-region") if not ct["log_validation"]: add("MEDIUM", "cloudtrail", "log file validation off") for name, stmts in DATA["policies"]: if any(a == "*" and r == "*" for a, r in stmts): add("CRITICAL", name, "policy allows Action * on Resource * (full admin)") order = {"CRITICAL": 0, "HIGH": 1, "MEDIUM": 2} findings.sort(key=lambda f: order[f[0]]) for sev, item, msg in findings: print(f"{sev:9} {item:24} {msg}") print("\nSummary:", ", ".join(f"{s} {sum(1 for f in findings if f[0] == s)}" for s in order))
Output:
CRITICAL root root account has no MFA CRITICAL sg-0c3 PostgreSQL (5432) open to the internet CRITICAL orders-db database is publicly accessible CRITICAL DevAccess policy allows Action * on Resource * (full admin) HIGH ci-deployer IAM user without MFA HIGH ci-deployer access key is 1361 days old (rotate or replace with roles) HIGH legacy-app IAM user without MFA HIGH legacy-app access key is 1614 days old (rotate or replace with roles) HIGH sg-0a1 SSH (22) open to the internet HIGH prod-customer-exports S3 Block Public Access is off HIGH marketing-assets S3 Block Public Access is off HIGH i-01 IMDSv1 still allowed and the role is admin HIGH cloudtrail trail is not multi-region MEDIUM legacy-app access key never used (delete it) MEDIUM prod-customer-exports versioning off (no recovery from overwrite or SSE-C style ransomware) MEDIUM i-03 IMDSv1 still allowed MEDIUM cloudtrail log file validation off Summary: CRITICAL 4, HIGH 9, MEDIUM 4
Notice how the findings cluster: the same legacy user shows up three times (no MFA, an ancient key, and a key that was never used), and one admin instance combines IMDSv1 with a full-admin role. That clustering is how real compromises happen, and it is why you fix identity first.
Fixing findings one by one never ends. Guardrails make the safe configuration the default so the mistakes cannot be made again.
| Guardrail | Prevents | Example |
|---|---|---|
| Service control policies | Dangerous actions across all accounts | Deny disabling CloudTrail or GuardDuty; deny launching IMDSv1 instances; deny leaving the organization |
| Infrastructure as code scanning | Misconfigurations before deployment | Fail pull requests that add a world-open security group or a public bucket |
| AWS Config and Security Hub | Drift and missed settings | Continuous checks for the Top 10 with automatic remediation for low-risk fixes |
| IAM Access Analyzer | Unintended external and unused access | Weekly review of external-access and unused-permission findings |
| Tagging and ownership | Orphaned, unmanaged resources | Every resource and account has an owner and an environment tag |
| Break-glass and approval flows | Standing admin access | Time-limited admin through Identity Center with approvals and logging |
Track coverage and fix times with the KPIs in Cybersecurity Metrics: KPIs Every CISO Should Track, such as time to fix critical findings and coverage of critical assets.
Assume it will happen. AWS may notify you when it detects exposed keys, and can apply quarantine policies, but you must act without waiting.
aws iam update-access-key --user-name USER_NAME --access-key-id ACCESS_KEY_ID --status Inactive aws cloudtrail lookup-events \ --lookup-attributes AttributeKey=AccessKeyId,AttributeValue=ACCESS_KEY_ID \ --max-results 50
Restrict who can create keys, then follow AWS guidance on responding to a suspected account compromise. If the key had broad rights, treat the whole account as exposed: review IAM changes, check every region, and rotate secrets reachable by the identity.
You cannot fix everything at once. Order the work by how much each item reduces the chance and the damage of a compromise.