Using Console
Using CLI
<security-group-id>
with the ID of the security group that you want to update, <port-range>
with the port range that you want to restrict, and <ip-address>
with the IP address range that you want to restrict.For example, if you want to restrict inbound access to port 22 (SSH) for the security group with ID sg-0123456789abcdef0
, you can use the following command:<security-group-id>
with the ID of the security group that you updated.This command will describe the security group and show the inbound rules for the security group. Verify that the inbound rule that allows unrestricted access to the uncommon port is revoked successfully.Repeat the above steps for all the security groups that have unrestricted inbound access on Non-HTTP Ports.Using Python