Skip to main content

More Info:

Determines if TCP port 5500 for VNC Client is open to the public. While some ports such as HTTP and HTTPS are required to be open to the public to function properly, more sensitive services such as VNC Client should be restricted to known IP addresses.

Risk Level

Medium

Address

Security

Compliance Standards

HITRUST

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “VNC Client Port Should Not Be Open” in GCP using GCP console, follow the below steps:
  1. Login to the GCP console with your credentials.
  2. Navigate to the Compute Engine section from the left-hand side menu.
  3. Click on the name of the instance where you want to remediate the misconfiguration.
  4. Click on the “Edit” button at the top of the page.
  5. Scroll down to the “Firewall” section.
  6. Click on the “default-allow-rdp” rule.
  7. Click on the “Edit” button.
  8. In the “Protocols and ports” section, uncheck the “tcp:3389” checkbox.
  9. Click on the “Save” button to save the changes.
  10. Repeat steps 6-9 for “default-allow-vnc” rule.
  11. Click on the “Save” button at the bottom of the page to save the changes.
After following the above steps, the VNC Client Port will be closed and the misconfiguration will be remediated.

To remediate the VNC Client Port Should Not Be Open misconfiguration in GCP using GCP CLI, follow these steps:
  1. Open the Cloud Shell by clicking the Activate Cloud Shell button in the GCP Console.
  2. Run the following command to list all the firewall rules in your project:
  3. Identify the firewall rule that allows traffic to the VNC client port (usually port 5900).
  4. Run the following command to delete the firewall rule:
    Replace [FIREWALL_RULE_NAME] with the name of the firewall rule that allows traffic to the VNC client port.
  5. Verify that the firewall rule has been deleted by running the following command:
    The output should not include the firewall rule that allowed traffic to the VNC client port.
  6. You have successfully remediated the VNC Client Port Should Not Be Open misconfiguration in GCP using GCP CLI.
To remediate the VNC Client Port open misconfiguration in GCP using Python, you can follow these steps:
  1. First, you need to authenticate and authorize your Google Cloud account using the Python client library. You can do this by following the instructions in the official Google Cloud documentation.
  2. Next, you need to identify the GCP project and the specific instance(s) that have the VNC client port open. You can use the google-cloud-sdk command-line tool or the Python client library to list all the instances in your project.
  3. Once you have identified the instances with the VNC client port open, you can use the Python client library to update the firewall rules for each instance to block the VNC client port. Here’s an example code snippet that uses the google-cloud-firewall library to update the firewall rules for an instance:
  1. Finally, you can verify that the VNC client port is no longer open by trying to connect to it from a remote machine. If the remediation was successful, the connection should be refused.

Additional Reading: