SV-261924r1000777_rule
V-261924
SRG-APP-000380-DB-000360
CD16-00-007800
CAT II
10
Configure PostgreSQL to enforce access restrictions associated with changes to the configuration of PostgreSQL or database(s).
Use ALTER ROLE to remove accesses from roles:
$ psql -c "ALTER ROLE <role_name> NOSUPERUSER"
Use REVOKE to remove privileges from databases and schemas:
$ psql -c "REVOKE ALL PRIVILEGES ON <table> FROM <role_name>"
To list all the permissions of individual roles, as the database administrator (shown here as "postgres"), run the following SQL:
$ sudo su - postgres
$ psql -c "\du"
If any role has SUPERUSER that should not, this is a finding.
List all the permissions of databases and schemas by running the following SQL:
$ sudo su - postgres
$ psql -c "\l"
$ psql -c "\dn+"
If any database or schema has update ("W") or create ("C") privileges and should not, this is a finding.
V-261924
False
CD16-00-007800
To list all the permissions of individual roles, as the database administrator (shown here as "postgres"), run the following SQL:
$ sudo su - postgres
$ psql -c "\du"
If any role has SUPERUSER that should not, this is a finding.
List all the permissions of databases and schemas by running the following SQL:
$ sudo su - postgres
$ psql -c "\l"
$ psql -c "\dn+"
If any database or schema has update ("W") or create ("C") privileges and should not, this is a finding.
M
5598