A high severity rule stating that VPC security groups must restrict ingress SSH access from 0.0.0.0/0.
Rule | VPC security groups should restrict ingress SSH access from 0.0.0.0/0 |
Framework | NIST 800-53 Revision 5 |
Severity | ✔ High |
VPC Security Group Rule Restriction for SSH Access
Description:
To comply with the NIST 800-53 Revision 5 security standard, ingress SSH (Secure Shell) access to the VPC (Virtual Private Cloud) instances should be restricted to known and trusted IP addresses rather than allowing access from any source (0.0.0.0/0).
Policy Details:
Troubleshooting Steps:
Issue: SSH access is not restricted. Resolution: Verify that the security group rules have been properly configured and associated with the VPC instances. Ensure that ingress SSH access is limited to the required IP addresses or IP ranges.
Issue: SSH access is restricted, but connectivity issues arise. Resolution: Confirm that the correct IP address or IP range has been allowed for SSH access. Double-check any changes made to the security group rules. Verify that there are no conflicts with Network Access Control Lists (NACLs) or other security policies.
Necessary Codes:
In order to apply the necessary restrictions on SSH access to the VPC security group, the following code snippets can be used:
AWS CLI:
aws ec2 authorize-security-group-ingress \ --group-id <security-group-id> \ --protocol tcp \ --port 22 \ --source-ip <trusted-ip-address>
AWS SDK (Python):
import boto3 ec2 = boto3.client('ec2') response = ec2.authorize_security_group_ingress( GroupId='<security-group-id>', IpPermissions=[ { 'FromPort': 22, 'ToPort': 22, 'IpProtocol': 'tcp', 'IpRanges': [ { 'CidrIp': '<trusted-ip-address>', }, ], }, ], )
Step-by-Step Guide for Remediation:
<security-group-id>
with the actual security group ID.<trusted-ip-address>
with the trusted IP address/es or IP range/s.Following these steps will effectively restrict SSH access to the VPC instances from only trusted IP addresses or IP ranges in compliance with the NIST 800-53 Revision 5 standard.