turbot/steampipe-mod-azure-compliance

Control: Compute virtual machine scale sets with linux OS should have SSH key authentication enabled

Description

This control checks whether virtual machine scale sets have SSH key authentication enabled. This control is only applicable for Linux-type operating systems.

Usage

Run the control in your terminal:

powerpipe control run azure_compliance.control.compute_vm_scale_set_ssh_key_authentication_linux

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run azure_compliance.control.compute_vm_scale_set_ssh_key_authentication_linux --share

SQL

This control uses a named query:

select
a.id as resource,
case
when virtual_machine_storage_profile -> 'osDisk' ->> 'osType' = 'Windows' then 'skip'
when virtual_machine_os_profile -> 'linuxConfiguration' ->> 'disablePasswordAuthentication' = 'true' then 'ok'
else 'alarm'
end as status,
case
when virtual_machine_storage_profile -> 'osDisk' ->> 'osType' = 'Windows' then a.title || ' is using windows OS.'
when virtual_machine_os_profile -> 'linuxConfiguration' ->> 'disablePasswordAuthentication' = 'true' then a.title || ' has SSK key authentication enabled.'
else a.title || ' has password authentication enabled.'
end as reason,
a.resource_group as resource_group,
sub.display_name as subscription
from
azure_compute_virtual_machine_scale_set as a,
azure_subscription as sub
where
sub.subscription_id = a.subscription_id;

Tags