Table: azure_container_registry - Query Azure Container Registries using SQL
Azure Container Registry is a managed Docker registry service provided by Microsoft Azure for storing and managing Docker images. It is integrated with Azure DevOps, Azure Kubernetes Service (AKS), Docker CLI, and other popular open-source tools. Azure Container Registry allows developers to build, store, and manage container images for Azure deployments in a central registry.
Table Usage Guide
The azure_container_registry
table provides insights into Azure Container Registries within Microsoft Azure. As a DevOps engineer, explore registry-specific details through this table, including the status, SKU, network access, and other critical details. Utilize it to uncover information about registries, such as those with private network access, the SKU tier, and the verification of admin user-enabled status.
Examples
Basic info
Explore the status and details of your Azure Container Registry instances, including their creation date and geographical location, to gain insights into the distribution and management of your resources. This can be particularly useful for auditing purposes, resource allocation, and strategizing regional deployment.
select name, id, provisioning_state, creation_date, sku_tier, regionfrom azure_container_registry;
select name, id, provisioning_state, creation_date, sku_tier, regionfrom azure_container_registry;
List registries not encrypted with a customer-managed key
Determine the areas in which container registries in your Azure environment are not encrypted with a customer-managed key. This can help in identifying potential security gaps and ensuring better data protection.
select name, encryption ->> 'status' as encryption_status, regionfrom azure_container_registry;
select name, json_extract(encryption, '$.status') as encryption_status, regionfrom azure_container_registry;
Get webhook details of registries
Webhooks in Azure Container Registry provide a way to trigger custom actions in response to events happening within the registry. These events can include the completion of Docker image pushes, or deletions in the container registry. When such an event occurs, Azure Container Registry sends an HTTP POST payload to the webhook's configured URL.
select name, w ->> 'location' as webhook_location, w -> 'properties' -> 'actions' as actions, w -> 'properties' ->> 'scope' as scope, w -> 'properties' ->> 'status' as statusfrom azure_container_registry, jsonb_array_elements(webhooks) as w;
select name, json_extract(w.value, '$.location') as webhook_location, json_extract(w.value, '$.properties.actions') as actions, json_extract(w.value, '$.properties.scope') as scope, json_extract(w.value, '$.properties.status') as statusfrom azure_container_registry, json_each(webhooks) as w;
List registries not configured with virtual network service endpoint
Determine the areas in which registries are not configured with a virtual network service endpoint. This is useful in identifying potential security risks where network access is allowed without restrictions.
select name, network_rule_set ->> 'defaultAction' as network_rule_default_action, network_rule_set ->> 'virtualNetworkRules' as virtual_network_rulesfrom azure_container_registrywhere network_rule_set is not null and network_rule_set ->> 'defaultAction' = 'Allow';
select name, json_extract(network_rule_set, '$.defaultAction') as network_rule_default_action, json_extract(network_rule_set, '$.virtualNetworkRules') as virtual_network_rulesfrom azure_container_registrywhere network_rule_set is not null and json_extract(network_rule_set, '$.defaultAction') = 'Allow';
List registries with admin user account enabled
Determine the areas in which administrative user accounts are activated within your Azure Container Registries. This is beneficial to ascertain potential security risks and maintain best practices for access control.
select name, admin_user_enabled, regionfrom azure_container_registrywhere admin_user_enabled;
select name, admin_user_enabled, regionfrom azure_container_registrywhere admin_user_enabled;
Query examples
Control examples
- All Controls > Container Registry > Container registries admin user should be disabled
- All Controls > Container Registry > Container registries public network access should be disabled
- All Controls > Container Registry > Container registries quarantine policy should be enabled
- All Controls > Container Registry > Container registries retention policy should be enabled
- All Controls > Container Registry > Container registries should be geo-replicated
- All Controls > Container Registry > Container registries trust policy should be enabled
- Container registries should be encrypted with a customer-managed key
- Container registries should not allow unrestricted network access
- Container registries should use private link
- Container Registry should use a virtual network service endpoint
Schema for azure_container_registry
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
admin_user_enabled | boolean | Indicates whether the admin user is enabled, or not. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
cloud_environment | text | The Azure Cloud Environment. | |
creation_date | timestamp with time zone | The creation date of the container registry. | |
data_endpoint_enabled | boolean | Enable a single data endpoint per region for serving data. | |
data_endpoint_host_names | jsonb | A list of host names that will serve data when dataEndpointEnabled is true. | |
encryption | jsonb | The encryption settings of container registry. | |
id | text | The unique id identifying the resource in subscription. | |
identity | jsonb | The identity of the container registry. | |
login_credentials | jsonb | The login credentials for the specified container registry. | |
login_server | text | The URL that can be used to log into the container registry. | |
name | text | = | The name of the resource. |
network_rule_bypass_options | text | Indicates whether to allow trusted Azure services to access a network restricted registry. Valid values are: 'AzureServices', 'None'. | |
network_rule_set | jsonb | The network rule set for a container registry. | |
policies | jsonb | The policies for a container registry. | |
private_endpoint_connections | jsonb | A list of private endpoint connections for a container registry. | |
provisioning_state | text | The provisioning state of the container registry at the time the operation was called. Valid values are: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. | |
public_network_access | text | Indicates whether or not public network access is allowed for the container registry. Valid values are: 'Enabled', 'Disabled'. | |
region | text | The Azure region/location in which the resource is located. | |
resource_group | text | = | The resource group which holds this resource. |
sku_name | text | The SKU name of the container registry. Required for registry creation. Valid values are: 'Classic', 'Basic', 'Standard', 'Premium'. | |
sku_tier | text | The SKU tier based on the SKU name. Valid values are: 'Classic', 'Basic', 'Standard', 'Premium'. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
status | text | The current status of the resource. | |
status_message | text | The detailed message for the status, including alerts and error messages. | |
status_timestamp | timestamp with time zone | The timestamp when the status was changed to the current value. | |
storage_account_id | text | The resource ID of the storage account. Only applicable to Classic SKU. | |
subscription_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Azure Subscription ID in which the resource is located. |
system_data | jsonb | Metadata pertaining to creation and last modification of the resource. | |
tags | jsonb | A map of tags for the resource. | |
title | text | Title of the resource. | |
type | text | The type of the resource. | |
usages | jsonb | Specifies the quota usages for the specified container registry. | |
webhooks | jsonb | Webhooks in Azure Container Registry provide a way to trigger custom actions in response to events happening within the registry. | |
zone_redundancy | text | Indicates whether or not zone redundancy is enabled for this container registry. Valid values are: 'Enabled', 'Disabled'. |
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_container_registry