Compliancemanzill.com
CIS Amazon Web Services Foundations Benchmark v1.2.0

CIS Amazon Web Services Foundations Benchmark v1.2.0/Networking/46 of 49

4.1Ensure no security groups allow ingress from 0.0.0.0/0 to port 22

Control family: Networking

Control description

Security groups provide stateful filtering of ingress/egress network traffic to AWS resources. It is recommended that no security group allows unrestricted ingress access to port `22` .

How to implement

ResponsibilityCustomerYou configure and operate this in your own cloud accounts.

SSH open to the whole internet invites constant password guessing and exploit attempts against every instance behind the rule. Administrators reach instances through Session Manager, which needs no inbound port, or from a short list of known address ranges, never from anywhere.

Before you start

The same on every cloud, before the steps in the tabs.

  • Agree how administrators reach Linux instances (Session Manager, or a bastion reachable only from named address ranges), and record any exception with its approver.
  • Add "no SSH from anywhere" to the network change review checklist.

Evidence

  • The remote access standard and the exception register

On AWS the tasks find security groups that open port 22 to everyone with the AWS Config rule from the benchmark, then close them and give administrators Session Manager instead.

Task 1Find security groups that open SSH to the internet

  1. Sign in to the AWS Management Console at console.aws.amazon.com, open AWS Config in each Region you use, and choose Rules > Add rule.
  2. On Specify rule type, search for restricted-ssh, select it and choose Next.
  3. On Configure rule, keep the name, then choose Next.
  4. On Review and create, check the settings and add the rule.
  5. Once it has finished Evaluating..., open the rule and list the noncompliant security groups.

Task 2Close the open rules and use Session Manager instead

  1. Open EC2 > Security Groups and select a flagged group.
  2. On the Inbound rules tab, choose Edit inbound rules.
  3. For the rule on port 22 with source 0.0.0.0/0 or ::/0, choose Delete, or change the source to your administrators' address range.
  4. Choose Save rules.
  5. Give the affected instances an instance role with the AmazonSSMManagedInstanceCore policy, so administrators can connect from Systems Manager > Session Manager > Start session.
  6. Check it: the restricted-ssh rule shows the group compliant, and an administrator can still open a session.

Evidence

  • The restricted-ssh rule in each Region, showing all security groups compliant
  • Security Hub CSPM control EC2.13, showing passed
  • Session Manager session history, showing how administrators now connect

Console steps as of 5 November 2026. Not every step has been confirmed in a live console yet, and menus and labels can move between releases, so look for the nearest match if one has changed.