PGS9-00-010700 - PostgreSQL must protect its audit features from unauthorized access - roles.

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

Protecting audit data also includes identifying and protecting the tools used to view and manipulate log data.

Depending upon the log format and application, system and application log tools may provide the only means to manipulate and manage application and system log data. It is, therefore, imperative that access to audit tools be controlled and protected from unauthorized access.

Applications providing tools to interface with audit data will leverage user permissions and roles identifying the user accessing the tools and the corresponding rights the user enjoys in order make access decisions regarding the access to audit tools.

Audit tools include, but are not limited to, OS-provided audit tools, vendor-provided audit tools, and open source audit tools needed to successfully view and manipulate audit information system activity and records.

If an attacker were to gain access to audit tools, he could analyze audit logs for system weaknesses or weaknesses in the auditing itself. An attacker could also manipulate logs to hide evidence of malicious activity.

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. See supplementary content APPENDIX-F for instructions on configuring PGDATA and APPENDIX-H for PGVER.

If pg_log or data directory are not owned by postgres user and group, configure them as follows:

$ sudo chown -R postgres:postgres ${PGDATA?}

If the pgaudit installation is not owned by root user and group, configure it as follows:

$ sudo chown -R root:root /usr/pgsql-${PGVER?}/share/contrib/pgaudit

To remove superuser from a role, as the database administrator (shown here as 'postgres'), run the following SQL:

$ sudo su - postgres
$ psql -c 'ALTER ROLE <role-name> WITH NOSUPERUSER'

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_PGS_SQL_9-x_V2R4_STIG.zip

Item Details

References: CAT|II, CCI|CCI-001493, Rule-ID|SV-214141r879579_rule, STIG-ID|PGS9-00-010700, STIG-Legacy|SV-87691, STIG-Legacy|V-73039, Vuln-ID|V-214141

Plugin: Unix

Control ID: 79c5c409c4357572258d0f4066d78b92f9b6014563f4a7b75e1843c1b6b3bd23