Information
Information system auditing capability is critical for accurate forensic analysis. Without establishing what type of event occurred, it would be difficult to establish, correlate, and investigate the events relating to an incident or identify those responsible for one.
Audit record content that may be necessary to satisfy the requirement of this policy includes, for example, time stamps, user/process identifiers, event descriptions, success/fail indications, filenames involved, and access control or flow control rules invoked.
Associating event types with detected events in the application and audit logs provides a means of investigating an attack; recognizing resource utilization or capacity thresholds; or identifying an improperly configured application.
PostgreSQL is capable of a range of actions on data stored within the database. It is important, for accurate forensic analysis, to know exactly what actions were performed. This requires specific information regarding the event type an audit record is referring to. If event type information is not recorded and stored with the audit record, the record itself is of very limited use.
NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.
Solution
Note: The following instructions use the PGDATA and PGVER environment variables. Refer to APPENDIX-F for instructions on configuring PGDATA and APPENDIX-H for PGVER.
To ensure logging is enabled, see the instructions in the supplementary content APPENDIX-C.
If logging is enabled the following configurations must be made to log connections, date/time, username and session identifier.
Edit the postgresql.conf file as a privileged user:
$ sudo su - postgres
$ vi ${PGDATA?}/postgresql.conf
Edit the following parameters based on the organization's needs (minimum requirements are as follows):
log_connections = on
log_disconnections = on
log_line_prefix = '< %m %u %d %c: >'
As the system administrator, reload the server with the new configuration:
$ sudo systemctl reload postgresql-${PGVER?}