Table: azure_key_vault_key_version - Query Azure Key Vault Key Versions using SQL
Azure Key Vault is a service that provides a secure storage for secrets, keys, and certificates. It enables users to securely store and tightly control access to tokens, passwords, certificates, API keys, and other secrets. Azure Key Vault simplifies the process of meeting industry compliance and regulatory standards.
Table Usage Guide
The azure_key_vault_key_version
table provides insights into each version of a key stored in Azure Key Vault. As a security analyst, you can explore key-specific details through this table, including the key type, key state, and associated metadata. Use it to track the lifecycle of keys, verify the key state, and ensure compliance with security policies.
Examples
Basic info
Explore the status and details of various versions of keys in your Azure Key Vault. This will help you understand the lifecycle of your keys, their types, and their geographical locations, which can be crucial for managing security and compliance.
select name, vault_name, enabled, created_at, updated_at, key_type, locationfrom azure_key_vault_key_version;
select name, vault_name, enabled, created_at, updated_at, key_type, locationfrom azure_key_vault_key_version;
List disabled key versions
Identify instances where key versions are disabled in Azure Key Vault, allowing you to review and manage your keys' security settings effectively.
select name, key_name, vault_name, enabledfrom azure_key_vault_key_versionwhere not enabled;
select name, key_name, vault_name, enabledfrom azure_key_vault_key_versionwhere enabled = 0;
List keys versions with no expiration time set
Explore which versions of keys in Azure Key Vault have not been assigned an expiration time. This is useful for identifying potential security risks and ensuring key management best practices are being followed.
select name, enabled, expires_atfrom azure_key_vault_key_versionwhere expires_at is null;
select name, enabled, expires_atfrom azure_key_vault_key_versionwhere expires_at is null;
Count the number of versions by key
Assess the elements within your Azure Key Vault by determining the quantity of versions for each key. This can be beneficial in managing key rotations and understanding the lifecycle of each key.
select key_name, count(name) as key_version_countfrom azure_key_vault_key_versiongroup by key_name;
select key_name, count(name) as key_version_countfrom azure_key_vault_key_versiongroup by key_name;
Query examples
- compute_disk_encryption_details
- compute_disk_encryption_set_details
- compute_disk_encryption_sets_for_key_vault_key
- container_registries_for_key_vault_key
- key_vault_keys_for_compute_disk
- key_vault_keys_for_compute_snapshot
- key_vault_keys_for_storage_account
- postgresql_servers_for_key_vault_key
- storage_storage_accounts_for_key_vault_key
Schema for azure_key_vault_key_version
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. | |
created_at | timestamp with time zone | Specifies the time when the key version is created. | |
curve_name | text | The elliptic curve name. Possible values are: 'P256', 'P384', 'P521', 'P256K'. | |
enabled | boolean | Indicates whether the key version is enabled, or not. | |
expires_at | timestamp with time zone | Specifies the time when the key version wil expire. | |
id | text | Contains ID to identify a key version uniquely. | |
key_id | text | Contains ID to identify a key uniquely. | |
key_name | text | = | The friendly name that identifies the key. |
key_ops | jsonb | A list of key operations. | |
key_size | bigint | The key size in bits. | |
key_type | text | The type of the key. Possible values are: 'EC', 'ECHSM', 'RSA', 'RSAHSM'. | |
key_uri | text | The URI to retrieve the current version of the key. | |
key_uri_with_version | text | The URI to retrieve the specific version of the key. | |
location | text | Azure location of the key vault resource. | |
name | text | The friendly name that identifies the key version. | |
not_before | timestamp with time zone | Specifies the time before which the key version is not usable. | |
recovery_level | text | The deletion recovery level currently in effect for the object. If it contains 'Purgeable', then the object can be permanently deleted by a privileged user; otherwise, only the system can purge the object at the end of the retention interval. | |
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 | Type of the resource | |
updated_at | timestamp with time zone | Specifies the time when the key was last updated. | |
vault_name | text | The friendly name that identifies the vault. |
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_key_vault_key_version