<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maksim Bolgarin</title>
    <description>The latest articles on DEV Community by Maksim Bolgarin (@maxbolgarin).</description>
    <link>https://dev.to/maxbolgarin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1501390%2Faea026d4-9826-4469-85eb-876a24b5fe86.jpeg</url>
      <title>DEV Community: Maksim Bolgarin</title>
      <link>https://dev.to/maxbolgarin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maxbolgarin"/>
    <language>en</language>
    <item>
      <title>Why You Can't Get a Full AWS Resource Inventory from the Console</title>
      <dc:creator>Maksim Bolgarin</dc:creator>
      <pubDate>Tue, 31 Mar 2026 10:30:55 +0000</pubDate>
      <link>https://dev.to/maxbolgarin/why-you-cant-get-a-full-aws-resource-inventory-from-the-console-2k9b</link>
      <guid>https://dev.to/maxbolgarin/why-you-cant-get-a-full-aws-resource-inventory-from-the-console-2k9b</guid>
      <description>&lt;p&gt;AWS has no single screen that shows everything in your account. Here's why building a complete resource inventory is harder than it should be, and what actually works.&lt;/p&gt;

&lt;p&gt;There's a question that sounds simple until you actually try to answer it: what's running in my AWS account right now?&lt;/p&gt;

&lt;p&gt;You'd think AWS would have a page for this. One screen, all your resources, every region. It doesn't. And the workarounds range from "almost good enough" to "I'll write a script and regret it later."&lt;/p&gt;

&lt;p&gt;I've spent a lot of time on this problem, both managing AWS accounts professionally and building a tool that does inventory discovery automatically. The short version: it's genuinely harder than it should be.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Console Wants You to Already Know What You're Looking For
&lt;/h2&gt;

&lt;p&gt;Open the AWS Console. You get a search bar and a list of services. That's it.&lt;/p&gt;

&lt;p&gt;Want to see your EC2 instances? Go to the EC2 page. Your RDS databases? Different page. S3 buckets? Different page again. Lambda functions, IAM roles, EBS volumes, security groups, load balancers, KMS keys — each one lives in its own section of the console with its own layout, its own filters, and its own quirks.&lt;/p&gt;

&lt;p&gt;There are over 200 AWS services. Even if you only use 10 or 15 of them, checking each one manually means opening a dozen tabs and clicking through region selectors. And here's the part that gets people: most of these pages only show resources in one region at a time. If you're looking at EC2 instances in eu-west-1, you won't see the instance someone spun up in us-east-1 three months ago for a quick test and forgot about.&lt;/p&gt;

&lt;p&gt;This is fine when you know exactly what you're looking for. It falls apart when the question is "what do we have?"&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-Region Is Where It Gets Painful
&lt;/h2&gt;

&lt;p&gt;AWS operates in 30+ regions. Most teams use two or three. But resources end up in unexpected places all the time.&lt;/p&gt;

&lt;p&gt;Someone creates a CloudFormation stack in us-east-1 because that's the default. A developer launches a test instance in ap-southeast-1 to check latency from Singapore. An old deployment left behind snapshots in eu-central-1 that nobody remembers creating.&lt;/p&gt;

&lt;p&gt;The AWS Console doesn't help here. There's no "show me resources across all regions" toggle on most service pages. You have to manually switch regions in the top-right dropdown and check each one. For a single service. Then repeat for the next service.&lt;/p&gt;

&lt;p&gt;If you're responsible for security or compliance — especially GDPR, where data residency matters — this is a real problem. Resources in the wrong region aren't just clutter. They can be a compliance violation you don't know about until an auditor asks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tools AWS Gives You (And Why They're Not Enough)
&lt;/h2&gt;

