Ensure 'Enable Connecting to Serial Ports' Is Not Enabled for VM Instance

If you enable serial ports on an instance, clients can attempt to connect to that instance from any IP address. Therefore connection from to ports support should be disabled.

Risk Level: High
Cloud Entity: Virtual Machine Instances
CloudGuard Rule ID: D9.GCP.NET.11
Covered by Spectral: Yes
Category: Compute


VMInstance should not have metadata.items contain [ key like 'serial-port-enable' and value like 'true']


From Portal

  1. Navigate to VM instances page: https://console.cloud.google.com/compute/instance
  2. Click on the Specific VM with open serial ports.
  3. Click EDIT
  4. Deselect Enable connecting to serial ports below Remote access block.
  5. Click Save

From TF
Set the serial-port-enable argument to 'false':

resource 'google_compute_instance' 'default' {
	metadata = {
		serial-port-enable = false

From Command Line

gcloud compute instances add-metadata INSTANCE_NAME --metadata serial-port-enable=FALSE


  1. https://cloud.google.com/sdk/gcloud/reference/compute/instances/add-metadata
  2. https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-using-serial-console

Virtual Machine Instances

Compute Engine instances can run the public images for Linux and Windows Server that Google provides as well as private custom images that you can create or import from your existing systems. You can also deploy Docker containers, which are automatically launched on instances running the Container-Optimized OS public image.

You can choose the machine properties of your instances, such as the number of virtual CPUs and the amount of memory, by using a set of predefined machine types or by creating your own custom machine types.

Compliance Frameworks

  • CloudGuard GCP All Rules Ruleset
  • GCP CIS Controls V 8
  • GCP CIS Foundations v. 1.0.0
  • GCP CIS Foundations v. 1.1.0
  • GCP CIS Foundations v. 1.2.0
  • GCP CIS Foundations v. 1.3.0
  • GCP CIS Foundations v. 2.0
  • GCP CloudGuard Best Practices
  • GCP CloudGuard CheckUp
  • GCP CloudGuard Network Security
  • GCP ISO 27001:2013
  • GCP LGPD regulation
  • GCP MITRE ATT&CK Framework v12.1
  • GCP NIST 800-53 Rev 4
  • GCP NIST 800-53 Rev 5
  • GCP NIST CSF v1.1
  • GCP PCI-DSS 3.2
  • GCP PCI-DSS 4.0
  • GCP Security Risk Management