Paco Hope #resist<p>Funny way to evade a lot of <a href="https://infosec.exchange/tags/AWS" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>AWS</span></a> <a href="https://infosec.exchange/tags/SAST" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>SAST</span></a> checkers that try to check your terraform or CDK or CloudFormation. They often look for open security groups (i.e., <code>0.0.0.0/0</code>). Sadly, most of these tools are looking for THAT string. They don't evaluate it as a CIDR. You might really want a rule that says "anything bigger than /16 is suspicious". But that's not how they work.</p><p>So a couple rules like <code>0.0.0.0/1</code> and <code>128.0.0.0/1</code> will pretty much get you the whole Internet, but probably slip right past most of the "open-to-the-internet" checkers. Likewise they will catch <code>::/0</code> but will not catch <code>::/1</code> or <code>1000::/1</code>.</p><p>One thing I did notice is that security groups normalize their CIDR ranges. So you could get a string like <code>8.8.8.8/0</code> through a static code analyzer (because it's not the string <code>0.0.0.0/0</code>) but EC2 will normalize that to <code>0.0.0.0/0</code> when it stores it. So if you do a dynamic check by asking for the security group's ingress rules, it will report back <code>0.0.0.0/0</code> even though you had sent <code>8.8.8.8/0</code> originally.</p><p>I can't wait to see how AI will handle this.</p>