From PostgreSQL 9.x Security Technical Implementation Guide
Part of SRG-APP-000099-DB-000043
Associated with: CCI-000134
Information system auditing capability is critical for accurate forensic analysis. Without information about the outcome of events, security personnel cannot make an accurate assessment as to whether an attack was successful or if changes were made to the security state of the system.
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA.
As a database administrator (shown here as "postgres"), create a table, insert a value, alter the table and update the table by running the following SQL:
CREATE TABLE stig_test(id INT);
INSERT INTO stig_test(id) VALUES (0);
ALTER TABLE stig_test ADD COLUMN name text;
UPDATE stig_test SET id = 1 WHERE id = 0;
Next, as a user without access to the stig_test table, run the following SQL:
INSERT INTO stig_test(id) VALUES (1);
ALTER TABLE stig_test DROP COLUMN name;
UPDATE stig_test SET id = 0 WHERE id = 1;
The prior SQL should generate errors:
ERROR: permission denied for relation stig_test
ERROR: must be owner of relation stig_test
ERROR: permission denied for relation stig_test
Now, as the database administrator, drop the test table by running the following SQL:
DROP TABLE stig_test;
Now verify the errors were logged:
$ sudo su - postgres
$ cat ${PGDATA?}/pg_log/
Using pgaudit PostgreSQL can be configured to audit various facets of PostgreSQL. See supplementary content APPENDIX-B for documentation on installing pgaudit. All errors, denials and unsuccessful requests are logged if logging is enabled. See supplementary content APPENDIX-C for documentation on enabling logging. Note: The following instructions use the PGDATA and PGVER environment variables. See supplementary content APPENDIX-F for instructions on configuring PGDATA and APPENDIX-H for PGVER. With pgaudit and logging enabled, set the following configuration settings in postgresql.conf, as the database administrator (shown here as "postgres"), to the following: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf pgaudit.log_catalog='on' pgaudit.log_level='log' pgaudit.log_parameter='on' pgaudit.log_statement_once='off' pgaudit.log='all, -misc' Next, tune the following logging configurations in postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf log_line_prefix = '< %m %u %d %e: >' log_error_verbosity = default Last, as the system administrator, restart PostgreSQL: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
Lavender hyperlinks in small type off to the right (of CSS
class id
, if you view the page source) point to
globally unique URIs for each document and item. Copy the
link location and paste anywhere you need to talk
unambiguously about these things.
You can obtain data about documents and items in other
formats. Simply provide an HTTP header Accept:
text/turtle
or
Accept: application/rdf+xml
.
Powered by sagemincer