Check: PGS9-00-003700
PostgreSQL 9.x STIG:
PGS9-00-003700
(in versions v2 r4 through v1 r2)
Title
When invalid inputs are received, PostgreSQL must behave in a predictable and documented manner that reflects organizational and system objectives. (Cat II impact)
Discussion
A common vulnerability is unplanned behavior when invalid inputs are received. This requirement guards against adverse or unintended system behavior caused by invalid inputs, where information system responses to the invalid input may be disruptive or cause the system to fail into an unsafe state. The behavior will be derived from the organizational and system requirements and includes, but is not limited to, notification of the appropriate personnel, creating an audit record, and rejecting invalid input.
Check Content
As the database administrator (shown here as "postgres"), make a small SQL syntax error in psql by running the following: $ sudo su - postgres $ psql -c "CREAT TABLEincorrect_syntax(id INT)" ERROR: syntax error at or near "CREAT" Note: The following instructions use the PGVER environment variable. See supplementary content APPENDIX-H for instructions on configuring PGVER. Now, as the database administrator (shown here as "postgres"), verify the syntax error was logged (change the log file name and part to suit the circumstances): $ sudo su - postgres $ cat ~/${PGVER?}/data/pg_log/postgresql-Wed.log 2016-03-30 16:18:10.772 EDT postgres postgres 5706bb87.90dERROR: syntax error at or near "CREAT" at character 1 2016-03-30 16:18:10.772 EDT postgres postgres 5706bb87.90dSTATEMENT: CREAT TABLE incorrect_syntax(id INT); Review system documentation to determine how input errors from application to PostgreSQL are to be handled in general and if any special handling is defined for specific circumstances. If it does not implement the documented behavior, this is a finding.
Fix Text
Enable logging. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. All errors and denials are logged if logging is enabled.
Additional Identifiers
Rule ID: SV-214079r879818_rule
Vulnerability ID: V-214079
Group Title: SRG-APP-000447-DB-000393
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-002754 |
The information system behaves in a predictable and documented manner that reflects organizational and system objectives when invalid inputs are received. |
Controls
Number | Title |
---|---|
SI-10 (3) |
Predictable Behavior |