Control: Kubernetes clusters should have logging enabled
Description
This control checks if OMS agent is enabled for Kubernetes cluster.
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.kubernetes_cluster_logging_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.kubernetes_cluster_logging_enabled --share
SQL
This control uses a named query:
select c.id as resource, case when addon_profiles -> 'omsAgent' ->> 'enabled' = 'true' and addon_profiles -> 'omsAgent' ->> 'config' is not null then 'ok' else 'alarm' end as status, case when addon_profiles -> 'omsAgent' ->> 'enabled' = 'true' and addon_profiles -> 'omsAgent' ->> 'config' is not null then c.name || ' logging enabled.' else c.name || ' logging disabled.' end as reason , c.resource_group as resource_group , sub.display_name as subscriptionfrom azure_kubernetes_cluster c, azure_subscription subwhere sub.subscription_id = c.subscription_id;