Check your Google Cloud Virtual Private Cloud (VPC) firewall rules for inbound rules that allow unrestricted access (i.e. 0.0.0.0/0) on TCP port 22 and restrict the access to trusted IP addresses or IP ranges only in order to implement the principle of least privilege and reduce the attack surface. TCP port 22 is used for secure remote login by connecting an SSH client application with an SSH server.
This rule resolution is part of the Conformity Security & Compliance tool for GCP.
VPC firewall rules control incoming and outgoing traffic to the VM instances available within your VPC network. Exposing Secure Shell (SSH) port 22 to the Internet can increase opportunities for malicious activities such as hacking, Man-In-The-Middle attacks (MITM) and brute-force attacks, therefore it is strongly recommended to configure your Google Cloud VPC firewall rules to limit inbound traffic on TCP port 22 to known IP addresses only.
Audit
To determine if your VPC firewall rules allow unrestricted access on TCP port 22 (SSH), perform the following operations:
Remediation / Resolution
To update your VPC network firewall rule configuration in order to restrict Secure Shell (SSH) access to trusted, authorized IP addresses or IP ranges only, perform the following operations:
References
- Google Cloud Platform (GCP) Documentation
- VPC network overview
- Using VPC networks
- VPC firewall rules overview
- Using firewall rules
- CIS Security Documentation
- Securing Google Cloud Computing Platform
- GCP Command Line Interface (CLI) Documentation
- gcloud projects list
- gcloud compute networks list
- gcloud compute firewall-rules list
- gcloud compute firewall-rules update