CD12-00-000710 - PostgreSQL must limit privileges to change functions and triggers, and links to software external to PostgreSQL.

Information

If the system were to allow any user to make changes to software libraries, those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.

Accordingly, only qualified and authorized individuals must be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.

Unmanaged changes that occur to the database code can lead to unauthorized or compromised installations.

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 environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA.

To change ownership of an object, as the database administrator (shown here as 'postgres'), run the following SQL:

$ sudo su - postgres
$ psql -c 'ALTER FUNCTION function_name OWNER TO new_role_name'

To change ownership of postgresql.conf, as the database administrator (shown here as 'postgres'), run the following commands:

$ sudo su - postgres
$ chown postgres:postgres ${PGDATA?}/postgresql.conf
$ chmod 0600 ${PGDATA?}/postgresql.conf

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 rolename WITH NOSUPERUSER'

See Also

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

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-5(6), CAT|II, CCI|CCI-001499, Rule-ID|SV-233518r960960_rule, STIG-ID|CD12-00-000710, Vuln-ID|V-233518

Plugin: Unix

Control ID: 02f163ca98ba344143e49476a5c1b897d236059fcd53bc79b41fcfb243de25a9