SV-261864r1000597_rule
V-261864
SRG-APP-000091-DB-000325
CD16-00-000800
CAT II
10
Configure PostgreSQL to produce audit records when unsuccessful attempts to access privileges occur.
All denials are logged if logging is enabled. To ensure logging is enabled, see the instructions in the supplementary content APPENDIX-C.
Note: The following instructions use the PGLOG environment variables. Refer to supplementary content APPENDIX-I for instructions on configuring PGLOG.
As the database administrator (shown here as "postgres"), create a role "bob" by running the following SQL:
$ sudo su - postgres
$ psql -c "CREATE ROLE bob"
Attempt to retrieve information from the pg_authid table:
$ psql -c "SET ROLE bob; SELECT * FROM pg_authid"
$ psql -c "DROP ROLE bob;"
As the database administrator (shown here as "postgres"), verify the event was logged in PGLOG:
$ sudo su - postgres
$ cat ${PGLOG?}/<latest_log>
< 2024-02-13 16:49:58.864 UTC postgres postgres ERROR: > permission denied for relation pg_authid
< 2024-02-13 16:49:58.864 UTC postgres postgres STATEMENT: > SELECT * FROM pg_authid
If the above steps cannot verify that audit records are produced when PostgreSQL denies retrieval of privileges/permissions/role memberships, this is a finding.
V-261864
False
CD16-00-000800
Note: The following instructions use the PGLOG environment variables. Refer to supplementary content APPENDIX-I for instructions on configuring PGLOG.
As the database administrator (shown here as "postgres"), create a role "bob" by running the following SQL:
$ sudo su - postgres
$ psql -c "CREATE ROLE bob"
Attempt to retrieve information from the pg_authid table:
$ psql -c "SET ROLE bob; SELECT * FROM pg_authid"
$ psql -c "DROP ROLE bob;"
As the database administrator (shown here as "postgres"), verify the event was logged in PGLOG:
$ sudo su - postgres
$ cat ${PGLOG?}/<latest_log>
< 2024-02-13 16:49:58.864 UTC postgres postgres ERROR: > permission denied for relation pg_authid
< 2024-02-13 16:49:58.864 UTC postgres postgres STATEMENT: > SELECT * FROM pg_authid
If the above steps cannot verify that audit records are produced when PostgreSQL denies retrieval of privileges/permissions/role memberships, this is a finding.
M
5598