More Info:
Determines if TCP port 23 for Telnet is open to the public.Risk Level
MediumAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- 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
- FedRAMP
- GDPR
- HIPAA
- HITRUST CSF
- ISO 27001
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- 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
- Securities and Exchange Board of India (SEBI) - Cloud Security Adoption Framework
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of “Telnet Port Should Not Be Open” for GCP using GCP console, please follow the below steps:
- Login to your GCP console.
- Navigate to the GCP project which has the instance with the open Telnet port.
- Click on the hamburger menu on the top left corner of the console and select “Compute Engine” under the “Compute” section.
- From the list of instances, select the instance with the open Telnet port.
- Click on the “Edit” button at the top of the page.
- Scroll down to the “Firewall” section and click on “Management, disks, networking, SSH keys”.
- Under the “Firewall” section, click on “default-allow-internal”.
- Scroll down to the “Protocols and ports” section and uncheck the “tcp:23” option.
- Click on the “Save” button at the bottom of the page.
Using CLI
Using CLI
To remediate the “Telnet Port Should Not Be Open” misconfiguration on GCP using GCP CLI, follow these steps:
- Open the Cloud Shell in the GCP Console.
- Run the following command to list all the instances in the project:
- Identify the instance that has the telnet port open.
- Connect to the instance using SSH:
- Once connected to the instance, run the following command to check if telnet is installed:
- If telnet is installed, run the following command to uninstall it:
- If telnet is not installed, run the following command to check if the telnet port is open:
- If the telnet port is open, edit the firewall rules for the instance to close the telnet port:
- Verify that the telnet port is closed by running the following command:
-
Exit the SSH session by typing
exit. - Repeat steps 4-10 for any other instances that have the telnet port open.
Using Python
Using Python
To remediate the Telnet Port Should Not Be Open misconfiguration in GCP using Python, you can follow these steps:By following these steps, you can remediate the Telnet Port Should Not Be Open misconfiguration for a GCP instance using Python.
- Connect to the GCP project using the Python client library.
- Check if the Telnet port is open by looking at the instance’s firewall rules.
- If there is a firewall rule that allows Telnet traffic, delete it.
- Confirm that the Telnet port is no longer open by checking the instance’s firewall rules again.
Using Terraform
Using Terraform
VPC_NETWORK_RESOURCE_NAMEwith yourgoogle_compute_networkresource name.GCP_PROJECT_IDwith your project ID.KNOWN_TRUSTED_CIDR_1/KNOWN_TRUSTED_CIDR_2with your allowed IP ranges.TELNET_TARGET_TAGwith the network tag used by instances that must receive Telnet (or removetarget_tagsif you intentionally apply to all instances on the network).
source_ranges.Verification: terraform plan should show the existing google_compute_firewall rule’s source_ranges changing from ["0.0.0.0/0"] (or similarly broad ranges) to the specified KNOWN_TRUSTED_CIDR_* values, with no -/+ replacement indicator for the resource.
