turbot/steampipe-mod-terraform-azure-compliance

Control: Linux Virtual machines and scale sets should enable SSH key authentication

Description

Ensure linux VM enables SSH with keys for secure communication.

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.compute_vm_and_scale_set_ssh_key_enabled_linux

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_azure_compliance.control.compute_vm_and_scale_set_ssh_key_enabled_linux --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'admin_ssh_key') is not null then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'admin_ssh_key') is not null then ' SSH key enabled'
else ' SSH key disabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type in ('azurerm_linux_virtual_machine_scale_set', 'azurerm_windows_virtual_machine_scale_set');

Tags