turbot/gcp_compliance

Query: kubernetes_cluster_network_policy_enabled

Usage

powerpipe query gcp_compliance.query.kubernetes_cluster_network_policy_enabled

Steampipe Tables

SQL

select
self_link resource,
case
when (addons_config -> 'NetworkPolicyConfig' ->> 'disabled' = 'true'
or addons_config -> 'NetworkPolicyConfig' -> 'enabled' is null
or addons_config -> 'NetworkPolicyConfig' ->> 'enabled' = 'false'
)
and network_config ->> 'DatapathProvider' <> 'ADVANCED_DATAPATH'
then 'alarm'
else 'ok'
end as status,
case
when (addons_config -> 'NetworkPolicyConfig' ->> 'disabled' = 'true'
or addons_config -> 'NetworkPolicyConfig' -> 'enabled' is null
or addons_config -> 'NetworkPolicyConfig' ->> 'enabled' = 'false'
)
and network_config ->> 'DatapathProvider' <> 'ADVANCED_DATAPATH'
then title || ' network policy disabled.'
else title || ' network policy enabled.'
end as reason
, location as location, project as project
from
gcp_kubernetes_cluster;

Controls

The query is being used by the following controls: