Table: azure_compute_ssh_key - Query Azure Compute SSH Keys using SQL
Azure Compute SSH Key is a resource in Microsoft Azure that allows users to manage SSH keys for virtual machines. These keys are used for secure shell login to VM instances. Azure Compute SSH Key provides a secure way to access VMs without needing to manage passwords.
Table Usage Guide
The azure_compute_ssh_key
table enables users to gain insights into the SSH keys associated with their Azure Compute virtual machines. As a system administrator or DevOps engineer, leverage this table to manage and audit SSH keys, ensuring secure and appropriate access to VM instances. This table is beneficial in maintaining security best practices, identifying unused or unnecessary keys, and enforcing compliance with organizational access policies.
Examples
Retrieve SSH public key by name
Discover the segments that have specific SSH public keys associated with them in your Azure Compute instances. This helps ensure secure access to your instances by verifying the SSH keys in use.
select name, public_keyfrom azure_compute_ssh_keywhere name = 'key-name.';
select name, public_keyfrom azure_compute_ssh_keywhere name = 'key-name.';
List compute virtual machines using SSH public key
The query is used to identify which virtual machines are utilizing a specific SSH public key. This can be useful for security audits, ensuring only authorized keys are in use.
select m.name as machine_name, k.name as ssh_key_namefrom azure_compute_virtual_machine as m, jsonb_array_elements(linux_configuration_ssh_public_keys) as s left join azure_compute_ssh_key as k on k.public_key = s ->> 'keyData';
select m.name as machine_name, k.name as ssh_key_namefrom azure_compute_virtual_machine as m, json_each(linux_configuration_ssh_public_keys) as s left join azure_compute_ssh_key as k on k.public_key = json_extract(s.value, '$.keyData');
Schema for azure_compute_ssh_key
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
cloud_environment | text | The Azure Cloud Environment. | |
id | text | The unique ID identifying the resource in subscription. | |
name | text | = | Name of the SSH key. |
public_key | text | SSH public key. | |
region | text | The Azure region/location in which the resource is located. | |
resource_group | text | = | The resource group which holds this resource. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
tags | jsonb | A map of tags for the resource. | |
title | text | Title of the resource. | |
type | text | The type of the resource in Azure. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- azure
You can pass the configuration to the command with the --config
argument:
steampipe_export_azure --config '<your_config>' azure_compute_ssh_key