Overview

Enabling the log_truncate_on_rotation setting when logging_collector is enabled causes PostgreSQL to truncate (overwrite) existing log files with the same name during log rotation instead of appending to them. For example, using this setting in combination with a log_filename setting value like postgresql-%H.log would result in generating 24 hourly log files and then cyclically overwriting them: Note: Truncation will occur only when a new file is being opened due to time-based rotation, not during server startup or size-based rotation (see later in this benchmark for size-based rotation details).

Excelent Compliance Solution.

Puppet is an excellent solution to ensure your databases are CIS or STIG compliant. Now you’re looking at information about only one compliance control, but managing total compliance isn’t hard either!

If you you like he prospect of easy way into continuous compliancy with minimal fuss and bother, we suggest taking a look at our solution as your go-to option. Plus, our team can help you get up and running so that you can focus on other areas of your business. What are you waiting for? Get started today!

Benchmarks

This control is used in the following benchmarks:

Skipping

To deliberately skip this control (e.g. meaning don’t use Puppet to enforce this setting), we provide you with three ways:

1) Add pg_secured::controls::log_truncate_on_rotation_is_enabled: skip to your hiera data. This will skip this control for ALL databases.
2) Add pg_secured::controls::log_truncate_on_rotation_is_enabled::dbname: skip to your hiera data. This will skip this control for specified database only.
3) Add an entry with the content log_truncate_on_rotation_is_enabled to the array value pg_secured::skip_list in your hiera data.

Attributes

Attribute Name Short Description
title The instance to apply the control to.

title

The instance to apply the control to.

All controls need an instance to apply the control to. Here is a simple example:

pg_secured::controls::control_name { 'instance':}

In this example, the string instance is the instance to apply the control to.

Back to overview of controls::log_truncate_on_rotation_is_enabled