More Info:
No security group should allow unrestricted inbound access to TCP port 23 (Telnet).Risk Level
MediumAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- AWS Well Architected Framework
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- GDPR
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- Reserve Bank of India (RBI) Master Direction – Information Technology Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of unrestricted Telnet access in AWS, you can follow the below steps:
- Log in to the AWS Management Console.
- Go to the EC2 Dashboard.
- Click on the Security Groups option from the left navigation pane.
- Select the security group that has unrestricted Telnet access.
- Click on the Inbound Rules tab.
- Locate the rule that allows Telnet access (port 23) and select it.
- Click on the Delete button to remove the rule.
- Click on the Save Rules button to save the changes.
Using CLI
Using CLI
To remediate the unrestricted Telnet access in AWS using AWS CLI, follow the steps below:Replace This should show that the Telnet access has been removed from the identified security group.By following these steps, you have successfully remediated the unrestricted Telnet access in AWS using AWS CLI.
- Open your terminal and configure your AWS CLI with the necessary credentials.
- Run the following command to list all the security groups in your AWS account:
- Identify the security group that has unrestricted Telnet access. Look for the security group that has port 23 open to all IP addresses (0.0.0.0/0).
- Note down the security group ID of the identified security group.
- Run the following command to revoke the Telnet access from the identified security group:
<security-group-id> with the ID of the identified security group.- Verify that the Telnet access has been revoked by running the following command:
Using Python
Using Python
To remediate the unrestricted Telnet access misconfiguration in AWS using Python, you can follow the below steps:In the above code, replace ‘sg-0123456789abcdef’ with the ID of the security group that you want to remediate.By following the above steps, you can remediate the unrestricted Telnet access misconfiguration in AWS using Python.
- First, you need to identify the security group(s) that have unrestricted Telnet access. You can use the following Python code to retrieve the security groups:
- Once you have identified the security group(s) that have unrestricted Telnet access, you can remove the Telnet rule(s) from the security group(s). You can use the following Python code to remove the Telnet rule(s):
Using Terraform
Using Terraform
ingress block (or standalone aws_vpc_security_group_ingress_rule resource) that has protocol = "tcp", from_port = 23, to_port = 23 and cidr_blocks = ["0.0.0.0/0"] and/or ipv6_cidr_blocks = ["::/0"]. This is destructive for those rules: they will be permanently removed, matching the CLI revocation.terraform plan should then show the Telnet ingress rule(s) being removed from the security group (a diff removing the port 23 ingress, with no new Telnet rule added).
