CD12-00-009500 - If passwords are used for authentication, PostgreSQL must store only hashed, salted representations of passwords.

Information

The DOD standard for authentication is DOD-approved PKI certificates.

Authentication based on User ID and Password may be used only when it is not possible to employ a PKI certificate, and requires Authorizing Official (AO) approval.

In such cases, database passwords stored in clear text, using reversible encryption, or using unsalted hashes would be vulnerable to unauthorized disclosure. Database passwords must always be in the form of one-way, salted hashes when stored internally or externally to PostgreSQL.

Solution

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.

To enable password_encryption, as the database administrator, edit postgresql.conf:

$ sudo su - postgres
$ vi ${PGDATA?}/postgresql.conf
password_encryption = 'scram-sha-256'

Institute a policy of not using the 'WITH UNENCRYPTED PASSWORD' option with the CREATE ROLE/USER and ALTER ROLE/USER commands. This option overrides the setting of the password_encryption configuration parameter.

As the system administrator, restart the server with the new configuration:

# SYSTEMD SERVER ONLY
$ sudo systemctl restart postgresql-${PGVER?}

See Also

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

Item Details

Category: IDENTIFICATION AND AUTHENTICATION

References: 800-53|IA-5(1)(d), CAT|I, CCI|CCI-004062, Rule-ID|SV-233596r998202_rule, STIG-ID|CD12-00-009500, Vuln-ID|V-233596

Plugin: PostgreSQLDB

Control ID: 69bf9dfb523ca66ceb525e2840baf61ad228af091c1de4462c2c203d2effd1af