4.3 Ensure excessive administrative privileges are revoked

Warning! Audit Deprecated

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

View Next Audit Version

Information

With respect to PostgreSQL administrative SQL commands, only superusers should have elevated privileges. PostgreSQL regular or application users should not possess the ability to create roles, create new databases, manage replication, or perform any other action deemed privileged for a superuser account. Typically, regular users should only be granted the minimal set of privileges commensurate with managing the application:
DDL (create table, create view, create index, etc.)
DML (select, insert, update, delete)
Rationale:
By not restricting global administrative commands to superusers only, regular users granted excessive privileges may execute administrative commands with unintended and undesirable results.
NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.

Solution

If any regular or application users have been granted excessive administrative rights, those privileges should be removed immediately via the PostgreSQL ALTER ROLE SQL command. Using the same example above, the following SQL statements revoke all unnecessary elevated administrative privileges from the regular user appuser:
$ psql -c 'ALTER ROLE appuser NOSUPERUSER;'
ALTER ROLE
$ psql -c 'ALTER ROLE appuser NOCREATEROLE;'
ALTER ROLE
$ psql -c 'ALTER ROLE appuser NOCREATEDB;'
ALTER ROLE
$ psql -c 'ALTER ROLE appuser NOREPLICATION;'
ALTER ROLE
$ psql -c 'ALTER ROLE appuser NOBYPASSRLS;'
ALTER ROLE
$ psql -c 'ALTER ROLE appuser NOINHERIT;'
ALTER ROLE
Verify the appuser now passes your check by having no defined Attributes:
$ psql -c 'du appuser'
List of roles
Role name | Attributes | Member of
----------+------------+-----------
appuser | | {}

See Also

https://workbench.cisecurity.org/files/2063

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-2, CSCv6|5.1

Plugin: Unix

Control ID: 8043e9d201020ca55cdab6ed65d7034c27e20ce4cda6a6e98433ce14d41c40f3