1. Home
  2. Security Hardening
  3. DISA STIG PostgreSQL 9.x On RHEL OS V2R2
  4. PGS9-00-000710 – PostgreSQL must limit privileges to change functions and triggers, and links to software external to PostgreSQL – config

PGS9-00-000710 – PostgreSQL must limit privileges to change functions and triggers, and links to software external to PostgreSQL – config

Details

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.

Solution

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’

Supportive Information

The following resource is also helpful.

This security hardening control applies to the following category of controls within NIST 800-53: Configuration Management.This control applies to the following type of system Unix.

References

Source

Updated on July 16, 2022
Was this article helpful?

Related Articles