Back to Checks
iac

Disable serial port connectivity for all instances

GCP-0032
Service: computeSeverity: medium
OfficialBuilt-inVerified

When serial port access is enabled, the access is not governed by network security rules meaning the port can be exposed publicly.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler iac --checks GCP-0032

Recommendation

Disable serial port access

Check Code

# METADATA
# title: Disable serial port connectivity for all instances
# description: |
#   When serial port access is enabled, the access is not governed by network security rules meaning the port can be exposed publicly.
# scope: package
# schemas:
#   - input: schema["cloud"]
# custom:
#   id: GCP-0032
#   long_id: google-compute-no-serial-port
#   aliases:
#     - AVD-GCP-0032
#     - no-serial-port
#     - google-compute-no-serial-port
#   provider: google
#   service: compute
#   severity: MEDIUM
#   recommended_action: Disable serial port access
#   input:
#     selector:
#       - type: cloud
#         subtypes:
#           - service: compute
#             provider: google
#   examples: checks/cloud/google/compute/no_serial_port.yaml
package builtin.google.compute.google0032

import rego.v1

deny contains res if {
	some instance in input.google.compute.instances
	instance.enableserialport.value == true
	res := result.new("Instance has serial port enabled.", instance.enableserialport)
}