Compliancemanzill.com
CIS Microsoft Azure Foundations Benchmark v1.4.0

CIS Microsoft Azure Foundations Benchmark v1.4.0/Database Services/63 of 115

4.3.6Ensure server parameter 'log_retention_days' is greater than 3 days for PostgreSQL Database Server

Control family: Database Services

Control description

Enable 'log_retention_days' on 'PostgreSQL Servers'.

How to implement

ResponsibilityCustomerYou configure and operate this in your own cloud accounts.

Server logs are deleted after the retention period. Keeping them for more than 3 days (the flexible server allows up to 7) leaves time to investigate a problem found after a weekend; ship them to Log Analytics for anything longer. Azure Database for PostgreSQL Single Server was retired on 28 March 2025, so this applies to flexible servers.

Before you start

The same on every cloud, before the steps in the tabs.

  • Record in the PostgreSQL flexible server configuration standard that logfiles.retention_days is at least 4 (up to 7), so every new server starts with it.
  • Send server logs to Log Analytics if you need them for longer.

Evidence

  • The PostgreSQL flexible server configuration standard

On Azure the tasks set the server parameter on each Azure Database for PostgreSQL flexible server, then keep it checked across servers with Azure Policy or a configuration review.

Task 1Set logfiles.retention_days on each flexible server

  1. Sign in to the Azure portal at portal.azure.com and open Azure Database for PostgreSQL flexible servers.
  2. Select the server, then Settings > Server parameters.
  3. Search for logfiles.retention_days and set its value to 7.
  4. Select Save; if the parameter is static, restart the server in a quiet period when asked.
  5. Check it: searching Server parameters for logfiles.retention_days shows 7.

Task 2Keep it checked across servers

  1. Open Policy > Definitions and search for PostgreSQL flexible servers.
  2. If a built-in definition audits logfiles.retention_days, select it, select Assign, set Scope to the subscription and select Review + create > Create.
  3. Otherwise, add the parameter to the checklist used when a new server is created and to the quarterly configuration review.
  4. Check it: Policy > Compliance shows every flexible server compliant, or the review record lists each server's value.

Evidence

  • Server parameters of each flexible server, showing logfiles.retention_days set to 7
  • The Azure Policy compliance results, or the configuration review record

Console steps as of 5 November 2026. Not every step has been confirmed in a live console yet, and menus and labels can move between releases, so look for the nearest match if one has changed.