EP11-00-006600 - The EDB Postgres Advanced Server must reveal detailed error messages only to the ISSO, ISSM, SA, and DBA.

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

If EDB Postgres Advanced Server provides too much information in error logs and administrative messages to the screen, this could lead to compromise. The structure and content of error messages need to be carefully considered by the organization and development team. The extent to which the information system is able to identify and handle error conditions is guided by organizational policy and operational requirements.

Some default EDB Postgres Advanced Server error messages can contain information that could aid an attacker in, among others things, identifying the database type, host address, or state of the database. Custom errors may contain sensitive customer information.

It is important that detailed error messages be visible only to those who are authorized to view them; that general users receive only generalized acknowledgment that errors have occurred; and that these generalized messages appear only when relevant to the user's task. For example, a message along the lines of, 'An error has occurred. Unable to save your changes. If this problem persists, please contact your help desk' would be relevant. A message such as 'Warning: your transaction generated a large number of page splits' would likely not be relevant.

Administrative users authorized to review detailed error messages typically are the ISSO, ISSM, SA, and DBA. Other individuals or roles may be specified according to organization-specific needs, with appropriate approval.

In addition to ensuring that access to EDB Postgres Advanced Server database and audit logs is restricted to authorized users and that EDB Postgres Advanced Server is configured to emit minimal information to clients related to Postgres generated errors, custom database code and external application code should also be designed to not emit detailed error messages to a client. This calls for inspection of application source code, which will require collaboration with the application developers. It is recognized that in many cases, the database administrator (DBA) is organizationally separate from the application developers, and may have limited, if any, access to source code. Nevertheless, protections of this type are so important to the secure operation of databases that they must not be ignored. At a minimum, the DBA must attempt to obtain assurances from the development organization that this issue has been addressed, and must document what has been discovered.

NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.

Solution

# Set client_min_messages
To set the level of detail for errors messages exposed to clients, connect to the database as a database superuser using psql and execute the following commands:

ALTER SYSTEM SET client_min_messages = notice;
SELECT pg_reload_conf();

# Update EDB Postgres Advanced Server database log permissions.
If the EDB Postgres Advanced Server log_destination parameter is set to 'stderr' or 'csvlog':

1) Change ownership of EDB Postgres Advanced Server database log directory and its contents to the database service account if they are not owned by the database service account.

If the EDB Postgres Advanced Server database log directory and its contents are not owned by the database service account, change ownership to the service account responsible for running the Advanced Server database service.

This may be done using Windows Explorer:
Browse to the directory where the log directory folder is located.
Select and right-click on the folder, select 'Properties', select the 'Securities' tab, and select the 'Advanced' button.
Select the 'Change' link shown next to the owner of the folder to change the folder's owner.

Alternatively, the Windows TAKEOWN command or the ICACLS command (with the /SETOWNER option) may be used to change ownership of folders and files using the Windows command prompt.

2) Modify permissions on the EDB Postgres Advanced Server database log directory and its contents to meet the requirement to protect against unauthorized access.

This may be done using Windows Explorer:
Browse to the directory where the log directory folder is located.
Select and right-click on the folder, select 'Properties', and select the 'Security' tab.
Modify the security permissions to:
NT AUTHORITY/NetworkService (or configured database service account) (Full Control)
Administrators (Read)
Users (none)

Alternatively, the Windows ICACLS command may be used to modify permissions on folders and files using the Windows command prompt.

If the EDB Postgres Advanced Server log_destination parameter is set to 'eventlog', update the Windows policy settings to only allow access to the Windows Application event log to authorized users.

If other permissions have been granted to other users or groups, ensure that the system documentation is updated to note the organizationally approved permission setting and corresponding justification of the permission settings for this requirement.

# Update EDB Audit log permissions.
1) Change ownership of EDB Audit directory and its contents to the database service account if they are not owned by the database service account.

If the EDB Audit directory and its contents are not owned by the database service account, change ownership to the service account responsible for running the Advanced Server database service.

This may be done using Windows Explorer:
Browse to the directory where the EDB audit directory folder is located.
Select and right-click on the folder, select 'Properties', select the 'Securities' tab, and select the 'Advanced' button.
Select the 'Change' link shown next to the owner of the folder to change the folder's owner.

Alternatively, the Windows TAKEOWN command or the ICACLS command (with the /SETOWNER option) may be used to change ownership of folders and files using the Windows command prompt.

2) Modify permissions on the EDB Audit directory and its contents to meet the requirement to protect against unauthorized access.

This may be done using Windows Explorer:
Browse to the directory where the EDB audit directory folder is located.
Select and right-click on the folder, select 'Properties', and select the 'Security' tab.
Modify the security permissions to:
NT AUTHORITY/NetworkService (or configured database service account) (Full Control)
Administrators (Read)
Users (none)

Alternatively, the Windows ICACLS command may be used to modify permissions on folders and files using the Windows command prompt.

If other permissions have been granted to other users or groups, ensure that the system documentation is updated to note the organizationally approved permission setting and corresponding justification of the permission settings for this requirement.

# Update custom database code and application code
Configure custom database code and associated application code not to display detailed error messages to those not authorized to view them.

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_EDB_PGS_Advanced_Server_v11_Windows_V2R2_STIG.zip

Item Details

References: CAT|II, CCI|CCI-001314, Rule-ID|SV-224186r508023_rule, STIG-ID|EP11-00-006600, STIG-Legacy|SV-109499, STIG-Legacy|V-100395, Vuln-ID|V-224186

Plugin: PostgreSQLDB

Control ID: abe41b1f7ae67d72bcfbd1418521392858c13b604e745c869418f8f564e17617