turbot/steampipe-mod-terraform-gcp-compliance

Control: Ensure 'Enable connecting to serial ports' is not enabled for VM Instance

Description

Interacting with a serial port is often referred to as the serial console, which is similar to using a terminal window, in that input and output is entirely in text mode and there is no graphical interface or mouse support.

Usage

Run the control in your terminal:

powerpipe control run terraform_gcp_compliance.control.compute_instance_serial_port_connection_disabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_gcp_compliance.control.compute_instance_serial_port_connection_disabled --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'metadata') is null then 'alarm'
when (attributes_std -> 'metadata' -> 'serial-port-enable') is null then 'alarm'
when (attributes_std -> 'metadata' ->> 'serial-port-enable') = 'true' then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'metadata') is null then ' ''metadata'' property is not defined'
when (attributes_std -> 'metadata' -> 'serial-port-enable') is null then ' ''serial-port-enable'' property is not defined'
when (attributes_std -> 'metadata' ->> 'serial-port-enable') = 'true' then ' has serial port connections enabled'
else ' has serial port connections disabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'google_compute_instance';

Tags