Lockdown Lab #22 CRITICAL AWS

Remove 0.0.0.0/0 from security groups

Remove 0.0.0.0/0 from security groups

The Capital One breach in 2019? A misconfigured security group allowing SSRF to the metadata service. This isn’t theoretical; unrestricted inbound access is a primary attack vector.

Leaving 0.0.0.0/0 open on sensitive ports in your AWS security groups is the cloud equivalent of leaving your data center’s front door wide open. Automated scanners are constantly probing AWS IP ranges, looking for exactly these kinds of misconfigurations.

Your default posture should always be least privilege. For any inbound rule, be specific with your source IPs. If you need external access, use a VPN or a dedicated jump box with tighter controls, or at least restrict to known, required IP ranges.

To fix this, go into your AWS Security Groups, locate rules with Source: 0.0.0.0/0, and edit them to specific IP ranges or remove them if no longer needed.

Don’t be the next headline. Close those doors.

The fix

# Find SGs with 0.0.0.0/0 inbound\naws ec2 describe-security-groups --query \\\n  'SecurityGroups[?IpPermissions[?IpRanges[?CidrIp==`0.0.0.0/0`]]].[GroupId,GroupName]' \\\n  --output table\n

Reference: CIS AWS Foundations Benchmark 5.2

Mark this as done

Open the interactive hardening checklist and tick this off in your environment.

Open interactive checklist →

Related Posts

Enforce least privilege IAM policies

You know what gets me? Seeing environments where a single compromised credential can bring down a whole AWS account. Nine times out of ten, it’s...

lockdown-labhardeningawsidentity
/Shimi Cohen

Enforce MFA for IAM users

A compromised AWS console is a full-blown incident. You're looking at data exfiltration, service disruption, and massive reputational damage. And it almost always starts with...

lockdown-labhardeningawsidentity
/Shimi Cohen

Eliminate root access keys

I've seen environments where a single compromised root access key brought an entire AWS account to its knees. That's not a drill. That's game over...

lockdown-labhardeningawsidentity
/Shimi Cohen