4.8 Make use of default roles

Information

PostgreSQL provides a set of default roles which provide access to certain, commonly needed, privileged capabilities and information. Administrators can GRANT these roles to users and/or other roles in their environment, providing those users with access to the specified capabilities and information.

Rationale:

In keeping with the principle of least privilege, judicious use of the PostgreSQL default roles can greatly limit the access to privileged, or superuser, access.


NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.

Solution

If you've determined that one or more of the default roles can be used, simply GRANT it:
postgres=# GRANT pg_monitor TO doug;
GRANT ROLE
And then remove superuser from the account:

postgres=# ALTER ROLE doug NOSUPERUSER;
ALTER ROLE
postgres=# select rolname from pg_roles where rolsuper is true;
rolname
----------
postgres
(1 row)

Default Value:

The following default roles exist in PostgreSQL 10.x:
* pg_read_all_settings Read all configuration variables, even those normally visible only to superusers.
* pg_read_all_stats Read all pg_stat_* views and use various statistics related extensions, even those normally visible only to superusers.
* pg_stat_scan_tables Execute monitoring functions that may take ACCESS SHARE locks on tables, potentially for a long time.
* pg_signal_backend Send signals to other backends (eg: cancel query, terminate).
* pg_monitor Read/execute various monitoring views and functions. This role is a member of pg_read_all_settings, pg_read_all_stats and pg_stat_scan_tables.
Administrators can grant access to these roles to users using the GRANT command.

See Also

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

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-3, CSCv7|14.6, CSCv7|14.7

Plugin: PostgreSQLDB

Control ID: 3baaf9ca77e254f936a29965a17c125b28c59cba1863f1760ef1682e494a5a5d