Table: azure_key_vault_certificate - Query Azure Key Vault Certificates using SQL
Azure Key Vault is a cloud service that provides a secure store for secrets, keys, and certificates. Key Vault certificates are managed digital certificates that aid in secure communication and identity verification, which are essential in various IT and cloud scenarios.
Table Usage Guide
The azure_key_vault_certificate
table allows users to explore and manage certificates within Azure Key Vault. This table is especially useful for security engineers and cloud administrators who need to oversee the state, configuration, and properties of certificates stored in Azure Key Vault.
Examples
Basic info
Review the general status and details of your Azure Key Vault certificates. This query is fundamental for routine checks and ensuring that certificates are up-to-date and correctly enabled.
select name, vault_name, enabled, created, updatedfrom azure_key_vault_certificate;
select name, vault_name, enabled, created, updatedfrom azure_key_vault_certificate;
List disabled certificates
Identify certificates that are currently disabled in Azure Key Vault. This query helps maintain proper security measures and effective access control.
select name, vault_name, enabledfrom azure_key_vault_certificatewhere not enabled;
select name, vault_name, enabledfrom azure_key_vault_certificatewhere not enabled;
List certificates expiring in 10 days
Discover certificates within Azure Key Vault that are nearing their expiration date. This is crucial for proactive certificate renewal and avoiding potential security risks.
select name, enabled, not_before, created, expiresfrom azure_key_vault_certificatewhere expires <= now() + interval '10 days';
select name, enabled, not_before, created, expiresfrom azure_key_vault_certificatewhere datetime(expires) <= datetime('now', '+10 days');
Get key properties of certificates
Analyze the key properties of certificates, including their exportability, type, size, and reuse policies. This information is vital for understanding the security and operational characteristics of each certificate.
select name, id, key_properties ->> 'Exportable' as exportable, key_properties ->> 'KeyType' as key_type, key_properties ->> 'KeySize' as key_size, key_properties ->> 'ReuseKey' as reuse_keyfrom azure_key_vault_certificate;
select name, id, json_extract(key_properties, '$.Exportable') as exportable, json_extract(key_properties, '$.KeyType') as key_type, json_extract(key_properties, '$.KeySize') as key_size, json_extract(key_properties, '$.ReuseKey') as reuse_keyfrom azure_key_vault_certificate;
Get X509 properties of certificates
Examine the X509 properties of certificates, such as the subject, extended key usage (EKUs), alternative names, key usage, and validity. This query is crucial for detailed certificate analysis and compliance checks.
select name, id, x509_certificate_properties ->> 'Subject' as subject, x509_certificate_properties -> 'Ekus' as ekus, x509_certificate_properties -> 'SubjectAlternativeNames' as subject_alternative_names, x509_certificate_properties ->> 'KeyUsage' as key_usage, x509_certificate_properties ->> 'ValidityInMonths' as validity_in_monthsfrom azure_key_vault_certificate;
select name, id, json_extract(x509_certificate_properties, '$.Subject') as subject, json_extract(x509_certificate_properties, '$.Ekus') as ekus, json_extract( x509_certificate_properties, '$.SubjectAlternativeNames' ) as subject_alternative_names, json_extract(x509_certificate_properties, '$.KeyUsage') as key_usage, json_extract(x509_certificate_properties, '$.ValidityInMonths') as validity_in_monthsfrom azure_key_vault_certificate;
Schema for azure_key_vault_certificate
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. | |
cer | jsonb | CER contents of x509 certificate. | |
cloud_environment | text | The Azure Cloud Environment. | |
content_type | text | The content type of the secret. | |
created | timestamp with time zone | Creation time in UTC. | |
enabled | boolean | Determines whether the object is enabled. | |
expires | timestamp with time zone | Expiry date in UTC. | |
id | text | Certificate identifier. | |
issuer_parameters | jsonb | Parameters for the issuer of the X509 component of a certificate. | |
key_id | text | The key id. | |
key_properties | jsonb | Properties of the key backing a certificate. | |
lifetime_actions | jsonb | Actions that will be performed by Key Vault over the lifetime of a certificate. | |
name | text | = | Name of the certificate. |
not_before | timestamp with time zone | Not before date in UTC. | |
recovery_level | text | Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the certificate can be permanently deleted by a privileged user; otherwise, only the system can purge the certificate, at the end of the retention interval. Possible values include: 'Purgeable', 'RecoverablePurgeable', 'Recoverable', 'RecoverableProtectedSubscription'. | |
secret_id | text | The secret id. | |
secret_properties | jsonb | Properties of the secret backing a certificate. | |
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. | |
updated | timestamp with time zone | Last updated time in UTC. | |
vault_name | text | = | The name of the vault. |
x509_certificate_properties | jsonb | Properties of the X509 component of a certificate. | |
x509_thumbprint | text | Thumbprint of the certificate. A URL-encoded base64 string. |
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_certificate