turbot/steampipe-mod-azure-compliance

Control: Kubernetes cluster should restrict public access

Description

Ensure that Kubernetes cluster enables private clusters to restrict public access.

Usage

Run the control in your terminal:

powerpipe control run azure_compliance.control.kubernetes_cluster_restrict_public_access

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run azure_compliance.control.kubernetes_cluster_restrict_public_access --share

SQL

This control uses a named query:

select
c.id as resource,
case
when api_server_access_profile ->> 'enablePrivateCluster' = 'true' then 'ok'
else 'alarm'
end as status,
case
when api_server_access_profile ->> 'enablePrivateCluster' = 'true' then c.name || ' not publicly accessible.'
else c.name || ' publicly accessibe.'
end as reason
, c.resource_group as resource_group
, sub.display_name as subscription
from
azure_kubernetes_cluster c,
azure_subscription sub
where
sub.subscription_id = c.subscription_id;

Tags