CD12-00-004150 - PostgreSQL must disable network functions, ports, protocols, and services deemed by the organization to be nonsecure, in accord with the Ports, Protocols, and Services Management (PPSM) guidance.

Information

Use of nonsecure network functions, ports, protocols, and services exposes the system to avoidable threats.

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 change the listening port of the database, as the database administrator, change the following setting in postgresql.conf:

$ sudo su - postgres
$ vi $PGDATA/postgresql.conf

Change the port parameter to the desired port.

Next, restart the database:

$ sudo systemctl restart postgresql-${PGVER?}

Note: psql uses the port 5432 by default. This can be changed by specifying the port with psql or by setting the PGPORT environment variable:

$ psql -p 5432 -c 'SHOW port'
$ export PGPORT=5432

See Also

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

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-7(1)(b), CAT|II, CCI|CCI-001762, Rule-ID|SV-233548r961470_rule, STIG-ID|CD12-00-004150, Vuln-ID|V-233548

Plugin: Unix

Control ID: b7622de5c48cb1d1884de08d616f5b5d39867beee91070f8e4a9e6fbc0438e99