Control: Ensure server parameter 'log_checkpoints' is set to 'ON' for PostgreSQL flexible Server
Description
Enable 'log_checkpoints' on 'PostgreSQL Servers'.
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.postgres_flexible_server_log_checkpoints_on
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.postgres_flexible_server_log_checkpoints_on --share
SQL
This control uses a named query:
with log_checkpoints_on as( select id from azure_postgresql_flexible_server, jsonb_array_elements(flexible_server_configurations) as config where config ->> 'Name' = 'log_checkpoints' 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 || ' server parameter log_checkpoints on.' else s.title || ' server parameter log_checkpoints off.' end as reason , s.resource_group as resource_group , sub.display_name as subscriptionfrom azure_postgresql_flexible_server as s left join log_checkpoints_on as a on s.id = a.id, azure_subscription as subwhere sub.subscription_id = s.subscription_id;