UCF STIG Viewer Logo

PostgreSQL must record time stamps, in audit records and application data that can be mapped to Coordinated Universal Time (UTC, formerly GMT).


Finding ID Version Rule ID IA Controls Severity
V-233532 CD12-00-002400 SV-233532r606821_rule Medium
If time stamps are not consistently applied and there is no common time reference, it is difficult to perform forensic analysis. Time stamps generated by PostgreSQL must include date and time. Time is commonly expressed in UTC, a modern continuation of GMT, or local time with an offset from UTC.
Crunchy Data PostgreSQL Security Technical Implementation Guide 2022-06-13


Check Text ( C-36726r606819_chk )
When a PostgreSQL cluster is initialized using initdb, the PostgreSQL cluster will be configured to use the same time zone as the target server.

As the database administrator (shown here as "postgres"), check the current log_timezone setting by running the following SQL:

$ sudo su - postgres
$ psql -c "SHOW log_timezone"

(1 row)

If log_timezone is not set to the desired time zone, this is a finding.
Fix Text (F-36691r606820_fix)
Note: The following instructions use the PGDATA and PGVER environment variables. See supplementary content APPENDIX-F for instructions on configuring PGDATA and APPENDIX-H for PGVER.

To change log_timezone in postgresql.conf to use a different time zone for logs, as the database administrator (shown here as "postgres"), run the following:

$ sudo su - postgres
$ vi ${PGDATA?}/postgresql.conf

Next, restart the database:

$ sudo systemctl reload postgresql-${PGVER?}