turbot/terraform_azure_compliance

Query: kubernetes_cluster_authorized_ip_range_defined

Usage

powerpipe query terraform_azure_compliance.query.kubernetes_cluster_authorized_ip_range_defined

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std ->> 'private_cluster_enabled') = 'true' then 'ok'
when (jsonb_array_length(attributes_std -> 'api_server_authorized_ip_ranges') > 0) or (jsonb_array_length(attributes_std -> 'api_server_access_profile' -> 'authorized_ip_ranges') > 0) then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'private_cluster_enabled') = 'true' then ' is private cluster'
when (jsonb_array_length(attributes_std -> 'api_server_authorized_ip_ranges') > 0) or (jsonb_array_length(attributes_std -> 'api_server_access_profile' -> 'authorized_ip_ranges') > 0 ) then ' authorized IP ranges defined'
else ' authorized IP ranges not defined'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_kubernetes_cluster';

Controls

The query is being used by the following controls: