Control: Ensure server parameter 'audit_log_enabled' is set to 'ON' for MySQL flexible Server
Description
Enable audit_log_enabled on MySQL flexible Servers.
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.mysql_flexible_server_audit_logging_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.mysql_flexible_server_audit_logging_enabled --share
SQL
This control uses a named query:
with audit_log_enabled as( select id from azure_mysql_flexible_server, jsonb_array_elements(flexible_server_configurations) as config where config ->> 'Name' = 'audit_log_enabled' and config -> 'ConfigurationProperties' ->> 'value' = 'ON')select s.id as resource, case when a.id is not null then 'ok' else 'alarm' end as status, case when a.id is not null then s.title || ' audit logging enabled.' else s.title || ' audit logging disabled.' end as reason , s.resource_group as resource_group , sub.display_name as subscriptionfrom azure_mysql_flexible_server as s left join audit_log_enabled as a on s.id = a.id, azure_subscription as subwhere sub.subscription_id = s.subscription_id;