&lt;p&gt;AWS isn't completely unaware of this problem. There are a few built-in options.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Resource Explorer&lt;/strong&gt; is the closest thing to a unified inventory. You enable it, it indexes your resources across regions, and you can search them in one place. It's better than clicking through service pages manually. But it doesn't cover every resource type, it doesn't show cost data, and the search interface works best when you already know what you're looking for. It's a search engine, not an inventory report. If you want to browse everything and understand the full picture, it's not quite there.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Tag Editor&lt;/strong&gt; lets you find resources across regions, but only if they're tagged. If your team has inconsistent tagging (and most teams do), you'll get a partial view at best. Untagged resources are invisible here, which is a problem because untagged resources are usually the ones you need to find the most — they're the forgotten ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Config&lt;/strong&gt; is the most thorough option — it records resource configurations and tracks changes over time. The catch: it's a compliance and audit tool, not something you'd use as a daily inventory dashboard. Setting it up across all regions takes real effort, it bills per recorded configuration item, and the output is dense enough that you'll probably need another tool to make sense of it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Cost Explorer&lt;/strong&gt; shows you what's costing money, which is useful, but it groups costs by service and region, not by individual resource. You can see that EBS is costing you $340/month in eu-west-1, but you can't easily see which specific volumes are responsible.&lt;/p&gt;

&lt;p&gt;You can cobble these together and get a partial answer. But none of them give you a single view that says: here's every resource in your account, across every region, with its cost, its security posture, and whether anyone is actually using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The CLI Approach Works but Doesn't Scale
&lt;/h2&gt;

&lt;p&gt;The most common DIY solution is writing AWS CLI scripts. Something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;region &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;aws ec2 describe-regions &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s1"&gt;'Regions[].RegionName'&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; text&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"=== &lt;/span&gt;&lt;span class="nv"&gt;$region&lt;/span&gt;&lt;span class="s2"&gt; ==="&lt;/span&gt;
  aws ec2 describe-instances &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="nv"&gt;$region&lt;/span&gt; &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s1"&gt;'Reservations[].Instances[].[InstanceId,State.Name,InstanceType]'&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; table
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works for one service. Now multiply it by every service you use. EC2 instances, EBS volumes, RDS databases, S3 buckets, Lambda functions, IAM users, security groups, snapshots, Elastic IPs, NAT Gateways, load balancers, KMS keys, CloudWatch log groups...&lt;/p&gt;

&lt;p&gt;Each service has its own API call, its own response format, its own pagination logic. Some resources are global (like IAM and S3 buckets), some are regional. The script grows, the edge cases pile up, and eventually you're maintaining a mini infrastructure scanner that you never intended to build.&lt;/p&gt;

&lt;p&gt;I've seen teams keep these scripts around for years. They break when AWS adds new regions or changes API responses. Nobody wants to maintain them. And they still don't give you cost estimates or security analysis — just a list of resource IDs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Actually Need
&lt;/h2&gt;

&lt;p&gt;When I talk to engineers about this, the thing they want is simple: one view, everything in the account, across all regions, with enough context to make decisions.&lt;/p&gt;

&lt;p&gt;That means seeing every resource with its type, region, state, tags, and estimated monthly cost. It means knowing which resources are orphaned (not attached to anything), which ones have security issues, and which ones are in regions they shouldn't be in.&lt;/p&gt;

&lt;p&gt;The AWS Console was built for operating individual services, not for answering "what's in my account." The tools AWS provides are useful for specific tasks — searching, auditing, cost analysis — but they don't combine into a single inventory view without significant effort.&lt;/p&gt;

&lt;p&gt;This is why I built &lt;a href="https://scanorbit.cloud" rel="noopener noreferrer"&gt;ScanOrbit&lt;/a&gt;. It connects through a read-only IAM role, scans all regions in one pass, and gives you a full inventory with cost estimates, security findings, and compliance checks. No agents, no scripts to babysit, no clicking through region dropdowns for an hour.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://scanorbit.cloud" rel="noopener noreferrer"&gt;free scan&lt;/a&gt; shows you how many resources and findings you have, so you can see the scope of the problem before committing to anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start With the Manual Check
&lt;/h2&gt;

&lt;p&gt;Even if you don't use any tooling, there's a quick sanity check worth doing right now.&lt;/p&gt;

&lt;p&gt;Go to the AWS Console, open Resource Explorer (if it's enabled), and search for &lt;code&gt;*&lt;/code&gt; in each region. Look for resources in regions you didn't expect. Then check EC2 → Volumes and filter by "Available" status — those are unattached volumes costing you money right now. Check Elastic IPs for any that aren't associated with a running instance. Check Security Groups for any that aren't attached to anything.&lt;/p&gt;

&lt;p&gt;You'll probably find something. Most accounts do.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article is part of our series on AWS infrastructure visibility. Previously: &lt;a href="https://dev.to/blog/how-to-find-open-security-groups-aws"&gt;How to Find and Fix Open Security Groups in AWS&lt;/a&gt; and &lt;a href="https://dev.to/blog/how-to-find-orphaned-ebs-volumes-in-aws"&gt;How to Find Orphaned EBS Volumes in AWS&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>infrastructure</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to Find and Fix Open Security Groups in AWS</title>
      <dc:creator>Maksim Bolgarin</dc:creator>
      <pubDate>Tue, 17 Mar 2026 08:01:43 +0000</pubDate>
      <link>https://dev.to/maxbolgarin/how-to-find-and-fix-open-security-groups-in-aws-3g32</link>
      <guid>https://dev.to/maxbolgarin/how-to-find-and-fix-open-security-groups-in-aws-3g32</guid>
      <description>&lt;p&gt;Open security groups are among the most common AWS security misconfigurations found in production environments. A single inbound rule allowing &lt;code&gt;0.0.0.0/0&lt;/code&gt; on port 22 exposes your EC2 instances to every scanner and brute-force bot on the internet. It happens gradually — an engineer opens SSH access for a quick debugging session and forgets to close it. A staging environment gets a permissive rule that's never tightened. Multiply that across dozens of instances and multiple AWS regions, and you have a serious attack surface hiding in plain sight.&lt;/p&gt;

&lt;p&gt;This guide shows you how to find and fix open security groups in AWS using both the Console and CLI — and how to automate the process so nothing slips through.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Open Security Groups Are a Real Threat
&lt;/h2&gt;

&lt;p&gt;An AWS &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html" rel="noopener noreferrer"&gt;security group&lt;/a&gt; acts as a virtual firewall for your EC2 instances. Each inbound rule specifies which traffic is allowed to reach your instance. When the source is set to &lt;code&gt;0.0.0.0/0&lt;/code&gt;, it means every IP address on the internet can reach that port.&lt;/p&gt;

&lt;p&gt;Automated scanners like Shodan and Censys index newly exposed services within minutes. If you open port 22 to the world at 2pm, brute-force attempts will start by 2:15pm. This isn't theoretical — it's measurable.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Most Dangerous Open Ports
&lt;/h3&gt;

&lt;p&gt;Not all open ports carry the same risk. These are the ones that should never be exposed to &lt;code&gt;0.0.0.0/0&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port 22 (SSH)&lt;/strong&gt; — the primary target for credential brute-forcing and the most common entry point for lateral movement&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port 3389 (RDP)&lt;/strong&gt; — Windows Remote Desktop, a favorite delivery vector for ransomware&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port 3306 (MySQL) / 5432 (PostgreSQL)&lt;/strong&gt; — direct database access means direct data exfiltration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port 27017 (MongoDB)&lt;/strong&gt; — default MongoDB port, frequently found exposed with no authentication&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port 0–65535 (all traffic)&lt;/strong&gt; — the worst case, sometimes set accidentally when engineers copy rules between environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ports 80 and 443 are often intentionally public for web servers, but even these deserve a review to confirm the exposure is deliberate.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Find Open Security Groups in the AWS Console
&lt;/h2&gt;

&lt;p&gt;The AWS Console provides a visual way to inspect security groups, though it requires manual effort across regions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using the VPC Console
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Sign in to the AWS Console and navigate to &lt;strong&gt;VPC&lt;/strong&gt; (search "VPC" in the top bar)&lt;/li&gt;
&lt;li&gt;In the left sidebar, click &lt;strong&gt;Security Groups&lt;/strong&gt; under the "Security" section&lt;/li&gt;
&lt;li&gt;Click any security group to open its detail panel&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Inbound rules&lt;/strong&gt; tab&lt;/li&gt;
&lt;li&gt;Look for rules where the &lt;strong&gt;Source&lt;/strong&gt; column shows &lt;code&gt;0.0.0.0/0&lt;/code&gt; or &lt;code&gt;::/0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Flag any rule where that open source is paired with ports 22, 3389, 3306, 5432, or a wide port range&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Cross-Region Problem
&lt;/h3&gt;

&lt;p&gt;Here's where it gets tedious. The AWS Console shows security groups for one region at a time. If your organization uses 5 regions and has 40 security groups per region, you need to manually inspect 200 security groups — switching regions each time using the dropdown in the top-right corner.&lt;/p&gt;

&lt;p&gt;There is no built-in cross-region view for security groups in the AWS Console. If you've ever done this manually, you know how easy it is to skip a region or miss a rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Find Open Security Groups Using the AWS CLI
&lt;/h2&gt;

&lt;p&gt;The CLI is significantly faster than clicking through the Console. You can query security groups programmatically and even loop across all regions.&lt;/p&gt;

&lt;h3&gt;
  
  
  List All Security Groups with 0.0.0.0/0 Inbound Rules
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 describe-security-groups &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s2"&gt;"SecurityGroups[?IpPermissions[?IpRanges[?CidrIp=='0.0.0.0/0']]].{ID:GroupId,Name:GroupName}"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output&lt;/span&gt; table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This JMESPath query filters for any security group with at least one inbound rule sourced from &lt;code&gt;0.0.0.0/0&lt;/code&gt; and returns a clean table with the group ID and name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check for Port 22 Open to the Internet
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 describe-security-groups &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--filters&lt;/span&gt; &lt;span class="s2"&gt;"Name=ip-permission.cidr,Values=0.0.0.0/0"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
            &lt;span class="s2"&gt;"Name=ip-permission.from-port,Values=22"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
            &lt;span class="s2"&gt;"Name=ip-permission.to-port,Values=22"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s2"&gt;"SecurityGroups[*].{ID:GroupId,Name:GroupName}"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output&lt;/span&gt; table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Scan Across All AWS Regions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;region &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;aws ec2 describe-regions &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s2"&gt;"Regions[*].RegionName"&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; text&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"--- &lt;/span&gt;&lt;span class="nv"&gt;$region&lt;/span&gt;&lt;span class="s2"&gt; ---"&lt;/span&gt;
  aws ec2 describe-security-groups &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$region&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--filters&lt;/span&gt; &lt;span class="s2"&gt;"Name=ip-permission.cidr,Values=0.0.0.0/0"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s2"&gt;"SecurityGroups[*].{ID:GroupId,Name:GroupName}"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--output&lt;/span&gt; table 2&amp;gt;/dev/null
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This loop hits every AWS region. Expect it to take 30–60 seconds. If you use multiple AWS accounts, you'll need to repeat this with assumed roles for each account — or script that too.&lt;/p&gt;

&lt;p&gt;At this point, the overhead should be clear. You're writing scripts to do what should be a single button click. And scripts don't run themselves — someone has to remember to execute them regularly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scanorbit.cloud" rel="noopener noreferrer"&gt;ScanOrbit&lt;/a&gt; detects permissive security groups across all your AWS regions and accounts automatically — no scripts, no region-switching. Run a free scan and get a complete report in minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Fix Permissive Security Group Rules
&lt;/h2&gt;

&lt;p&gt;Finding the open rules is half the problem. Here's how to fix them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Replace 0.0.0.0/0 with a Specific CIDR Block
&lt;/h3&gt;

&lt;p&gt;If only your office or VPN needs SSH access, restrict the source to that IP range:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Remove the open rule&lt;/span&gt;
aws ec2 revoke-security-group-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--group-id&lt;/span&gt; sg-0123456789abcdef0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--protocol&lt;/span&gt; tcp &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--port&lt;/span&gt; 22 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--cidr&lt;/span&gt; 0.0.0.0/0

&lt;span class="c"&gt;# Add a restricted rule&lt;/span&gt;
aws ec2 authorize-security-group-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--group-id&lt;/span&gt; sg-0123456789abcdef0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--protocol&lt;/span&gt; tcp &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--port&lt;/span&gt; 22 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--cidr&lt;/span&gt; 203.0.113.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;203.0.113.0/24&lt;/code&gt; with your actual office or VPN CIDR range.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Security Group References for Internal Traffic
&lt;/h3&gt;

&lt;p&gt;Instead of CIDR blocks, reference another security group as the source. This is the right pattern for service-to-service communication — for example, allowing your application tier to reach the database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 authorize-security-group-ingress &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--group-id&lt;/span&gt; sg-database &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--protocol&lt;/span&gt; tcp &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--port&lt;/span&gt; 5432 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--source-group&lt;/span&gt; sg-application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, only instances in the &lt;code&gt;sg-application&lt;/code&gt; security group can reach the database. No IP addresses to manage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use SSM Session Manager Instead of SSH
&lt;/h3&gt;

&lt;p&gt;For EC2 access, consider replacing SSH entirely with &lt;a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html" rel="noopener noreferrer"&gt;AWS Systems Manager Session Manager&lt;/a&gt;. SSM routes traffic through the AWS service — no inbound ports required. This eliminates the need for bastion hosts and removes port 22 from the equation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Remediation Checklist
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Restrict sources immediately&lt;/strong&gt; — replace every &lt;code&gt;0.0.0.0/0&lt;/code&gt; rule on sensitive ports with specific CIDR ranges or security group references&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforce with SCPs&lt;/strong&gt; — use AWS Organizations Service Control Policies to prevent rules allowing &lt;code&gt;0.0.0.0/0&lt;/code&gt; on ports 22 and 3389 from being created&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable AWS Config rules&lt;/strong&gt; — the managed rule &lt;code&gt;restricted-ssh&lt;/code&gt; flags any security group with port 22 open to the internet; set it to auto-remediate&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tag your security groups&lt;/strong&gt; — clear naming and tagging makes it easy to identify which groups belong to which workload&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review in code&lt;/strong&gt; — treat security group changes as part of your infrastructure-as-code review process, not an afterthought&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Automating Security Group Audits at Scale
&lt;/h2&gt;

&lt;p&gt;The fundamental problem with point-in-time audits — whether you use the Console or CLI — is that they go stale immediately. A developer adds a &lt;code&gt;0.0.0.0/0&lt;/code&gt; rule at 11pm for a quick test. Your next manual audit is scheduled for next Tuesday. That's a week of exposure.&lt;/p&gt;

&lt;p&gt;As we covered in &lt;a href="https://dev.to/blog/why-aws-infrastructure-scanning-matters"&gt;why AWS infrastructure scanning matters&lt;/a&gt;, the real value of automated scanning isn't a single report — it's continuous coverage. The same applies to &lt;a href="https://dev.to/blog/how-to-find-orphaned-resources-in-aws"&gt;finding orphaned resources&lt;/a&gt; and every other hygiene check. Automation turns a periodic audit into a persistent safety net.&lt;/p&gt;

&lt;p&gt;What to look for in an automated scanner:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cross-region coverage&lt;/strong&gt; — checks every region, not just the ones you remember to select&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-account support&lt;/strong&gt; — organizations with multiple accounts need a single view&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agentless architecture&lt;/strong&gt; — no agents to install, no Lambda functions to manage, no additional attack surface&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Actionable findings&lt;/strong&gt; — not just "this rule exists" but what it affects and how to fix it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ScanOrbit uses a read-only IAM role to scan your entire AWS environment and surfaces permissive security group rules alongside other findings like &lt;a href="https://dev.to/blog/ssl-certificate-monitoring-aws"&gt;expiring SSL certificates&lt;/a&gt;, &lt;a href="https://dev.to/blog/gdpr-compliance-aws-data-residency"&gt;data residency violations&lt;/a&gt;, and cost waste. Because it's agentless and hosted in the EU, there's no operational overhead and no new attack surface.&lt;/p&gt;

&lt;p&gt;The steps in this guide will find open security groups in your AWS account today. But staying on top of them over time — as your team grows, new rules get added, and old ones go unreviewed — requires automation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://scanorbit.cloud" rel="noopener noreferrer"&gt;ScanOrbit&lt;/a&gt; detects permissive security groups across all regions automatically. Try a free scan and see what's exposed in your account right now.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>security</category>
      <category>infrastructure</category>
    </item>
  </channel>
</rss>
