PostgreSQL 9.x Security Technical Implementation Guide
Pick two releases to diff their requirements.
Open a previous version of this STIG.
Digest of Updates +110 −110
Comparison against the immediately-prior release (V1R7). Rule matching uses the Group Vuln ID. Content-change detection compares the rule’s description, check, and fix text after stripping inline markup — cosmetic-only edits aren’t flagged.
Added rules 110
- V-214048 Medium PostgreSQL must be configured to prohibit or restrict the use of organization-defined functions, ports, protocols, and/or services, as defined in the PPSM CAL and vulnerability assessments.
- V-214049 Medium PostgreSQL must produce audit records containing sufficient information to establish the outcome (success or failure) of the events.
- V-214050 High Security-relevant software updates to PostgreSQL must be installed within the time period directed by an authoritative source (e.g., IAVM, CTOs, DTMs, and STIGs).
- V-214051 Medium The audit information produced by PostgreSQL must be protected from unauthorized modification.
- V-214052 Medium PostgreSQL must integrate with an organization-level authentication/access mechanism providing account management and automation for all users, groups, roles, and any other principals.
- V-214053 Medium PostgreSQL must provide non-privileged users with error messages that provide information necessary for corrective actions without revealing information that could be exploited by adversaries.
- V-214054 Medium Privileges to change PostgreSQL software modules must be limited.
- V-214055 Medium PostgreSQL must limit privileges to change functions and triggers, and links to software external to PostgreSQL.
- V-214056 Medium If passwords are used for authentication, PostgreSQL must transmit only encrypted representations of passwords.
- V-214057 Medium PostgreSQL must enforce approved authorizations for logical access to information and system resources in accordance with applicable access control policies.
- V-214058 Medium PostgreSQL must associate organization-defined types of security labels having organization-defined security label values with information in transmission.
- V-214059 Medium PostgreSQL must limit the number of concurrent sessions to an organization-defined number per user for all accounts and/or account types.
- V-214060 Medium The role(s)/group(s) used to modify database structure (including but not necessarily limited to tables, indexes, storage, etc.) and logic modules (functions, trigger procedures, links to software external to PostgreSQL, etc.) must be restricted to authorized users.
- V-214061 Medium PostgreSQL must uniquely identify and authenticate non-organizational users (or processes acting on behalf of non-organizational users).
- V-214062 Medium PostgreSQL must associate organization-defined types of security labels having organization-defined security label values with information in storage.
- V-214063 Medium PostgreSQL must check the validity of all data inputs except those specifically identified by the organization.
- V-214064 Medium PostgreSQL and associated applications must reserve the use of dynamic code execution for situations that require it.
- V-214065 Medium PostgreSQL and associated applications, when making use of dynamic code execution, must scan input data for invalid values that may indicate a code injection attack.
- V-214066 Medium PostgreSQL must allocate audit record storage capacity in accordance with organization-defined audit record storage requirements.
- V-214067 Medium PostgreSQL must enforce discretionary access control policies, as defined by the data owner, over defined subjects and objects.
- V-214068 Medium The audit information produced by PostgreSQL must be protected from unauthorized deletion.
- V-214069 Medium PostgreSQL must record time stamps, in audit records and application data, that can be mapped to Coordinated Universal Time (UTC, formerly GMT).
- V-214070 Medium PostgreSQL must reveal detailed error messages only to the ISSO, ISSM, SA and DBA.
- V-214071 Medium PostgreSQL must allow only the ISSM (or individuals or roles appointed by the ISSM) to select which auditable events are to be audited.
- V-214072 Medium PostgreSQL must provide an immediate real-time alert to appropriate support staff of all audit log failures.
- V-214073 Medium PostgreSQL must maintain the confidentiality and integrity of information during reception.
- V-214074 Medium Database objects (including but not limited to tables, indexes, storage, trigger procedures, functions, links to software external to PostgreSQL, etc.) must be owned by database/DBMS principals authorized for ownership.
- V-214075 Medium The PostgreSQL software installation account must be restricted to authorized users.
- V-214076 Medium Database software, including PostgreSQL configuration files, must be stored in dedicated directories separate from the host OS and other applications.
- V-214077 Medium PostgreSQL must include additional, more detailed, organization-defined information in the audit records for audit events identified by type, location, or subject.
- V-214078 Medium Execution of software modules (to include functions and trigger procedures) with elevated privileges must be restricted to necessary cases only.
- V-214079 Medium When invalid inputs are received, PostgreSQL must behave in a predictable and documented manner that reflects organizational and system objectives.
- V-214080 Medium PostgreSQL must utilize centralized management of the content captured in audit records generated by all components of PostgreSQL.
- V-214081 Medium PostgreSQL must isolate security functions from non-security functions.
- V-214082 Medium PostgreSQL must produce audit records of its enforcement of access restrictions associated with changes to the configuration of PostgreSQL or database(s).
- V-214083 Medium The audit information produced by PostgreSQL must be protected from unauthorized read access.
- V-214084 Medium When updates are applied to PostgreSQL software, any software components that have been replaced or made unnecessary must be removed.
- V-214085 Medium PostgreSQL must generate audit records when categorized information (e.g., classification levels/security levels) is accessed.
- V-214086 Medium PostgreSQL must generate audit records when unsuccessful attempts to access security objects occur.
- V-214087 Medium PostgreSQL must generate audit records when unsuccessful logons or connection attempts occur.
- V-214088 Medium PostgreSQL must generate audit records showing starting and ending time for user access to the database(s).
- V-214089 Medium PostgreSQL must generate audit records when unsuccessful attempts to modify security objects occur.
- V-214090 Medium PostgreSQL must generate audit records when privileges/permissions are added.
- V-214091 Medium PostgreSQL must generate audit records when unsuccessful attempts to delete categorized information (e.g., classification levels/security levels) occur.
- V-214092 Medium PostgreSQL must generate audit records when successful logons or connections occur.
- V-214093 Medium PostgreSQL must generate audit records when security objects are deleted.
- V-214094 Medium PostgreSQL must generate audit records when unsuccessful attempts to retrieve privileges/permissions occur.
- V-214095 Medium PostgreSQL must generate audit records when unsuccessful attempts to delete privileges/permissions occur.
- V-214096 Medium PostgreSQL must be able to generate audit records when privileges/permissions are retrieved.
- V-214097 Medium PostgreSQL must generate audit records when unsuccessful attempts to modify categorized information (e.g., classification levels/security levels) occur.
- V-214098 Medium PostgreSQL must generate audit records when unsuccessful accesses to objects occur.
- V-214099 Medium PostgreSQL must generate audit records for all privileged activities or other system-level access.
- V-214100 Medium PostgreSQL must generate audit records when unsuccessful attempts to access categorized information (e.g., classification levels/security levels) occur.
- V-214101 Medium PostgreSQL must be able to generate audit records when security objects are accessed.
- V-214102 Medium PostgreSQL must generate audit records when privileges/permissions are deleted.
- V-214103 Medium PostgreSQL must generate audit records when concurrent logons/connections by the same user from different workstations occur.
- V-214104 Medium PostgreSQL must generate audit records when unsuccessful attempts to delete security objects occur.
- V-214105 Medium PostgreSQL must generate audit records when privileges/permissions are modified.
- V-214106 Medium PostgreSQL must generate audit records when unsuccessful attempts to execute privileged activities or other system-level access occur.
- V-214107 Medium PostgreSQL must generate audit records when security objects are modified.
- V-214108 Medium PostgreSQL must generate audit records when categorized information (e.g., classification levels/security levels) is modified.
- V-214109 Medium PostgreSQL must generate audit records when unsuccessful attempts to modify privileges/permissions occur.
- V-214110 Medium PostgreSQL must generate audit records when unsuccessful attempts to add privileges/permissions occur.
- V-214111 Medium PostgreSQL, when utilizing PKI-based authentication, must validate certificates by performing RFC 5280-compliant certification path validation.
- V-214112 Medium PostgreSQL must produce audit records containing sufficient information to establish where the events occurred.
- V-214113 Medium PostgreSQL must maintain the confidentiality and integrity of information during preparation for transmission.
- V-214114 Medium PostgreSQL must provide audit record generation capability for DoD-defined auditable events within all DBMS/database components.
- V-214115 Medium PostgreSQL must generate time stamps, for audit records and application data, with a minimum granularity of one second.
- V-214116 Medium PostgreSQL must produce audit records containing sufficient information to establish the identity of any user/subject or process associated with the event.
- V-214117 High PostgreSQL must implement NIST FIPS 140-2 validated cryptographic modules to generate and validate cryptographic hashes.
- V-214119 High PostgreSQL must implement NIST FIPS 140-2 validated cryptographic modules to protect unclassified information requiring confidentiality and cryptographic protection, in accordance with the data owners requirements.
- V-214120 Medium PostgreSQL must protect the confidentiality and integrity of all information at rest.
- V-214121 Medium PostgreSQL must prohibit user installation of logic modules (functions, trigger procedures, views, etc.) without explicit privileged status.
- V-214122 Medium PostgreSQL must separate user functionality (including user interface services) from database management functionality.
- V-214123 Medium PostgreSQL must initiate session auditing upon startup.
- V-214124 Medium PostgreSQL must implement cryptographic mechanisms to prevent unauthorized modification of organization-defined information at rest (to include, at a minimum, PII and classified information) on organization-defined information system components.
- V-214125 Medium PostgreSQL must produce audit records containing sufficient information to establish the sources (origins) of the events.
- V-214126 Medium Unused database components, PostgreSQL software, and database objects must be removed.
- V-214127 Medium Access to external executables must be disabled or restricted.
- V-214128 Medium Unused database components which are integrated in PostgreSQL and cannot be uninstalled must be disabled.
- V-214129 Medium PostgreSQL must associate organization-defined types of security labels having organization-defined security label values with information in process.
- V-214130 Medium If passwords are used for authentication, PostgreSQL must store only hashed, salted representations of passwords.
- V-214131 Medium PostgreSQL must enforce access restrictions associated with changes to the configuration of PostgreSQL or database(s).
- V-214132 Medium PostgreSQL must protect against a user falsely repudiating having performed organization-defined actions.
- V-214133 Medium The system must provide a warning to appropriate support staff when allocated audit record storage volume reaches 75% of maximum audit record storage capacity.
- V-214134 Medium PostgreSQL must provide the means for individuals in authorized roles to change the auditing to be performed on all application components, based on all selectable event criteria within organization-defined time thresholds.
- V-214135 Medium PostgreSQL must require users to reauthenticate when organization-defined circumstances or situations require reauthentication.
- V-214136 High PostgreSQL must enforce authorized access to all PKI private keys stored/utilized by PostgreSQL.
- V-214137 Medium PostgreSQL must only accept end entity certificates issued by DoD PKI or DoD-approved PKI Certification Authorities (CAs) for the establishment of all encrypted sessions.
- V-214138 Medium PostgreSQL must produce audit records containing sufficient information to establish what type of events occurred.
- V-214139 Medium PostgreSQL must implement cryptographic mechanisms preventing the unauthorized disclosure of organization-defined information at rest on organization-defined information system components.
- V-214140 Medium PostgreSQL must invalidate session identifiers upon user logout or other session termination.
- V-214141 Medium PostgreSQL must protect its audit features from unauthorized access.
- V-214142 Medium PostgreSQL must produce audit records containing time stamps to establish when the events occurred.
- V-214143 Medium PostgreSQL must protect its audit features from unauthorized removal.
- V-214144 Medium PostgreSQL must off-load audit data to a separate log management facility; this must be continuous and in near real time for systems with a network connection to the storage facility and weekly or more often for stand-alone systems.
- V-214145 Medium PostgreSQL must maintain the authenticity of communications sessions by guarding against man-in-the-middle attacks that guess at Session ID values.
- V-214146 Medium PostgreSQL must uniquely identify and authenticate organizational users (or processes acting on behalf of organizational users).
- V-214147 Medium PostgreSQL must automatically terminate a user session after organization-defined conditions or trigger events requiring session disconnect.
- V-214148 High PostgreSQL must prevent non-privileged users from executing privileged functions, to include disabling, circumventing, or altering implemented security safeguards/countermeasures.
- V-214149 Medium PostgreSQL must map the PKI-authenticated identity to an associated user account.
- V-214150 Medium Database contents must be protected from unauthorized and unintended information transfer by enforcement of a data-transfer policy.
- V-214151 Medium Access to database files must be limited to relevant processes and to authorized, administrative users.
- V-214152 Medium PostgreSQL must protect its audit configuration from unauthorized modification.
- V-214153 High PostgreSQL must use NIST FIPS 140-2 validated cryptographic modules for cryptographic operations.
- V-214154 Medium Audit records must be generated when categorized information (e.g., classification levels/security levels) is deleted.
- V-214155 Medium PostgreSQL must generate audit records when successful accesses to objects occur.
- V-214156 Medium PostgreSQL must generate audit records for all direct access to the database(s).
- V-214157 High The DBMS must be configured on a platform that has a NIST certified FIPS 140-2 installation of OpenSSL.
- V-220321 Medium PostgreSQL must use NSA-approved cryptography to protect classified information in accordance with the data owners requirements.
Removed rules 110
- V-72841 Medium PostgreSQL must be configured to prohibit or restrict the use of organization-defined functions, ports, protocols, and/or services, as defined in the PPSM CAL and vulnerability assessments.
- V-72843 Medium PostgreSQL must produce audit records containing sufficient information to establish the outcome (success or failure) of the events.
- V-72845 High Security-relevant software updates to PostgreSQL must be installed within the time period directed by an authoritative source (e.g., IAVM, CTOs, DTMs, and STIGs).
- V-72847 Medium The audit information produced by PostgreSQL must be protected from unauthorized modification.
- V-72849 Medium PostgreSQL must integrate with an organization-level authentication/access mechanism providing account management and automation for all users, groups, roles, and any other principals.
- V-72851 Medium PostgreSQL must provide non-privileged users with error messages that provide information necessary for corrective actions without revealing information that could be exploited by adversaries.
- V-72853 Medium Privileges to change PostgreSQL software modules must be limited.
- V-72855 Medium PostgreSQL must limit privileges to change functions and triggers, and links to software external to PostgreSQL.
- V-72857 Medium If passwords are used for authentication, PostgreSQL must transmit only encrypted representations of passwords.
- V-72859 Medium PostgreSQL must enforce approved authorizations for logical access to information and system resources in accordance with applicable access control policies.
- V-72861 Medium PostgreSQL must associate organization-defined types of security labels having organization-defined security label values with information in transmission.
- V-72863 Medium PostgreSQL must limit the number of concurrent sessions to an organization-defined number per user for all accounts and/or account types.
- V-72865 Medium The role(s)/group(s) used to modify database structure (including but not necessarily limited to tables, indexes, storage, etc.) and logic modules (functions, trigger procedures, links to software external to PostgreSQL, etc.) must be restricted to authorized users.
- V-72867 Medium PostgreSQL must uniquely identify and authenticate non-organizational users (or processes acting on behalf of non-organizational users).
- V-72869 Medium PostgreSQL must associate organization-defined types of security labels having organization-defined security label values with information in storage.
- V-72871 Medium PostgreSQL must check the validity of all data inputs except those specifically identified by the organization.
- V-72873 Medium PostgreSQL and associated applications must reserve the use of dynamic code execution for situations that require it.
- V-72875 Medium PostgreSQL and associated applications, when making use of dynamic code execution, must scan input data for invalid values that may indicate a code injection attack.
- V-72877 Medium PostgreSQL must allocate audit record storage capacity in accordance with organization-defined audit record storage requirements.
- V-72883 Medium PostgreSQL must enforce discretionary access control policies, as defined by the data owner, over defined subjects and objects.
- V-72885 Medium The audit information produced by PostgreSQL must be protected from unauthorized deletion.
- V-72887 Medium PostgreSQL must record time stamps, in audit records and application data, that can be mapped to Coordinated Universal Time (UTC, formerly GMT).
- V-72889 Medium PostgreSQL must reveal detailed error messages only to the ISSO, ISSM, SA and DBA.
- V-72891 Medium PostgreSQL must allow only the ISSM (or individuals or roles appointed by the ISSM) to select which auditable events are to be audited.
- V-72893 Medium PostgreSQL must provide an immediate real-time alert to appropriate support staff of all audit log failures.
- V-72895 Medium PostgreSQL must maintain the confidentiality and integrity of information during reception.
- V-72897 Medium Database objects (including but not limited to tables, indexes, storage, trigger procedures, functions, links to software external to PostgreSQL, etc.) must be owned by database/DBMS principals authorized for ownership.
- V-72899 Medium The PostgreSQL software installation account must be restricted to authorized users.
- V-72901 Medium Database software, including PostgreSQL configuration files, must be stored in dedicated directories separate from the host OS and other applications.
- V-72903 Medium PostgreSQL must include additional, more detailed, organization-defined information in the audit records for audit events identified by type, location, or subject.
- V-72905 Medium Execution of software modules (to include functions and trigger procedures) with elevated privileges must be restricted to necessary cases only.
- V-72907 Medium When invalid inputs are received, PostgreSQL must behave in a predictable and documented manner that reflects organizational and system objectives.
- V-72909 Medium PostgreSQL must utilize centralized management of the content captured in audit records generated by all components of PostgreSQL.
- V-72911 Medium PostgreSQL must isolate security functions from non-security functions.
- V-72913 Medium PostgreSQL must produce audit records of its enforcement of access restrictions associated with changes to the configuration of PostgreSQL or database(s).
- V-72915 Medium The audit information produced by PostgreSQL must be protected from unauthorized read access.
- V-72917 Medium When updates are applied to PostgreSQL software, any software components that have been replaced or made unnecessary must be removed.
- V-72919 Medium PostgreSQL must generate audit records when categorized information (e.g., classification levels/security levels) is accessed.
- V-72921 Medium PostgreSQL must generate audit records when unsuccessful attempts to access security objects occur.
- V-72923 Medium PostgreSQL must generate audit records when unsuccessful logons or connection attempts occur.
- V-72925 Medium PostgreSQL must generate audit records showing starting and ending time for user access to the database(s).
- V-72927 Medium PostgreSQL must generate audit records when unsuccessful attempts to modify security objects occur.
- V-72929 Medium PostgreSQL must generate audit records when privileges/permissions are added.
- V-72931 Medium PostgreSQL must generate audit records when unsuccessful attempts to delete categorized information (e.g., classification levels/security levels) occur.
- V-72933 Medium PostgreSQL must generate audit records when successful logons or connections occur.
- V-72939 Medium PostgreSQL must generate audit records when security objects are deleted.
- V-72941 Medium PostgreSQL must generate audit records when unsuccessful attempts to retrieve privileges/permissions occur.
- V-72945 Medium PostgreSQL must generate audit records when unsuccessful attempts to delete privileges/permissions occur.
- V-72947 Medium PostgreSQL must be able to generate audit records when privileges/permissions are retrieved.
- V-72949 Medium PostgreSQL must generate audit records when unsuccessful attempts to modify categorized information (e.g., classification levels/security levels) occur.
- V-72951 Medium PostgreSQL must generate audit records when unsuccessful accesses to objects occur.
- V-72953 Medium PostgreSQL must generate audit records for all privileged activities or other system-level access.
- V-72955 Medium PostgreSQL must generate audit records when unsuccessful attempts to access categorized information (e.g., classification levels/security levels) occur.
- V-72957 Medium PostgreSQL must be able to generate audit records when security objects are accessed.
- V-72959 Medium PostgreSQL must generate audit records when privileges/permissions are deleted.
- V-72961 Medium PostgreSQL must generate audit records when concurrent logons/connections by the same user from different workstations occur.
- V-72963 Medium PostgreSQL must generate audit records when unsuccessful attempts to delete security objects occur.
- V-72965 Medium PostgreSQL must generate audit records when privileges/permissions are modified.
- V-72969 Medium PostgreSQL must generate audit records when unsuccessful attempts to execute privileged activities or other system-level access occur.
- V-72971 Medium PostgreSQL must generate audit records when security objects are modified.
- V-72973 Medium PostgreSQL must generate audit records when categorized information (e.g., classification levels/security levels) is modified.
- V-72975 Medium PostgreSQL must generate audit records when unsuccessful attempts to modify privileges/permissions occur.
- V-72977 Medium PostgreSQL must generate audit records when unsuccessful attempts to add privileges/permissions occur.
- V-72979 Medium PostgreSQL, when utilizing PKI-based authentication, must validate certificates by performing RFC 5280-compliant certification path validation.
- V-72981 Medium PostgreSQL must maintain the confidentiality and integrity of information during preparation for transmission.
- V-72983 Medium PostgreSQL must provide audit record generation capability for DoD-defined auditable events within all DBMS/database components.
- V-72985 Medium PostgreSQL must generate time stamps, for audit records and application data, with a minimum granularity of one second.
- V-72987 Medium PostgreSQL must produce audit records containing sufficient information to establish the identity of any user/subject or process associated with the event.
- V-72989 High PostgreSQL must implement NIST FIPS 140-2 validated cryptographic modules to generate and validate cryptographic hashes.
- V-72991 Medium PostgreSQL must use NSA-approved cryptography to protect classified information in accordance with the data owners requirements.
- V-72993 High PostgreSQL must implement NIST FIPS 140-2 validated cryptographic modules to protect unclassified information requiring confidentiality and cryptographic protection, in accordance with the data owners requirements.
- V-72995 Medium PostgreSQL must protect the confidentiality and integrity of all information at rest.
- V-72997 Medium PostgreSQL must prohibit user installation of logic modules (functions, trigger procedures, views, etc.) without explicit privileged status.
- V-72999 Medium PostgreSQL must separate user functionality (including user interface services) from database management functionality.
- V-73001 Medium PostgreSQL must initiate session auditing upon startup.
- V-73003 Medium PostgreSQL must implement cryptographic mechanisms to prevent unauthorized modification of organization-defined information at rest (to include, at a minimum, PII and classified information) on organization-defined information system components.
- V-73005 Medium PostgreSQL must produce audit records containing sufficient information to establish the sources (origins) of the events.
- V-73007 Medium Unused database components, PostgreSQL software, and database objects must be removed.
- V-73009 Medium Access to external executables must be disabled or restricted.
- V-73011 Medium Unused database components which are integrated in PostgreSQL and cannot be uninstalled must be disabled.
- V-73013 Medium PostgreSQL must associate organization-defined types of security labels having organization-defined security label values with information in process.
- V-73015 Medium If passwords are used for authentication, PostgreSQL must store only hashed, salted representations of passwords.
- V-73017 Medium PostgreSQL must enforce access restrictions associated with changes to the configuration of PostgreSQL or database(s).
- V-73019 Medium PostgreSQL must protect against a user falsely repudiating having performed organization-defined actions.
- V-73023 Medium The system must provide a warning to appropriate support staff when allocated audit record storage volume reaches 75% of maximum audit record storage capacity.
- V-73025 Medium PostgreSQL must provide the means for individuals in authorized roles to change the auditing to be performed on all application components, based on all selectable event criteria within organization-defined time thresholds.
- V-73027 Medium PostgreSQL must require users to reauthenticate when organization-defined circumstances or situations require reauthentication.
- V-73029 High PostgreSQL must enforce authorized access to all PKI private keys stored/utilized by PostgreSQL.
- V-73031 Medium PostgreSQL must only accept end entity certificates issued by DoD PKI or DoD-approved PKI Certification Authorities (CAs) for the establishment of all encrypted sessions.
- V-73033 Medium PostgreSQL must produce audit records containing sufficient information to establish what type of events occurred.
- V-73035 Medium PostgreSQL must implement cryptographic mechanisms preventing the unauthorized disclosure of organization-defined information at rest on organization-defined information system components.
- V-73037 Medium PostgreSQL must invalidate session identifiers upon user logout or other session termination.
- V-73039 Medium PostgreSQL must protect its audit features from unauthorized access.
- V-73041 Medium PostgreSQL must produce audit records containing time stamps to establish when the events occurred.
- V-73043 Medium PostgreSQL must protect its audit features from unauthorized removal.
- V-73045 Medium PostgreSQL must off-load audit data to a separate log management facility; this must be continuous and in near real time for systems with a network connection to the storage facility and weekly or more often for stand-alone systems.
- V-73047 Medium PostgreSQL must maintain the authenticity of communications sessions by guarding against man-in-the-middle attacks that guess at Session ID values.
- V-73049 Medium PostgreSQL must uniquely identify and authenticate organizational users (or processes acting on behalf of organizational users).
- V-73051 Medium PostgreSQL must automatically terminate a user session after organization-defined conditions or trigger events requiring session disconnect.
- V-73053 High PostgreSQL must prevent non-privileged users from executing privileged functions, to include disabling, circumventing, or altering implemented security safeguards/countermeasures.
- V-73055 Medium PostgreSQL must map the PKI-authenticated identity to an associated user account.
- V-73057 Medium Database contents must be protected from unauthorized and unintended information transfer by enforcement of a data-transfer policy.
- V-73059 Medium Access to database files must be limited to relevant processes and to authorized, administrative users.
- V-73061 Medium PostgreSQL must protect its audit configuration from unauthorized modification.
- V-73063 High PostgreSQL must use NIST FIPS 140-2 validated cryptographic modules for cryptographic operations.
- V-73065 Medium Audit records must be generated when categorized information (e.g., classification levels/security levels) is deleted.
- V-73067 Medium PostgreSQL must generate audit records when successful accesses to objects occur.
- V-73069 Medium PostgreSQL must generate audit records for all direct access to the database(s).
- V-73071 High The DBMS must be configured on a platform that has a NIST certified FIPS 140-2 installation of OpenSSL.
- V-73123 Medium PostgreSQL must produce audit records containing sufficient information to establish where the events occurred.
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000382
- Version
- PGS9-00-000100
- Vuln IDs
-
- V-214048
- V-72841
- Rule IDs
-
- SV-214048r508027_rule
- SV-87493
Checks: C-15264r360775_chk
As the database administrator, run the following SQL: $ psql -c "SHOW port" If the currently defined port configuration is deemed prohibited, this is a finding.
Fix: F-15262r360776_fix
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: # SYSTEMD SERVER ONLY $ sudo systemctl restart postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} restart Note: psql uses the default 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
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-000134
- Version
- PGS9-00-000200
- Vuln IDs
-
- V-214049
- V-72843
- Rule IDs
-
- SV-214049r508027_rule
- SV-87495
Checks: C-15265r360778_chk
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/<latest_logfile>$PGDATA/ < 2016-02-23 14:51:31.103 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >LOG: AUDIT: SESSION,1,1,DDL,CREATE TABLE,,,CREATE TABLE stig_test(id INT);,<none> < 2016-02-23 14:51:44.835 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >LOG: AUDIT: SESSION,2,1,WRITE,INSERT,,,INSERT INTO stig_test(id) VALUES (0);,<none> < 2016-02-23 14:53:25.805 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >LOG: AUDIT: SESSION,3,1,DDL,ALTER TABLE,,,ALTER TABLE stig_test ADD COLUMN name text;,<none> < 2016-02-23 14:53:54.381 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >LOG: AUDIT: SESSION,4,1,WRITE,UPDATE,,,UPDATE stig_test SET id = 1 WHERE id = 0;,<none> < 2016-02-23 14:54:20.832 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >ERROR: permission denied for relation stig_test < 2016-02-23 14:54:20.832 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >STATEMENT: INSERT INTO stig_test(id) VALUES (1); < 2016-02-23 14:54:41.032 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >ERROR: must be owner of relation stig_test < 2016-02-23 14:54:41.032 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >STATEMENT: ALTER TABLE stig_test DROP COLUMN name; < 2016-02-23 14:54:54.378 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >ERROR: permission denied for relation stig_test < 2016-02-23 14:54:54.378 EDT psql postgres postgres 570bf22a.3af2 2016-04-11 14:51:22 EDT [local] >STATEMENT: UPDATE stig_test SET id = 0 WHERE id = 1; < 2016-02-23 14:55:23.723 EDT psql postgres postgres 570bf307.3b0a 2016-04-11 14:55:03 EDT [local] >LOG: AUDIT: SESSION,1,1,DDL,DROP TABLE,,,DROP TABLE stig_test;,<none> If audit records exist without the outcome of the event that occurred, this is a finding.
Fix: F-15263r360779_fix
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
- RMF Control
- SI-2
- Severity
- H
- CCI
- CCI-002605
- Version
- PGS9-00-000300
- Vuln IDs
-
- V-214050
- V-72845
- Rule IDs
-
- SV-214050r508027_rule
- SV-87497
Checks: C-15266r360781_chk
If new packages are available for PostgreSQL, they can be reviewed in the package manager appropriate for the server operating system: To list the version of installed PostgreSQL using psql: $ sudo su - postgres $ psql -–version To list the current version of software for RPM: $ rpm -qa | grep postgres To list the current version of software for APT: $ apt-cache policy postgres All versions of PostgreSQL will be listed on: http://www.postgresql.org/support/versioning/ All security-relevant software updates for PostgreSQL will be listed on: http://www.postgresql.org/support/security/ If PostgreSQL is not at the latest version, this is a finding. If PostgreSQL is not at the latest version and the evaluated version has CVEs (IAVAs), then this is a CAT I finding.
Fix: F-15264r360782_fix
Institute and adhere to policies and procedures to ensure that patches are consistently applied to PostgreSQL within the time allowed.
- RMF Control
- AU-9
- Severity
- M
- CCI
- CCI-000163
- Version
- PGS9-00-000400
- Vuln IDs
-
- V-214051
- V-72847
- Rule IDs
-
- SV-214051r508027_rule
- SV-87499
Checks: C-15267r360784_chk
Review locations of audit logs, both internal to the database and database audit logs located at the operating system level. Verify there are appropriate controls and permissions to protect the audit information from unauthorized modification. Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. #### stderr Logging If the PostgreSQL server is configured to use stderr for logging, the logs will be owned by the database owner (usually postgres user) with a default permissions level of 0600. The permissions can be configured in postgresql.conf. To check the permissions for log files in postgresql.conf, as the database owner (shown here as "postgres"), run the following command: $ sudo su - postgres $ grep "log_file_mode" ${PGDATA?}/postgresql.conf If the permissions are not 0600, this is a finding. Next, navigate to where the logs are stored. This can be found by running the following command against postgresql.conf as the database owner (shown here as "postgres"): $ sudo su - postgres $ grep "log_directory" ${PGDATA?}/postgresql.conf With the log directory identified, as the database owner (shown here as "postgres"), list the permissions of the logs: $ sudo su - postgres $ ls -la ${PGDATA?}/pg_log If logs are not owned by the database owner (shown here as "postgres") and are not the same permissions as configured in postgresql.conf, this is a finding. #### syslog Logging If the PostgreSQL server is configured to use syslog for logging, consult the organization syslog setting for permissions and ownership of logs.
Fix: F-15265r360785_fix
To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. #### stderr Logging With stderr logging enabled, as the database owner (shown here as "postgres"), set the following parameter in postgresql.conf: $ vi ${PGDATA?}/postgresql.conf log_file_mode = 0600 To change the owner and permissions of the log files, run the following: $ chown postgres:postgres ${PGDATA?}/<log directory name> $ chmod 0700 ${PGDATA?}/<log directory name> $ chmod 600 ${PGDATA?}/<log directory name>/*.log #### syslog Logging If PostgreSQL is configured to use syslog for logging, the log files must be configured to be owned by root with 0600 permissions. $ chown root:root <log directory name>/<log_filename> $ chmod 0700 <log directory name> $ chmod 0600 <log directory name>/*.log
- RMF Control
- AC-2
- Severity
- M
- CCI
- CCI-000015
- Version
- PGS9-00-000500
- Vuln IDs
-
- V-214052
- V-72849
- Rule IDs
-
- SV-214052r508027_rule
- SV-87501
Checks: C-15268r360787_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. If all accounts are authenticated by the organization-level authentication/access mechanism, such as LDAP or Kerberos and not by PostgreSQL, this is not a finding. As the database administrator (shown here as "postgres"), review pg_hba.conf authentication file settings: $ sudo su - postgres $ cat ${PGDATA?}/pg_hba.conf All records must use an auth-method of gss, sspi, or ldap. For details on the specifics of these authentication methods see: http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html If there are any records with a different auth-method than gss, sspi, or ldap, review the system documentation for justification and approval of these records. If there are any records with a different auth-method than gss, sspi, or ldap, that are not documented and approved, this is a finding.
Fix: F-15266r360788_fix
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. Integrate PostgreSQL security with an organization-level authentication/access mechanism providing account management for all users, groups, roles, and any other principals. As the database administrator (shown here as "postgres"), edit pg_hba.conf authentication file: $ sudo su - postgres $ vi ${PGDATA?}/pg_hba.conf For each PostgreSQL-managed account that is not documented and approved, either transfer it to management by the external mechanism, or document the need for it and obtain approval, as appropriate.
- RMF Control
- SI-11
- Severity
- M
- CCI
- CCI-001312
- Version
- PGS9-00-000600
- Vuln IDs
-
- V-214053
- V-72851
- Rule IDs
-
- SV-214053r508027_rule
- SV-87503
Checks: C-15269r360790_chk
As the database administrator, run the following SQL: SELECT current_setting('client_min_messages'); If client_min_messages is not set to error, this is a finding.
Fix: F-15267r360791_fix
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. As the database administrator, edit "postgresql.conf": $ sudo su - postgres $ vi $PGDATA/postgresql.conf Change the client_min_messages parameter to be "error": client_min_messages = error Reload the server with the new configuration (this just reloads settings currently in memory; it will not cause an interruption): # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- PGS9-00-000700
- Vuln IDs
-
- V-214054
- V-72853
- Rule IDs
-
- SV-214054r508027_rule
- SV-87505
Checks: C-15270r360793_chk
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. As the database administrator (shown here as "postgres"), check the permissions of configuration files for the database: $ sudo su - postgres $ ls -la ${PGDATA?} If any files are not owned by the database owner or have permissions allowing others to modify (write) configuration files, this is a finding. As the server administrator, check the permissions on the shared libraries for PostgreSQL: $ sudo ls -la /usr/pgsql-${PGVER?} $ sudo ls -la /usr/pgsql-${PGVER?}/bin $ sudo ls -la /usr/pgsql-${PGVER?}/include $ sudo ls -la /usr/pgsql-${PGVER?}/lib $ sudo ls -la /usr/pgsql-${PGVER?}/share If any files are not owned by root or have permissions allowing others to modify (write) configuration files, this is a finding.
Fix: F-15268r360794_fix
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. As the database administrator (shown here as "postgres"), change the ownership and permissions of configuration files in PGDATA: $ sudo su - postgres $ chown postgres:postgres ${PGDATA?}/postgresql.conf $ chmod 0600 ${PGDATA?}/postgresql.conf As the server administrator, change the ownership and permissions of shared objects in /usr/pgsql-${PGVER?}/*.so $ sudo chown root:root /usr/pgsql-${PGVER?}/lib/*.so $ sudo chmod 0755 /usr/pgsql-${PGVER?}/lib/*.so As the service administrator, change the ownership and permissions of executables in /usr/pgsql-${PGVER?}/bin: $ sudo chown root:root /usr/pgsql-${PGVER?}/bin/* $ sudo chmod 0755 /usr/pgsql-${PGVER?}/bin/*
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- PGS9-00-000710
- Vuln IDs
-
- V-214055
- V-72855
- Rule IDs
-
- SV-214055r508027_rule
- SV-87507
Checks: C-15271r360796_chk
Only owners of objects can change them. To view all functions, triggers, and trigger procedures, their ownership and source, as the database administrator (shown here as "postgres") run the following SQL: $ sudo su - postgres $ psql -x -c "\df+" Only the OS database owner user (shown here as "postgres") or a PostgreSQL superuser can change links to external software. As the database administrator (shown here as "postgres"), check the permissions of configuration files for the database: $ sudo su - postgres $ ls -la ${PGDATA?} If any files are not owned by the database owner or have permissions allowing others to modify (write) configuration files, this is a finding.
Fix: F-15269r360797_fix
To change ownership of an object, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su – postgres $ psql -c "ALTER FUNCTION function_name OWNER TO new_role_name" To change ownership of postgresql.conf, as the database administrator (shown here as "postgres"), run the following commands: $ sudo su - postgres $ chown postgres:postgres ${PGDATA?}/postgresql.conf $ chmod 0600 ${PGDATA?}/postgresql.conf To remove superuser from a role, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "ALTER ROLE rolename WITH NOSUPERUSER"
- RMF Control
- IA-5
- Severity
- M
- CCI
- CCI-000197
- Version
- PGS9-00-000800
- Vuln IDs
-
- V-214056
- V-72857
- Rule IDs
-
- SV-214056r508027_rule
- SV-87509
Checks: C-15272r360799_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. As the database administrator (shown here as "postgres"), review the authentication entries in pg_hba.conf: $ sudo su - postgres $ cat ${PGDATA?}/pg_hba.conf If any entries use the auth_method (last column in records) "password", this is a finding.
Fix: F-15270r360800_fix
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. As the database administrator (shown here as "postgres"), edit pg_hba.conf authentication file and change all entries of "password" to "md5": $ sudo su - postgres $ vi ${PGDATA?}/pg_hba.conf host all all .example.com md5
- RMF Control
- AC-3
- Severity
- M
- CCI
- CCI-000213
- Version
- PGS9-00-000900
- Vuln IDs
-
- V-214057
- V-72859
- Rule IDs
-
- SV-214057r508027_rule
- SV-87511
Checks: C-15273r360802_chk
From the system security plan or equivalent documentation, determine the appropriate permissions on database objects for each kind (group role) of user. If this documentation is missing, this is a finding. First, as the database administrator (shown here as "postgres"), check the privileges of all roles in the database by running the following SQL: $ sudo su - postgres $ psql -c '\du' Review all roles and their associated privileges. If any roles' privileges exceed those documented, this is a finding. Next, as the database administrator (shown here as "postgres"), check the configured privileges for tables and columns by running the following SQL: $ sudo su - postgres $ psql -c '\dp' Review all access privileges and column access privileges list. If any roles' privileges exceed those documented, this is a finding. Next, as the database administrator (shown here as "postgres"), check the configured authentication settings in pg_hba.conf: $ sudo su - postgres $ cat ${PGDATA?}/pg_hba.conf Review all entries and their associated authentication methods. If any entries do not have their documented authentication requirements, this is a finding.
Fix: F-15271r360803_fix
Create and/or maintain documentation of each group role's appropriate permissions on database objects. Implement these permissions in the database, and remove any permissions that exceed those documented. - - - - - The following are examples of how to use role privileges in PostgreSQL to enforce access controls. For a complete list of privileges, see the official documentation: https://www.postgresql.org/docs/current/static/sql-createrole.html #### Roles Example 1 The following example demonstrates how to create an admin role with CREATEDB and CREATEROLE privileges. As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE admin WITH CREATEDB CREATEROLE" #### Roles Example 2 The following example demonstrates how to create a role with a password that expires and makes the role a member of the "admin" group. As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE joe LOGIN ENCRYPTED PASSWORD 'stig2016!' VALID UNTIL '2016-09-20' IN ROLE admin" #### Roles Example 3 The following demonstrates how to revoke privileges from a role using REVOKE. As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "REVOKE admin FROM joe" #### Roles Example 4 The following demonstrates how to alter privileges in a role using ALTER. As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "ALTER ROLE joe NOLOGIN" The following are examples of how to use grant privileges in PostgreSQL to enforce access controls on objects. For a complete list of privileges, see the official documentation: https://www.postgresql.org/docs/current/static/sql-grant.html #### Grant Example 1 The following example demonstrates how to grant INSERT on a table to a role. As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "GRANT SELECT ON stig_test TO joe" #### Grant Example 2 The following example demonstrates how to grant ALL PRIVILEGES on a table to a role. As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "GRANT ALL PRIVILEGES ON stig_test TO joe" #### Grant Example 3 The following example demonstrates how to grant a role to a role. As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "GRANT admin TO joe" #### Revoke Example 1 The following example demonstrates how to revoke access from a role. As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "REVOKE admin FROM joe" To change authentication requirements for the database, as the database administrator (shown here as "postgres"), edit pg_hba.conf: $ sudo su - postgres $ vi ${PGDATA?}/pg_hba.conf Edit authentication requirements to the organizational requirements. See the official documentation for the complete list of options for authentication: http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html After changes to pg_hba.conf, reload the server: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AC-16
- Severity
- M
- CCI
- CCI-002264
- Version
- PGS9-00-001100
- Vuln IDs
-
- V-214058
- V-72861
- Rule IDs
-
- SV-214058r508027_rule
- SV-87513
Checks: C-15274r360805_chk
If security labeling is not required, this is not a finding. First, as the database administrator (shown here as "postgres"), run the following SQL against each table that requires security labels: $ sudo su - postgres $ psql -c "\d+ <schema_name>.<table_name>" If security labeling is required and the results of the SQL above do not show a policy attached to the table, this is a finding. If security labeling is required and not implemented according to the system documentation, such as SSP, this is a finding. If security labeling requirements have been specified, but the security labeling is not implemented or does not reliably maintain labels on information in storage, this is a finding.
Fix: F-15272r360806_fix
In addition to the SQL-standard privilege system available through GRANT, tables can have row security policies that restrict, on a per-user basis, which rows can be returned by normal queries or inserted, updated, or deleted by data modification commands. This feature is also known as Row-Level Security(RLS). RLS policies can be very different depending on their use case. For one example of using RLS for Security Labels, see supplementary content APPENDIX-D.
- RMF Control
- AC-10
- Severity
- M
- CCI
- CCI-000054
- Version
- PGS9-00-001200
- Vuln IDs
-
- V-214059
- V-72863
- Rule IDs
-
- SV-214059r508027_rule
- SV-87515
Checks: C-15275r360808_chk
To check the total amount of connections allowed by the database, as the database administrator, run the following SQL: $ sudo su - postgres $ psql -c "SHOW max_connections" If the total amount of connections is greater than documented by an organization, this is a finding. To check the amount of connections allowed for each role, as the database administrator, run the following SQL: $ sudo su - postgres $ psql -c "SELECT rolname, rolconnlimit from pg_authid" If any roles have more connections configured than documented, this is a finding. A value of -1 indicates Unlimited, and is a finding.
Fix: F-15273r360809_fix
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 configure the maximum amount of connections allowed to the database, as the database administrator (shown here as "postgres") change the following in postgresql.conf (the value 10 is an example; set the value to suit local conditions): $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf max_connections = 10 Next, restart the database: # SYSTEMD SERVER ONLY $ sudo systemctl restart postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} restart To limit the amount of connections allowed by a specific role, as the database administrator, run the following SQL: $ psql -c "ALTER ROLE <rolname> CONNECTION LIMIT 1";
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- PGS9-00-001300
- Vuln IDs
-
- V-214060
- V-72865
- Rule IDs
-
- SV-214060r508027_rule
- SV-87517
Checks: C-15276r505254_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. As the database administrator (shown here as "postgres"), list all users and their permissions by running the following SQL: $ sudo su - postgres $ psql -c "\dp *.*" Verify that all objects have the correct privileges. If they do not, this is a finding. Next, as the database administrator (shown here as "postgres"), verify the permissions of the database directory on the filesystem: $ ls -la ${PGDATA?} If permissions of the database directory are not limited to an authorized user account, this is a finding.
Fix: F-15274r505255_fix
As the database administrator, revoke any permissions from a role that are deemed unnecessary by running the following SQL: ALTER ROLE bob NOCREATEDB; ALTER ROLE bob NOCREATEROLE; ALTER ROLE bob NOSUPERUSER; ALTER ROLE bob NOINHERIT; REVOKE SELECT ON some_function FROM bob;
- RMF Control
- IA-8
- Severity
- M
- CCI
- CCI-000804
- Version
- PGS9-00-001400
- Vuln IDs
-
- V-214061
- V-72867
- Rule IDs
-
- SV-214061r508027_rule
- SV-87519
Checks: C-15277r360814_chk
PostgreSQL uniquely identifies and authenticates PostgreSQL users through the use of DBMS roles. To list all roles in the database, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "\du" If users are not uniquely identified as per organizational documentation, this is a finding.
Fix: F-15275r360815_fix
To drop a role, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "DROP ROLE <role_to_drop>" To create a role, as the database administrator, run the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE <role name> LOGIN" For the complete list of permissions allowed by roles, see the official documentation: https://www.postgresql.org/docs/current/static/sql-createrole.html
- RMF Control
- AC-16
- Severity
- M
- CCI
- CCI-002262
- Version
- PGS9-00-001700
- Vuln IDs
-
- V-214062
- V-72869
- Rule IDs
-
- SV-214062r508027_rule
- SV-87521
Checks: C-15278r360817_chk
If security labeling is not required, this is not a finding. First, as the database administrator (shown here as "postgres"), run the following SQL against each table that requires security labels: $ sudo su - postgres $ psql -c "\d+ <schema_name>.<table_name>" If security labeling is required and the results of the SQL above do not show a policy attached to the table, this is a finding. If security labeling is required and not implemented according to the system documentation, such as SSP, this is a finding. If security labeling requirements have been specified, but the security labeling is not implemented or does not reliably maintain labels on information in storage, this is a finding.
Fix: F-15276r360818_fix
In addition to the SQL-standard privilege system available through GRANT, tables can have row security policies that restrict, on a per-user basis, which rows can be returned by normal queries or inserted, updated, or deleted by data modification commands. This feature is also known as Row-Level Security (RLS). RLS policies can be very different depending on their use case. For one example of using RLS for Security Labels, see supplementary content APPENDIX-D.
- RMF Control
- SI-10
- Severity
- M
- CCI
- CCI-001310
- Version
- PGS9-00-001800
- Vuln IDs
-
- V-214063
- V-72871
- Rule IDs
-
- SV-214063r508027_rule
- SV-87523
Checks: C-15279r360820_chk
Review PostgreSQL code (trigger procedures, functions), application code, settings, column and field definitions, and constraints to determine whether the database is protected against invalid input. If code exists that allows invalid data to be acted upon or input into the database, this is a finding. If column/field definitions do not exist in the database, this is a finding. If columns/fields do not contain constraints and validity checking where required, this is a finding. Where a column/field is noted in the system documentation as necessarily free-form, even though its name and context suggest that it should be strongly typed and constrained, the absence of these protections is not a finding. Where a column/field is clearly identified by name, caption or context as Notes, Comments, Description, Text, etc., the absence of these protections is not a finding. Check application code that interacts with PostgreSQL for the use of prepared statements. If prepared statements are not used, this is a finding.
Fix: F-15277r360821_fix
Modify database code to properly validate data before it is put into the database or acted upon by the database. Modify the database to contain constraints and validity checking on database columns and tables that require them for data integrity. Use prepared statements when taking user input. Do not allow general users direct console access to PostgreSQL.
- RMF Control
- SI-10
- Severity
- M
- CCI
- CCI-001310
- Version
- PGS9-00-001900
- Vuln IDs
-
- V-214064
- V-72873
- Rule IDs
-
- SV-214064r508027_rule
- SV-87525
Checks: C-15280r360823_chk
Review PostgreSQL source code (trigger procedures, functions) and application source code, to identify cases of dynamic code execution. Any user input should be handled through prepared statements. If dynamic code execution is employed in circumstances where the objective could practically be satisfied by static execution with strongly typed parameters, this is a finding.
Fix: F-15278r360824_fix
Where dynamic code execution is employed in circumstances where the objective could practically be satisfied by static execution with strongly typed parameters, modify the code to do so.
- RMF Control
- SI-10
- Severity
- M
- CCI
- CCI-001310
- Version
- PGS9-00-002000
- Vuln IDs
-
- V-214065
- V-72875
- Rule IDs
-
- SV-214065r508027_rule
- SV-87527
Checks: C-15281r360826_chk
Review PostgreSQL source code (trigger procedures, functions) and application source code to identify cases of dynamic code execution. If dynamic code execution is employed without protective measures against code injection, this is a finding.
Fix: F-15279r360827_fix
Where dynamic code execution is used, modify the code to implement protections against code injection (IE: prepared statements).
- RMF Control
- AU-4
- Severity
- M
- CCI
- CCI-001849
- Version
- PGS9-00-002100
- Vuln IDs
-
- V-214066
- V-72877
- Rule IDs
-
- SV-214066r508027_rule
- SV-87529
Checks: C-15282r360829_chk
Investigate whether there have been any incidents where PostgreSQL ran out of audit log space since the last time the space was allocated or other corrective measures were taken. If there have been incidents where PostgreSQL ran out of audit log space, this is a finding.
Fix: F-15280r360830_fix
Allocate sufficient audit file/table space to support peak demand.
- RMF Control
- AC-3
- Severity
- M
- CCI
- CCI-002165
- Version
- PGS9-00-002200
- Vuln IDs
-
- V-214067
- V-72883
- Rule IDs
-
- SV-214067r508027_rule
- SV-87535
Checks: C-15283r360832_chk
Review system documentation to identify the required discretionary access control (DAC). Review the security configuration of the database and PostgreSQL. If applicable, review the security configuration of the application(s) using the database. If the discretionary access control defined in the documentation is not implemented in the security configuration, this is a finding. If any database objects are found to be owned by users not authorized to own database objects, this is a finding. To check the ownership of objects in the database, as the database administrator, run the following: $ sudo su - postgres $ psql -c "\dn *.*" $ psql -c "\dt *.*" $ psql -c "\ds *.*" $ psql -c "\dv *.*" $ psql -c "\df+ *.*" If any role is given privileges to objects it should not have, this is a finding.
Fix: F-15281r360833_fix
Implement the organization's DAC policy in the security configuration of the database and PostgreSQL, and, if applicable, the security configuration of the application(s) using the database. To GRANT privileges to roles, as the database administrator (shown here as "postgres"), run statements like the following examples: $ sudo su - postgres $ psql -c "CREATE SCHEMA test" $ psql -c "GRANT CREATE ON SCHEMA test TO bob" $ psql -c "CREATE TABLE test.test_table(id INT)" $ psql -c "GRANT SELECT ON TABLE test.test_table TO bob" To REVOKE privileges to roles, as the database administrator (shown here as "postgres"), run statements like the following examples: $ psql -c "REVOKE SELECT ON TABLE test.test_table FROM bob" $ psql -c "REVOKE CREATE ON SCHEMA test FROM bob"
- RMF Control
- AU-9
- Severity
- M
- CCI
- CCI-000164
- Version
- PGS9-00-002300
- Vuln IDs
-
- V-214068
- V-72885
- Rule IDs
-
- SV-214068r508027_rule
- SV-87537
Checks: C-15284r360835_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. Review locations of audit logs, both internal to the database and database audit logs located at the operating system level. Verify there are appropriate controls and permissions to protect the audit information from unauthorized modification. #### stderr Logging If the PostgreSQL server is configured to use stderr for logging, the logs will be owned by the database administrator (shown here as "postgres") with a default permissions level of 0600. The permissions can be configured in postgresql.conf. To check the permissions for log files in postgresql.conf, as the database administrator (shown here as "postgres"), run the following command: $ sudo su - postgres $ grep "log_file_mode" ${PGDATA?}/postgresql.conf If the permissions are not 0600, this is a finding. Next, navigate to where the logs are stored. This can be found by running the following command against postgresql.conf as the database administrator (shown here as "postgres"): $ sudo su - postgres $ grep "log_directory" ${PGDATA?}/postgresql.conf With the log directory identified, as the database administrator (shown here as "postgres"), list the permissions of the logs: $ sudo su - postgres $ ls -la ${PGDATA?}/pg_log If logs are not owned by the database administrator (shown here as "postgres") and are not the same permissions as configured in postgresql.conf, this is a finding. #### syslog Logging If the PostgreSQL server is configured to use syslog for logging, consult organization syslog setting for permissions and ownership of logs
Fix: F-15282r360836_fix
To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. #### stderr Logging With stderr logging enabled, as the database owner (shown here as "postgres"), set the following parameter in postgresql.conf: $ vi ${PGDATA?}/postgresql.conf log_file_mode = 0600 To change the owner and permissions of the log files, run the following: $ chown postgres:postgres ${PGDATA?}/<log directory name> $ chmod 0700 ${PGDATA?}/<log directory name> $ chmod 600 ${PGDATA?}/<log directory name>/*.log #### syslog Logging If PostgreSQL is configured to use syslog for logging, the log files must be configured to be owned by root with 0600 permissions. $ chown root:root <log directory name>/<log_filename> $ chmod 0700 <log directory name> $ chmod 0600 <log directory name>/*.log
- RMF Control
- AU-8
- Severity
- M
- CCI
- CCI-001890
- Version
- PGS9-00-002400
- Vuln IDs
-
- V-214069
- V-72887
- Rule IDs
-
- SV-214069r508027_rule
- SV-87539
Checks: C-15285r360838_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. When a PostgreSQL cluster is initialized using initdb, the PostgreSQL cluster will be configured to use the same time zone as the target server. As the database administrator (shown here as "postgres"), check the current log_timezone setting by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_timezone" log_timezone -------------- UTC (1 row) If log_timezone is not set to the desired time zone, this is a finding.
Fix: F-15283r360839_fix
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 log_timezone in postgresql.conf to use a different time zone for logs, as the database administrator (shown here as "postgres"), run the following: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf log_timezone='UTC' Next, restart the database: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- SI-11
- Severity
- M
- CCI
- CCI-001314
- Version
- PGS9-00-002500
- Vuln IDs
-
- V-214070
- V-72889
- Rule IDs
-
- SV-214070r548749_rule
- SV-87541
Checks: C-15286r360841_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. Check PostgreSQL settings and custom database code to determine if detailed error messages are ever displayed to unauthorized individuals. To check the level of detail for errors exposed to clients, as the database administrator (shown here as "postgres"), run the following: $ sudo su - postgres $ grep "client_min_messages" ${PGDATA?}/postgresql.conf If client_min_messages is set to LOG or DEBUG, this is a finding. If detailed error messages are displayed to individuals not authorized to view them, this is a finding. #### stderr Logging Logs may contain detailed information and should only be accessible by the database owner. As the database administrator, verify the following settings of logs in the postgresql.conf file. Note: Consult the organization's documentation on acceptable log privileges $ sudo su - postgres $ grep log_directory ${PGDATA?}/postgresql.conf $ grep log_file_mode ${PGDATA?}/postgresql.conf Next, verify the log files have the set configurations. Note: Use location of logs from log_directory. $ ls -l <audit_log_path> total 32 -rw-------. 1 postgres postgres 0 Apr 8 00:00 postgresql-Fri.log -rw-------. 1 postgres postgres 8288 Apr 11 17:36 postgresql-Mon.log -rw-------. 1 postgres postgres 0 Apr 9 00:00 postgresql-Sat.log -rw-------. 1 postgres postgres 0 Apr 10 00:00 postgresql-Sun.log -rw-------. 1 postgres postgres 16212 Apr 7 17:05 postgresql-Thu.log -rw-------. 1 postgres postgres 1130 Apr 6 17:56 postgresql-Wed.log If logs are not owned by the database administrator or have permissions that are not 0600, this is a finding. #### syslog Logging If PostgreSQL is configured to use syslog for logging, consult organization location and permissions for syslog log files. If the logs are not owned by root or have permissions that are not 0600, this is a finding.
Fix: F-15284r548748_fix
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. To set the level of detail for errors messages exposed to clients, as the database administrator (shown here as "postgres"), run the following commands: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf client_min_messages = error
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000171
- Version
- PGS9-00-002600
- Vuln IDs
-
- V-214071
- V-72891
- Rule IDs
-
- SV-214071r508027_rule
- SV-87543
Checks: C-15287r360844_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. Check PostgreSQL settings and documentation to determine whether designated personnel are able to select which auditable events are being audited. As the database administrator (shown here as "postgres"), verify the permissions for PGDATA: $ ls -la ${PGDATA?} If anything in PGDATA is not owned by the database administrator, this is a finding. Next, as the database administrator, run the following SQL: $ sudo su - postgres $ psql -c "\du" Review the role permissions, if any role is listed as superuser but should not have that access, this is a finding.
Fix: F-15285r360845_fix
Configure PostgreSQL's settings to allow designated personnel to select which auditable events are audited. Using pgaudit allows administrators the flexibility to choose what they log. For an overview of the capabilities of pgaudit, see https://github.com/pgaudit/pgaudit. See supplementary content APPENDIX-B for documentation on installing pgaudit. See supplementary content APPENDIX-C for instructions on enabling logging. Only administrators/superuser can change PostgreSQL configurations. Access to the database administrator must be limited to designated personnel only. To ensure that postgresql.conf is owned by the database owner: $ chown postgres:postgres ${PGDATA?}/postgresql.conf $ chmod 600 ${PGDATA?}/postgresql.conf
- RMF Control
- AU-5
- Severity
- M
- CCI
- CCI-001858
- Version
- PGS9-00-002700
- Vuln IDs
-
- V-214072
- V-72893
- Rule IDs
-
- SV-214072r508027_rule
- SV-87545
Checks: C-15288r505257_chk
Review DBMS, OS, or third-party logging software settings to determine whether a real-time alert will be sent to the appropriate personnel when auditing fails for any reason. If real-time alerts are not sent upon auditing failure, this is a finding
Fix: F-15286r505258_fix
Configure the system to provide an immediate real-time alert to appropriate support staff when an audit log failure occurs. It is possible to create scripts or implement third-party tools to enable real-time alerting for audit failures in PostgreSQL.
- RMF Control
- SC-8
- Severity
- M
- CCI
- CCI-002422
- Version
- PGS9-00-003000
- Vuln IDs
-
- V-214073
- V-72895
- Rule IDs
-
- SV-214073r548754_rule
- SV-87547
Checks: C-15289r548753_chk
If the data owner does not have a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process, this is not a finding. First, check if ssl is enabled for the database instance. As the database administrator (shown here as "postgres"), verify SSL is enabled by running the following from a command prompt: $ sudo su - postgres $ psql -c "SHOW ssl" If SSL is not enabled, this is a finding. Next, open the pg_hba.conf file in a viewer or editor and review the authentication settings that are configured in that file. Next, verify hostssl entries in pg_hba.conf: $ sudo su - postgres $ grep hostssl ${PGDATA?}/pg_hba.conf If hostssl entries do not contain clientcert=1, this is a finding. If any uncommented lines are not of TYPE "hostssl" and do not include the "clientcert=1" authentication option and are not documented in the system security plan or equivalent document as being approved, this is a finding. If PostgreSQL, associated applications, and infrastructure do not employ protective measures against unauthorized disclosure and modification during reception, this is a finding.
Fix: F-15287r360851_fix
Implement protective measures against unauthorized disclosure and modification during reception. To configure PostgreSQL to use SSL, see supplementary content APPENDIX-G for instructions on enabling SSL.
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- PGS9-00-003100
- Vuln IDs
-
- V-214074
- V-72897
- Rule IDs
-
- SV-214074r508027_rule
- SV-87549
Checks: C-15290r360853_chk
Review system documentation to identify accounts authorized to own database objects. Review accounts that own objects in the database(s). If any database objects are found to be owned by users not authorized to own database objects, this is a finding. To check the ownership of objects in the database, as the database administrator, run the following SQL: $ sudo su - postgres $ psql -x -c "\dn *.*" $ psql -x -c "\dt *.*" $ psql -x -c "\ds *.*" $ psql -x -c "\dv *.*" $ psql -x -c "\df+ *.*" If any object is not owned by an authorized role for ownership, this is a finding.
Fix: F-15288r360854_fix
Assign ownership of authorized objects to authorized object owner accounts. #### Schema Owner To create a schema owned by the user bob, run the following SQL: $ sudo su - postgres $ psql -c "CREATE SCHEMA test AUTHORIZATION bob" To alter the ownership of an existing object to be owned by the user bob, run the following SQL: $ sudo su - postgres $ psql -c "ALTER SCHEMA test OWNER TO bob"
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- PGS9-00-003200
- Vuln IDs
-
- V-214075
- V-72899
- Rule IDs
-
- SV-214075r508027_rule
- SV-87551
Checks: C-15291r360856_chk
Review procedures for controlling, granting access to, and tracking use of the PostgreSQL software installation account(s). If access or use of this account is not restricted to the minimum number of personnel required or if unauthorized access to the account has been granted, this is a finding.
Fix: F-15289r360857_fix
Develop, document, and implement procedures to restrict and track use of the PostgreSQL software installation account.
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001499
- Version
- PGS9-00-003300
- Vuln IDs
-
- V-214076
- V-72901
- Rule IDs
-
- SV-214076r508027_rule
- SV-87553
Checks: C-15292r360859_chk
Review the PostgreSQL software library directory and any subdirectories. If any non-PostgreSQL software directories exist on the disk directory, examine or investigate their use. If any of the directories are used by other applications, including third-party applications that use the PostgreSQL, this is a finding. Only applications that are required for the functioning and administration, not use, of the PostgreSQL software library should be located in the same disk directory as the PostgreSQL software libraries. If other applications are located in the same directory as PostgreSQL, this is a finding.
Fix: F-15290r360860_fix
Install all applications on directories separate from the PostgreSQL software library directory. Relocate any directories or reinstall other application software that currently shares the PostgreSQL software library directory.
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-000135
- Version
- PGS9-00-003500
- Vuln IDs
-
- V-214077
- V-72903
- Rule IDs
-
- SV-214077r508027_rule
- SV-87555
Checks: C-15293r360862_chk
Review the system documentation to identify what additional information the organization has determined necessary. Check PostgreSQL settings and existing audit records to verify that all organization-defined additional, more detailed information is in the audit records for audit events identified by type, location, or subject. If any additional information is defined and is not contained in the audit records, this is a finding.
Fix: F-15291r360863_fix
Configure PostgreSQL audit settings to include all organization-defined detailed information in the audit records for audit events identified by type, location, or subject. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AC-6
- Severity
- M
- CCI
- CCI-002233
- Version
- PGS9-00-003600
- Vuln IDs
-
- V-214078
- V-72905
- Rule IDs
-
- SV-214078r508027_rule
- SV-87557
Checks: C-15294r360865_chk
Functions in PostgreSQL can be created with the SECURITY DEFINER option. When SECURITY DEFINER functions are executed by a user, said function is run with the privileges of the user who created it. To list all functions that have SECURITY DEFINER, as, the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "SELECT nspname, proname, proargtypes, prosecdef, rolname, proconfig FROM pg_proc p JOIN pg_namespace n ON p.pronamespace = n.oid JOIN pg_authid a ON a.oid = p.proowner WHERE prosecdef OR NOT proconfig IS NULL" In the query results, a prosecdef value of "t" on a row indicates that that function uses privilege elevation. If elevation of PostgreSQL privileges is utilized but not documented, this is a finding. If elevation of PostgreSQL privileges is documented, but not implemented as described in the documentation, this is a finding. If the privilege-elevation logic can be invoked in ways other than intended, or in contexts other than intended, or by subjects/principals other than intended, this is a finding.
Fix: F-15292r360866_fix
Determine where, when, how, and by what principals/subjects elevated privilege is needed. To change a SECURITY DEFINER function to SECURITY INVOKER, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "ALTER FUNCTION <function_name> SECURITY INVOKER"
- RMF Control
- SI-10
- Severity
- M
- CCI
- CCI-002754
- Version
- PGS9-00-003700
- Vuln IDs
-
- V-214079
- V-72907
- Rule IDs
-
- SV-214079r508027_rule
- SV-87559
Checks: C-15295r360868_chk
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: F-15293r360869_fix
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.
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-001844
- Version
- PGS9-00-003800
- Vuln IDs
-
- V-214080
- V-72909
- Rule IDs
-
- SV-214080r508027_rule
- SV-87561
Checks: C-15296r360871_chk
On UNIX systems, PostgreSQL can be configured to use stderr, csvlog and syslog. To send logs to a centralized location, syslog should be used. As the database owner (shown here as "postgres"), ensure PostgreSQL uses syslog by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_destination" As the database owner (shown here as "postgres"), check which log facility PostgreSQL is configured by running the following SQL: $ sudo su - postgres $ psql -c "SHOW syslog_facility" Check with the organization to see how syslog facilities are defined in their organization. If PostgreSQL audit records are not written directly to or systematically transferred to a centralized log management system, this is a finding.
Fix: F-15294r360872_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. With logging enabled, as the database owner (shown here as "postgres"), configure the follow parameters in postgresql.conf: Note: Consult the organization on how syslog facilities are defined in the syslog daemon configuration. $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf log_destination = 'syslog' syslog_facility = 'LOCAL0' syslog_ident = 'postgres' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- SC-3
- Severity
- M
- CCI
- CCI-001084
- Version
- PGS9-00-004000
- Vuln IDs
-
- V-214081
- V-72911
- Rule IDs
-
- SV-214081r508027_rule
- SV-87563
Checks: C-15297r360874_chk
Check PostgreSQL settings to determine whether objects or code implementing security functionality are located in a separate security domain, such as a separate database or schema created specifically for security functionality. By default, all objects in pg_catalog and information_schema are owned by the database administrator. To check the access controls for those schemas, as the database administrator (shown here as "postgres"), run the following commands to review the access privileges granted on the data dictionary and security tables, views, sequences, functions and trigger procedures: $ sudo su - postgres $ psql -x -c "\dp pg_catalog.*" $ psql -x -c "\dp information_schema.*" Repeat the \dp statements for any additional schemas that contain locally defined security objects. Repeat using \df+*.* to review ownership of PostgreSQL functions: $ sudo su - postgres $ psql -x -c "\df+ pg_catalog.*" $ psql -x -c "\df+ information_schema.*" Refer to the PostgreSQL online documentation for GRANT for help in interpreting the Access Privileges column in the output from \du. Note that an entry starting with an equals sign indicates privileges granted to Public (all users). By default, most of the tables and views in the pg_catalog and information_schema schemas can be read by Public. If any user besides the database administrator(s) is listed in access privileges and not documented, this is a finding. If security-related database objects or code are not kept separate, this is a finding.
Fix: F-15295r360875_fix
Do not locate security-related database objects with application tables or schema. Review any site-specific applications security modules built into the database: determine what schema they are located in and take appropriate action. Do not grant access to pg_catalog or information_schema to anyone but the database administrator(s). Access to the database administrator account(s) must not be granted to anyone without official approval.
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001814
- Version
- PGS9-00-004100
- Vuln IDs
-
- V-214082
- V-72913
- Rule IDs
-
- SV-214082r508027_rule
- SV-87565
Checks: C-15298r360877_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. To verify that system denies are logged when unprivileged users attempt to change database configuration, as the database administrator (shown here as "postgres"), run the following commands: $ sudo su - postgres $ psql Next, create a role with no privileges, change the current role to that user and attempt to change a configuration by running the following SQL: CREATE ROLE bob; SET ROLE bob; SET pgaudit.role='test'; Now check pg_log (use the latest log): $ cat ${PGDATA?}/pg_log/postgresql-Thu.log < 2016-01-28 17:57:34.092 UTC bob postgres: >ERROR: permission denied to set parameter "pgaudit.role" < 2016-01-28 17:57:34.092 UTC bob postgres: >STATEMENT: SET pgaudit.role='test'; If the denial is not logged, this is a finding. By default PostgreSQL configuration files are owned by the postgres user and cannot be edited by non-privileged users: $ ls -la ${PGDATA?} | grep postgresql.conf -rw-------. 1 postgres postgres 21758 Jan 22 10:27 postgresql.conf If postgresql.conf is not owned by the database owner and does not have read and write permissions for the owner, this is a finding.
Fix: F-15296r360878_fix
Enable logging. All denials are logged by default if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-9
- Severity
- M
- CCI
- CCI-000162
- Version
- PGS9-00-004200
- Vuln IDs
-
- V-214083
- V-72915
- Rule IDs
-
- SV-214083r508027_rule
- SV-87567
Checks: C-15299r360880_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. Review locations of audit logs, both internal to the database and database audit logs located at the operating system level. Verify there are appropriate controls and permissions to protect the audit information from unauthorized access. #### syslog Logging If PostgreSQL is configured to use syslog for logging, consult organization location and permissions for syslog log files. #### stderr Logging As the database administrator (shown here as "postgres"), check the current log_file_mode configuration by running the following: Note: Consult the organization's documentation on acceptable log privileges. $ sudo su - postgres $ psql -c "SHOW log_file_mode" If log_file_mode is not 600, this is a finding. Next, check the current log_destination path by running the following SQL: Note: This is relative to PGDATA. $ psql -c "SHOW log_destination" Next, verify the log files have the set configurations in the log_destination: Note: Use location of logs from log_directory. $ ls -l ${PGDATA?}/pg_log/ total 32 -rw-------. 1 postgres postgres 0 Apr 8 00:00 postgresql-Fri.log -rw-------. 1 postgres postgres 8288 Apr 11 17:36 postgresql-Mon.log -rw-------. 1 postgres postgres 0 Apr 9 00:00 postgresql-Sat.log -rw-------. 1 postgres postgres 0 Apr 10 00:00 postgresql-Sun.log -rw-------. 1 postgres postgres 16212 Apr 7 17:05 postgresql-Thu.log -rw-------. 1 postgres postgres 1130 Apr 6 17:56 postgresql-Wed.log If logs with 600 permissions do not exist in log_destination, this is a finding.
Fix: F-15297r360881_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. #### syslog Logging If PostgreSQL is configured to use syslog for logging, consult organization location and permissions for syslog log files. #### stderr Logging If PostgreSQL is configured to use stderr for logging, permissions of the log files can be set in postgresql.conf. As the database administrator (shown here as "postgres"), edit the following settings of logs in the postgresql.conf file: Note: Consult the organization's documentation on acceptable log privileges. $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf log_file_mode = 0600 Next, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- SI-2
- Severity
- M
- CCI
- CCI-002617
- Version
- PGS9-00-004300
- Vuln IDs
-
- V-214084
- V-72917
- Rule IDs
-
- SV-214084r508027_rule
- SV-87569
Checks: C-15300r360883_chk
To check software installed by packages, as the system administrator, run the following command: # RHEL/CENT Systems $ sudo rpm -qa | grep postgres If multiple versions of postgres are installed but are unused, this is a finding.
Fix: F-15298r360884_fix
Use package managers (RPM or apt-get) for installing PostgreSQL. Unused software is removed when updated.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-004400
- Vuln IDs
-
- V-214085
- V-72919
- Rule IDs
-
- SV-214085r508027_rule
- SV-87571
Checks: C-15301r360886_chk
As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "SHOW pgaudit.log" If pgaudit.log does not contain, "ddl, write, role", this is a finding.
Fix: F-15299r360887_fix
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. Using pgaudit the DBMS (PostgreSQL) can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log = 'ddl, write, role' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql- ${PGVER?} # INITD SERVER ONLY $ sudo service postgresql- ${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-004500
- Vuln IDs
-
- V-214086
- V-72921
- Rule IDs
-
- SV-214086r508027_rule
- SV-87573
Checks: C-15302r360889_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), setup a test schema and revoke users privileges from using it by running the following SQL: $ sudo su - postgres $ psql -c "CREATE SCHEMA stig_test_schema AUTHORIZATION postgres" $ psql -c "REVOKE ALL ON SCHEMA stig_test_schema FROM public" $ psql -c "GRANT ALL ON SCHEMA stig_test_schema TO postgres" Next, create a test table, insert a value into that table for the following checks by running the following SQL: $ psql -c "CREATE TABLE stig_test_schema.stig_test_table(id INT)" $ psql -c "INSERT INTO stig_test_schema.stig_test_table(id) VALUES (0)" #### CREATE Attempt to CREATE a table in the stig_test_schema schema with a role that does not have privileges by running the following SQL: psql -c "CREATE ROLE bob; SET ROLE bob; CREATE TABLE stig_test_schema.test_table(id INT);" ERROR: permission denied for schema stig_test_schema Next, as a database administrator (shown here as "postgres"), verify that the denial was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-09 09:55:19.423 EST postgres 56e0393f.186b postgres: >ERROR: permission denied for schema stig_test_schema at character 14 < 2016-03-09 09:55:19.423 EST postgres 56e0393f.186b postgres: >STATEMENT: CREATE TABLE stig_test_schema.test_table(id INT); If the denial is not logged, this is a finding. #### INSERT As role bob, attempt to INSERT into the table created earlier, stig_test_table by running the following SQL: $ sudo su - postgres $ psql -c "SET ROLE bob; INSERT INTO stig_test_schema.stig_test_table(id) VALUES (0);" Next, as a database administrator (shown here as "postgres"), verify that the denial was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-09 09:58:30.709 EST postgres 56e0393f.186b postgres: >ERROR: permission denied for schema stig_test_schema at character 13 < 2016-03-09 09:58:30.709 EST postgres 56e0393f.186b postgres: >STATEMENT: INSERT INTO stig_test_schema.stig_test_table(id) VALUES (0); If the denial is not logged, this is a finding. #### SELECT As role bob, attempt to SELECT from the table created earlier, stig_test_table by running the following SQL: $ sudo su - postgres $ psql -c "SET ROLE bob; SELECT * FROM stig_test_schema.stig_test_table;" Next, as a database administrator (shown here as "postgres"), verify that the denial was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-09 09:57:58.327 EST postgres 56e0393f.186b postgres: >ERROR: permission denied for schema stig_test_schema at character 15 < 2016-03-09 09:57:58.327 EST postgres 56e0393f.186b postgres: >STATEMENT: SELECT * FROM stig_test_schema.stig_test_table; If the denial is not logged, this is a finding. #### ALTER As role bob, attempt to ALTER the table created earlier, stig_test_table by running the following SQL: $ sudo su - postgres $ psql -c "SET ROLE bob; ALTER TABLE stig_test_schema.stig_test_table ADD COLUMN name TEXT;" Next, as a database administrator (shown here as "postgres"), verify that the denial was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-09 10:03:43.765 EST postgres 56e0393f.186b postgres: >STATEMENT: ALTER TABLE stig_test_schema.stig_test_table ADD COLUMN name TEXT; If the denial is not logged, this is a finding. #### UPDATE As role bob, attempt to UPDATE a row created earlier, stig_test_table by running the following SQL: $ sudo su - postgres $ psql -c "SET ROLE bob; UPDATE stig_test_schema.stig_test_table SET id=1 WHERE id=0;" Next, as a database administrator (shown here as "postgres"), verify that the denial was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-09 10:08:27.696 EST postgres 56e0393f.186b postgres: >ERROR: permission denied for schema stig_test_schema at character 8 < 2016-03-09 10:08:27.696 EST postgres 56e0393f.186b postgres: >STATEMENT: UPDATE stig_test_schema.stig_test_table SET id=1 WHERE id=0; If the denial is not logged, this is a finding. #### DELETE As role bob, attempt to DELETE a row created earlier, stig_test_table by running the following SQL: $ sudo su - postgres $ psql -c "SET ROLE bob; DELETE FROM stig_test_schema.stig_test_table WHERE id=0;" Next, as a database administrator (shown here as "postgres"), verify that the denial was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-09 10:09:29.607 EST postgres 56e0393f.186b postgres: >ERROR: permission denied for schema stig_test_schema at character 13 < 2016-03-09 10:09:29.607 EST postgres 56e0393f.186b postgres: >STATEMENT: DELETE FROM stig_test_schema.stig_test_table WHERE id=0; If the denial is not logged, this is a finding. #### PREPARE As role bob, attempt to execute a prepared system using PREPARE by running the following SQL: $ sudo su - postgres $ psql -c "SET ROLE bob; PREPARE stig_test_plan(int) AS SELECT id FROM stig_test_schema.stig_test_table WHERE id=$1;" Next, as a database administrator (shown here as "postgres"), verify that the denial was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-09 10:16:22.628 EST postgres 56e03e02.18e4 postgres: >ERROR: permission denied for schema stig_test_schema at character 46 < 2016-03-09 10:16:22.628 EST postgres 56e03e02.18e4 postgres: >STATEMENT: PREPARE stig_test_plan(int) AS SELECT id FROM stig_test_schema.stig_test_table WHERE id=$1; If the denial is not logged, this is a finding. #### DROP As role bob, attempt to DROP the table created earlier stig_test_table by running the following SQL: $ sudo su - postgres $ psql -c "SET ROLE bob; DROP TABLE stig_test_schema.stig_test_table;" Next, as a database administrator (shown here as "postgres"), verify that the denial was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-09 10:18:55.255 EST postgres 56e03e02.18e4 postgres: >ERROR: permission denied for schema stig_test_schema < 2016-03-09 10:18:55.255 EST postgres 56e03e02.18e4 postgres: >STATEMENT: DROP TABLE stig_test_schema.stig_test_table; If the denial is not logged, this is a finding.
Fix: F-15300r360890_fix
Configure PostgreSQL to produce audit records when unsuccessful attempts to access security objects occur. All denials are logged if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-004600
- Vuln IDs
-
- V-214087
- V-72923
- Rule IDs
-
- SV-214087r508027_rule
- SV-87575
Checks: C-15303r360892_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. In this example the user joe will log into the Postgres database unsuccessfully: $ psql -d postgres -U joe As the database administrator (shown here as "postgres"), check pg_log for a FATAL connection audit trail: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/postgresql-Tue.log < 2016-02-16 16:18:13.027 EST joe 56c65135.b5f postgres: >LOG: connection authorized: user=joe database=postgres < 2016-02-16 16:18:13.027 EST joe 56c65135.b5f postgres: >FATAL: role "joe" does not exist If an audit record is not generated each time a user (or other principal) attempts, but fails to log on or connect to PostgreSQL (including attempts where the user ID is invalid/unknown), this is a finding.
Fix: F-15301r360893_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. If logging is enabled the following configurations must be made to log unsuccessful connections, date/time, username, and session identifier. First, as the database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Edit the following parameters: log_connections = on log_line_prefix = '< %m %u %c: >' Where: * %m is the time and date * %u is the username * %c is the session ID for the connection Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-004700
- Vuln IDs
-
- V-214088
- V-72925
- Rule IDs
-
- SV-214088r508027_rule
- SV-87577
Checks: C-15304r360895_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, log into the database with the postgres user by running the following commands: $ sudo su - postgres $ psql -U postgres Next, as the database administrator, verify the log for a connection audit trail: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/postgresql-Tue.log < 2016-02-23 20:25:39.931 EST postgres 56cfa993.7a72 postgres: >LOG: connection authorized: user=postgres database=postgres < 2016-02-23 20:27:45.428 EST postgres 56cfa993.7a72 postgres: >LOG: AUDIT: SESSION,1,1,READ,SELECT,,,SELECT current_user;,<none> < 2016-02-23 20:27:47.988 EST postgres 56cfa993.7a72 postgres: >LOG: disconnection: session time: 0:00:08.057 user=postgres database=postgres host=[local] If connections are not logged, this is a finding.
Fix: F-15302r360896_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. If logging is enabled the following configurations must be made to log connections, date/time, username, and session identifier. First, as the database administrator (shown here as "postgres"), edit postgresql.conf by running the following: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Edit the following parameters: log_connections = on log_disconnections = on log_line_prefix = '< %m %u %c: >' Where: * %m is the time and date * %u is the username * %c is the session ID for the connection Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-004800
- Vuln IDs
-
- V-214089
- V-72927
- Rule IDs
-
- SV-214089r508027_rule
- SV-87579
Checks: C-15305r360898_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. As the database administrator (shown here as "postgres"), create a test role by running the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE bob" Next, to test if audit records are generated from unsuccessful attempts at modifying security objects, run the following SQL: $ sudo su - postgres $ psql -c "SET ROLE bob; UPDATE pg_authid SET rolsuper = 't' WHERE rolname = 'bob';" Next, as the database administrator (shown here as "postgres"), verify that the denials were logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-17 10:34:00.017 EDT bob 56eabf52.b62 postgres: >ERROR: permission denied for relation pg_authid < 2016-03-17 10:34:00.017 EDT bob 56eabf52.b62 postgres: >STATEMENT: UPDATE pg_authid SET rolsuper = 't' WHERE rolname = 'bob'; If denials are not logged, this is a finding.
Fix: F-15303r360899_fix
Configure PostgreSQL to produce audit records when unsuccessful attempts to modify security objects occur. Unsuccessful attempts to modifying security objects can be logged if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-004900
- Vuln IDs
-
- V-214090
- V-72929
- Rule IDs
-
- SV-214090r508027_rule
- SV-87581
Checks: C-15306r360901_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), create a role by running the following SQL: Change the privileges of another user: $ sudo su - postgres $ psql -c "CREATE ROLE bob" Next, GRANT then REVOKE privileges from the role: $ psql -c "GRANT CONNECT ON DATABASE postgres TO bob" $ psql -c "REVOKE CONNECT ON DATABASE postgres FROM bob" postgres=# REVOKE CONNECT ON DATABASE postgres FROM bob; REVOKE postgres=# GRANT CONNECT ON DATABASE postgres TO bob; GRANT Now, as the database administrator (shown here as "postgres"), verify the events were logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-07-13 16:25:21.103 EDT postgres postgres LOG: > AUDIT: SESSION,1,1,ROLE,GRANT,,,GRANT CONNECT ON DATABASE postgres TO bob,<none> < 2016-07-13 16:25:25.520 EDT postgres postgres LOG: > AUDIT: SESSION,1,1,ROLE,REVOKE,,,REVOKE CONNECT ON DATABASE postgres FROM bob,<none> If the above steps cannot verify that audit records are produced when privileges/permissions/role memberships are added, this is a finding.
Fix: F-15304r360902_fix
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. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log = 'role' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005000
- Vuln IDs
-
- V-214091
- V-72931
- Rule IDs
-
- SV-214091r508027_rule
- SV-87583
Checks: C-15307r360904_chk
First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain "pgaudit", this is a finding. Next, verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15305r360905_fix
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. All errors and denials are logged if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log='ddl, role, read, write' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005100
- Vuln IDs
-
- V-214092
- V-72933
- Rule IDs
-
- SV-214092r508027_rule
- SV-87585
Checks: C-15308r360907_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), check if log_connections is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_connections" If log_connections is off, this is a finding. Next, verify the logs that the previous connection to the database was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-02-16 15:54:03.934 EST postgres postgres 56c64b8b.aeb: >LOG: connection authorized: user=postgres database=postgres If an audit record is not generated each time a user (or other principal) logs on or connects to PostgreSQL, this is a finding.
Fix: F-15306r360908_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. If logging is enabled the following configurations must be made to log connections, date/time, username, and session identifier. First, as the database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Edit the following parameters as such: log_connections = on log_line_prefix = '< %m %u %d %c: >' Where: * %m is the time and date * %u is the username * %d is the database * %c is the session ID for the connection Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005200
- Vuln IDs
-
- V-214093
- V-72939
- Rule IDs
-
- SV-214093r508027_rule
- SV-87591
Checks: C-15309r360910_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), create a test table stig_test, enable row level security, and create a policy by running the following SQL: $ sudo su - postgres $ psql -c "CREATE TABLE stig_test(id INT)" $ psql -c "ALTER TABLE stig_test ENABLE ROW LEVEL SECURITY" $ psql -c "CREATE POLICY lock_table ON stig_test USING ('postgres' = current_user)" Next, drop the policy and disable row level security: $ psql -c "DROP POLICY lock_table ON stig_test" $ psql -c "ALTER TABLE stig_test DISABLE ROW LEVEL SECURITY" Now, as the database administrator (shown here as "postgres"), verify the security objects deletions were logged: $ cat ${PGDATA?}/pg_log/<latest_log> 2016-03-30 14:54:18.991 EDT postgres postgres LOG: AUDIT: SESSION,11,1,DDL,DROP POLICY,,,DROP POLICY lock_table ON stig_test;,<none> 2016-03-30 14:54:42.373 EDT postgres postgres LOG: AUDIT: SESSION,12,1,DDL,ALTER TABLE,,,ALTER TABLE stig_test DISABLE ROW LEVEL SECURITY;,<none> If audit records are not produced when security objects are dropped, this is a finding.
Fix: F-15307r360911_fix
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. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log = 'ddl' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005300
- Vuln IDs
-
- V-214094
- V-72941
- Rule IDs
-
- SV-214094r508027_rule
- SV-87593
Checks: C-15310r360913_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), create a role 'bob' by running the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE bob" Next, attempt to retrieve information from the pg_authid table: $ psql -c "SET ROLE bob; SELECT * FROM pg_authid" Now, as the database administrator (shown here as "postgres"), verify the event was logged in pg_log: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-07-13 16:49:58.864 EDT postgres postgres ERROR: > permission denied for relation pg_authid < 2016-07-13 16:49:58.864 EDT postgres postgres STATEMENT: > SELECT * FROM pg_authid; If the above steps cannot verify that audit records are produced when PostgreSQL denies retrieval of privileges/permissions/role memberships, this is a finding.
Fix: F-15308r360914_fix
Configure PostgreSQL to produce audit records when unsuccessful attempts to access privileges occur. All denials are logged if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005400
- Vuln IDs
-
- V-214095
- V-72945
- Rule IDs
-
- SV-214095r508027_rule
- SV-87597
Checks: C-15311r360916_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), create the roles joe and bob with LOGIN by running the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE joe LOGIN" $ psql -c "CREATE ROLE bob LOGIN" Next, set current role to bob and attempt to alter the role joe: $ psql -c "SET ROLE bob; ALTER ROLE joe NOLOGIN;" Now, as the database administrator (shown here as "postgres"), verify the denials are logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-03-17 11:28:10.004 EDT bob 56eacd05.cda postgres: >ERROR: permission denied to alter role < 2016-03-17 11:28:10.004 EDT bob 56eacd05.cda postgres: >STATEMENT: ALTER ROLE joe; If audit logs are not generated when unsuccessful attempts to delete privileges/permissions occur, this is a finding.
Fix: F-15309r360917_fix
Configure PostgreSQL to produce audit records when unsuccessful attempts to delete privileges occur. All denials are logged if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005500
- Vuln IDs
-
- V-214096
- V-72947
- Rule IDs
-
- SV-214096r508027_rule
- SV-87599
Checks: C-15312r360919_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), check if pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If pgaudit is not found in the results, this is a finding. Next, as the database administrator (shown here as "postgres"), list all role memberships for the database: $ sudo su - postgres $ psql -c "\du" Next, verify the query was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-01-28 19:43:12.126 UTC postgres postgres: >LOG: AUDIT: SESSION,1,1,READ,SELECT,,,"SELECT r.rolname, r.rolsuper, r.rolinherit, r.rolcreaterole, r.rolcreatedb, r.rolcanlogin, r.rolconnlimit, r.rolvaliduntil, ARRAY(SELECT b.rolname FROM pg_catalog.pg_auth_members m JOIN pg_catalog.pg_roles b ON (m.roleid = b.oid) WHERE m.member = r.oid) as memberof , r.rolreplication , r.rolbypassrls FROM pg_catalog.pg_roles r ORDER BY 1;",<none> If audit records are not produced, this is a finding.
Fix: F-15310r360920_fix
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. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log_catalog = 'on' pgaudit.log = 'read' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005600
- Vuln IDs
-
- V-214097
- V-72949
- Rule IDs
-
- SV-214097r508027_rule
- SV-87601
Checks: C-15313r360922_chk
First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain "pgaudit", this is a finding. Next, verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15311r360923_fix
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. Configure PostgreSQL to produce audit records when unsuccessful attempts to modify categories of information. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. All denials are logged when logging is enabled. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log='ddl, role, read, write' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005700
- Vuln IDs
-
- V-214098
- V-72951
- Rule IDs
-
- SV-214098r508027_rule
- SV-87603
Checks: C-15314r360925_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), create a schema, test_schema, create a table, test_table, within test_schema, and insert a value: $ sudo su - postgres $ psql -c "CREATE SCHEMA test_schema" $ psql -c "CREATE TABLE test_schema.test_table(id INT)" $ psql -c "INSERT INTO test_schema.test_table(id) VALUES (0)" Next, create a role 'bob' and attempt to SELECT, INSERT, UPDATE, and DROP from the test table: $ psql -c "CREATE ROLE BOB" $ psql -c "SET ROLE bob; SELECT * FROM test_schema.test_table" $ psql -c "SET ROLE bob; INSERT INTO test_schema.test_table VALUES (0)" $ psql -c "SET ROLE bob; UPDATE test_schema.test_table SET id = 1 WHERE id = 0" $ psql -c "SET ROLE bob; DROP TABLE test_schema.test_table" $ psql -c "SET ROLE bob; DROP SCHEMA test_schema" Now, as the database administrator (shown here as "postgres"), review PostgreSQL/database security and audit settings to verify that audit records are created for unsuccessful attempts at the specified access to the specified objects: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> 2016-03-30 17:23:41.254 EDT postgres postgres ERROR: permission denied for schema test_schema at character 15 2016-03-30 17:23:41.254 EDT postgres postgres STATEMENT: SELECT * FROM test_schema.test_table; 2016-03-30 17:23:53.973 EDT postgres postgres ERROR: permission denied for schema test_schema at character 13 2016-03-30 17:23:53.973 EDT postgres postgres STATEMENT: INSERT INTO test_schema.test_table VALUES (0); 2016-03-30 17:24:32.647 EDT postgres postgres ERROR: permission denied for schema test_schema at character 8 2016-03-30 17:24:32.647 EDT postgres postgres STATEMENT: UPDATE test_schema.test_table SET id = 1 WHERE id = 0; 2016-03-30 17:24:46.197 EDT postgres postgres ERROR: permission denied for schema test_schema 2016-03-30 17:24:46.197 EDT postgres postgres STATEMENT: DROP TABLE test_schema.test_table; 2016-03-30 17:24:51.582 EDT postgres postgres ERROR: must be owner of schema test_schema 2016-03-30 17:24:51.582 EDT postgres postgres STATEMENT: DROP SCHEMA test_schema; If any of the above steps did not create audit records for SELECT, INSERT, UPDATE, and DROP, this is a finding.
Fix: F-15312r360926_fix
Configure PostgreSQL to produce audit records when unsuccessful attempts to access objects occur. All errors and denials are logged if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005800
- Vuln IDs
-
- V-214099
- V-72953
- Rule IDs
-
- SV-214099r508027_rule
- SV-87605
Checks: C-15315r360928_chk
First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain pgaudit, this is a finding. Next, verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15313r360929_fix
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. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): shared_preload_libraries = ‘pgaudit’ pgaudit.log='ddl, role, read, write' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-005900
- Vuln IDs
-
- V-214100
- V-72955
- Rule IDs
-
- SV-214100r508027_rule
- SV-87607
Checks: C-15316r360931_chk
First, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "SHOW pgaudit.log" If pgaudit.log does not contain, "ddl, write, role", this is a finding.
Fix: F-15314r360932_fix
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. Configure PostgreSQL to produce audit records when unsuccessful attempts to access categories of information. All denials are logged if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log = 'ddl, write, role' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006000
- Vuln IDs
-
- V-214101
- V-72957
- Rule IDs
-
- SV-214101r508027_rule
- SV-87609
Checks: C-15317r360934_chk
First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain pgaudit, this is a finding. Next, verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15315r360935_fix
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. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log='ddl, role, read, write' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006100
- Vuln IDs
-
- V-214102
- V-72959
- Rule IDs
-
- SV-214102r508027_rule
- SV-87611
Checks: C-15318r360937_chk
First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain pgaudit, this is a finding. Next, verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15316r360938_fix
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. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log = 'role' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006200
- Vuln IDs
-
- V-214103
- V-72961
- Rule IDs
-
- SV-214103r508027_rule
- SV-87613
Checks: C-15319r360940_chk
First, as the database administrator, verify that log_connections and log_disconnections are enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_connections" $ psql -c "SHOW log_disconnections" If either is off, this is a finding. Next, verify that log_line_prefix contains sufficient information by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_line_prefix" If log_line_prefix does not contain at least %m %u %d %c, this is a finding.
Fix: F-15317r360941_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. First, as the database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Edit the following parameters as such: log_connections = on log_disconnections = on log_line_prefix = '< %m %u %d %c: >' Where: * %m is the time and date * %u is the username * %d is the database * %c is the session ID for the connection Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006300
- Vuln IDs
-
- V-214104
- V-72963
- Rule IDs
-
- SV-214104r508027_rule
- SV-87615
Checks: C-15320r360943_chk
First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain pgaudit, this is a finding. Next, verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15318r360944_fix
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. Configure PostgreSQL to produce audit records when unsuccessful attempts to delete security objects occur. All errors and denials are logged if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log='ddl, role, read, write' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006400
- Vuln IDs
-
- V-214105
- V-72965
- Rule IDs
-
- SV-214105r508027_rule
- SV-87617
Checks: C-15321r360946_chk
First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain pgaudit, this is a finding. Next, verify that role is enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, this is a finding.
Fix: F-15319r360947_fix
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. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log='role' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006500
- Vuln IDs
-
- V-214106
- V-72969
- Rule IDs
-
- SV-214106r508027_rule
- SV-87621
Checks: C-15322r360949_chk
As the database administrator (shown here as "postgres"), create the role bob by running the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE bob" Next, change the current role to bob and attempt to execute privileged activity: $ psql -c "CREATE ROLE stig_test SUPERUSER" $ psql -c "CREATE ROLE stig_test CREATEDB" $ psql -c "CREATE ROLE stig_test CREATEROLE" $ psql -c "CREATE ROLE stig_test CREATEUSER" Now, as the database administrator (shown here as "postgres"), verify that an audit event was produced (use the latest log): $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-02-23 20:16:32.396 EST postgres 56cfa74f.79eb postgres: >ERROR: must be superuser to create superusers < 2016-02-23 20:16:32.396 EST postgres 56cfa74f.79eb postgres: >STATEMENT: CREATE ROLE stig_test SUPERUSER; < 2016-02-23 20:16:48.725 EST postgres 56cfa74f.79eb postgres: >ERROR: permission denied to create role < 2016-02-23 20:16:48.725 EST postgres 56cfa74f.79eb postgres: >STATEMENT: CREATE ROLE stig_test CREATEDB; < 2016-02-23 20:16:54.365 EST postgres 56cfa74f.79eb postgres: >ERROR: permission denied to create role < 2016-02-23 20:16:54.365 EST postgres 56cfa74f.79eb postgres: >STATEMENT: CREATE ROLE stig_test CREATEROLE; < 2016-02-23 20:17:05.949 EST postgres 56cfa74f.79eb postgres: >ERROR: must be superuser to create superusers < 2016-02-23 20:17:05.949 EST postgres 56cfa74f.79eb postgres: >STATEMENT: CREATE ROLE stig_test CREATEUSER; If audit records are not produced, this is a finding.
Fix: F-15320r360950_fix
Configure PostgreSQL to produce audit records when unsuccessful attempts to execute privileged SQL. All denials are logged by default if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006600
- Vuln IDs
-
- V-214107
- V-72971
- Rule IDs
-
- SV-214107r508027_rule
- SV-87623
Checks: C-15323r360952_chk
First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the results does not contain pgaudit, this is a finding. Next, verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding. Next, verify that accessing the catalog is audited by running the following SQL: $ psql -c "SHOW pgaudit.log_catalog" If log_catalog is not on, this is a finding.
Fix: F-15321r360953_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. Using pgaudit the DBMS (PostgreSQL) can be configured to audit these requests. See supplementary content `APPENDIX-B` for documentation on installing `pgaudit`. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log_catalog = 'on' pgaudit.log='ddl, role, read, write' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006700
- Vuln IDs
-
- V-214108
- V-72973
- Rule IDs
-
- SV-214108r508027_rule
- SV-87625
Checks: C-15324r360955_chk
If category tracking is not required in the database, this is not applicable. First, as the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain pgaudit, this is a finding. Next, verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15322r360956_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log='ddl, role, read, write' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006800
- Vuln IDs
-
- V-214109
- V-72975
- Rule IDs
-
- SV-214109r508027_rule
- SV-87627
Checks: C-15325r360958_chk
First, as the database administrator (shown here as "postgres"), create a role 'bob' and a test table by running the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE bob; CREATE TABLE test(id INT)" Next, set current role to bob and attempt to modify privileges: $ psql -c "SET ROLE bob; GRANT ALL PRIVILEGES ON test TO bob;" $ psql -c "SET ROLE bob; REVOKE ALL PRIVILEGES ON test FROM bob;" Now, as the database administrator (shown here as "postgres"), verify the unsuccessful attempt was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> 2016-07-14 18:12:23.208 EDT postgres postgres ERROR: permission denied for relation test 2016-07-14 18:12:23.208 EDT postgres postgres STATEMENT: GRANT ALL PRIVILEGES ON test TO bob; 2016-07-14 18:14:52.895 EDT postgres postgres ERROR: permission denied for relation test 2016-07-14 18:14:52.895 EDT postgres postgres STATEMENT: REVOKE ALL PRIVILEGES ON test FROM bob; If audit logs are not generated when unsuccessful attempts to modify privileges/permissions occur, this is a finding.
Fix: F-15323r360959_fix
Configure PostgreSQL to produce audit records when unsuccessful attempts to modify privileges occur. All denials are logged by default if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-006900
- Vuln IDs
-
- V-214110
- V-72977
- Rule IDs
-
- SV-214110r508027_rule
- SV-87629
Checks: C-15326r360961_chk
First, as the database administrator (shown here as "postgres"), create a role 'bob' and a test table by running the following SQL: $ sudo su - postgres $ psql -c "CREATE ROLE bob; CREATE TABLE test(id INT);" Next, set current role to bob and attempt to modify privileges: $ psql -c "SET ROLE bob; GRANT ALL PRIVILEGES ON test TO bob;" Now, as the database administrator (shown here as "postgres"), verify the unsuccessful attempt was logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> 2016-07-14 18:12:23.208 EDT postgres postgres ERROR: permission denied for relation test 2016-07-14 18:12:23.208 EDT postgres postgres STATEMENT: GRANT ALL PRIVILEGES ON test TO bob; If audit logs are not generated when unsuccessful attempts to add privileges/permissions occur, this is a finding.
Fix: F-15324r360962_fix
Configure PostgreSQL to produce audit records when unsuccessful attempts to add privileges occur. All denials are logged by default if logging is enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- IA-5
- Severity
- M
- CCI
- CCI-000185
- Version
- PGS9-00-007000
- Vuln IDs
-
- V-214111
- V-72979
- Rule IDs
-
- SV-214111r508027_rule
- SV-87631
Checks: C-15327r360964_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. To verify that a CRL file exists, as the database administrator (shown here as "postgres"), run the following: $ sudo su - postgres $ psql -c "SHOW ssl_crl_file" If this is not set to a CRL file, this is a finding. Next verify the existence of the CRL file by checking the directory set in postgresql.conf in the ssl_crl_file parameter from above: Note: If no directory is specified, then the CRL file should be located in the same directory as postgresql.conf (PGDATA). If the CRL file does not exist, this is a finding. Next, verify that hostssl entries in pg_hba.conf have "cert" and "clientcert=1" enabled: $ sudo su - postgres $ grep hostssl ${PGDATA?}/pg_hba.conf If hostssl entries do not contain cert or clientcert=1, this is a finding. If certificates are not being validated by performing RFC 5280-compliant certification path validation, this is a finding.
Fix: F-15325r360965_fix
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 configure PostgreSQL to use SSL, see supplementary content APPENDIX-G. To generate a Certificate Revocation List, see the official Red Hat Documentation: https://access.redhat.com/documentation/en-US/Red_Hat_Update_Infrastructure/2.1/html/Administration_Guide/chap-Red_Hat_Update_Infrastructure-Administration_Guide-Certification_Revocation_List_CRL.html As the database administrator (shown here as "postgres"), copy the CRL file into the data directory: First, as the system administrator, copy the CRL file into the PostgreSQL Data Directory: $ sudo cp root.crl ${PGDATA?}/root.crl As the database administrator (shown here as "postgres"), set the ssl_crl_file parameter to the filename of the CRL: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf ssl_crl_file = 'root.crl' Next, in pg_hba.conf, require ssl authentication: $ sudo su - postgres $ vi ${PGDATA?}/pg_hba.conf hostssl <database> <user> <address> cert clientcert=1 Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-000132
- Version
- PGS9-00-007100
- Vuln IDs
-
- V-214112
- V-73123
- Rule IDs
-
- SV-214112r508027_rule
- SV-87775
Checks: C-15328r360967_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), check the current log_line_prefix setting by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_line_prefix" If log_line_prefix does not contain %m %u %d %s, this is a finding.
Fix: F-15326r360968_fix
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. To check that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. First edit the postgresql.conf file as the database administrator (shown here as "postgres"): $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Extra parameters can be added to the setting log_line_prefix to log application related information: # %a = application name # %u = user name # %d = database name # %r = remote host and port # %p = process ID # %m = timestamp with milliseconds # %i = command tag # %s = session startup # %e = SQL state For example: log_line_prefix = '< %m %a %u %d %r %p %i %e %s>’ Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-9.5 # INITD SERVER ONLY $ sudo service postgresql-9.5 reload
- RMF Control
- SC-8
- Severity
- M
- CCI
- CCI-002420
- Version
- PGS9-00-007200
- Vuln IDs
-
- V-214113
- V-72981
- Rule IDs
-
- SV-214113r548752_rule
- SV-87633
Checks: C-15329r548750_chk
: If the data owner does not have a strict requirement for ensuring data integrity and confidentiality is maintained at every step of the data transfer and handling process, this is not a finding. First, check if ssl is enabled for the database instance. As the database administrator (shown here as "postgres"), verify SSL is enabled by running the following from a command prompt: $ sudo su - postgres $ psql -c "SHOW ssl" If SSL is not enabled, this is a finding. Next, open the pg_hba.conf file in a viewer or editor and review the authentication settings that are configured in that file. Next, verify hostssl entries in pg_hba.conf: $ sudo su - postgres $ grep hostssl ${PGDATA?}/pg_hba.conf If hostssl entries do not contain clientcert=1, this is a finding. If any uncommented lines are not of TYPE "hostssl" and do not include the "clientcert=1" authentication option and are not documented in the system security plan or equivalent document as being approved, this is a finding. If PostgreSQL does not employ protective measures against unauthorized disclosure and modification during preparation for transmission, this is a finding.
Fix: F-15327r548751_fix
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. Implement protective measures against unauthorized disclosure and modification during preparation for transmission. To configure PostgreSQL to use SSL, as a database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameter: ssl = on To change authentication requirements for the database, as the database administrator (shown here as "postgres"), edit pg_hba.conf: $ sudo su - postgres $ vi ${PGDATA?}/pg_hba.conf Edit authentication requirements to the organizational requirements. See the official documentation for the complete list of options for authentication: http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload For more information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000169
- Version
- PGS9-00-007400
- Vuln IDs
-
- V-214114
- V-72983
- Rule IDs
-
- SV-214114r508027_rule
- SV-87635
Checks: C-15330r360973_chk
Check PostgreSQL auditing to determine whether organization-defined auditable events are being audited by the system. If organization-defined auditable events are not being audited, this is a finding.
Fix: F-15328r360974_fix
Configure PostgreSQL to generate audit records for at least the DoD minimum set of events. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging.
- RMF Control
- AU-8
- Severity
- M
- CCI
- CCI-001889
- Version
- PGS9-00-007700
- Vuln IDs
-
- V-214115
- V-72985
- Rule IDs
-
- SV-214115r508027_rule
- SV-87637
Checks: C-15331r360976_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. First, as the database administrator (shown here as "postgres"), verify the current log_line_prefix setting by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_line_prefix" If log_line_prefix does not contain %m, this is a finding. Next check the logs to verify time stamps are being logged: $ sudo su - postgres $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-02-23 12:53:33.947 EDT postgres postgres 570bd68d.3912 >LOG: connection authorized: user=postgres database=postgres < 2016-02-23 12:53:41.576 EDT postgres postgres 570bd68d.3912 >LOG: AUDIT: SESSION,1,1,DDL,CREATE TABLE,,,CREATE TABLE test_srg(id INT);,<none> < 2016-02-23 12:53:44.372 EDT postgres postgres 570bd68d.3912 >LOG: disconnection: session time: 0:00:10.426 user=postgres database=postgres host=[local] If time stamps are not being logged, this is a finding.
Fix: F-15329r360977_fix
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. PostgreSQL will not log anything if logging is not enabled. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. If logging is enabled the following configurations must be made to log events with time stamps: First, as the database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add %m to log_line_prefix to enable time stamps with milliseconds: log_line_prefix = '< %m >' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-001487
- Version
- PGS9-00-007800
- Vuln IDs
-
- V-214116
- V-72987
- Rule IDs
-
- SV-214116r508027_rule
- SV-87639
Checks: C-15332r360979_chk
Check PostgreSQL settings and existing audit records to verify a user name associated with the event is being captured and stored with the audit records. If audit records exist without specific user information, this is a finding. First, as the database administrator (shown here as "postgres"), verify the current setting of log_line_prefix by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_line_prefix" If log_line_prefix does not contain %m, %u, %d, %p, %r, %a, this is a finding.
Fix: F-15330r360980_fix
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. Logging must be enabled in order to capture the identity of any user/subject or process associated with an event. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. To enable username, database name, process ID, remote host/port and application name in logging, as the database administrator (shown here as "postgres"), edit the following in postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf log_line_prefix = '< %m %u %d %p %r %a >' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- SC-13
- Severity
- H
- CCI
- CCI-002450
- Version
- PGS9-00-008000
- Vuln IDs
-
- V-214117
- V-72989
- Rule IDs
-
- SV-214117r508027_rule
- SV-87641
Checks: C-15333r360982_chk
First, as the system administrator, run the following to see if FIPS is enabled: $ cat /proc/sys/crypto/fips_enabled If fips_enabled is not 1, this is a finding.
Fix: F-15331r360983_fix
Configure OpenSSL to be FIPS compliant. PostgreSQL uses OpenSSL for cryptographic modules. To configure OpenSSL to be FIPS 140-2 compliant, see the official RHEL Documentation: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide-Federal_Standards_And_Regulations-Federal_Information_Processing_Standard.html For more information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G.
- RMF Control
- SC-13
- Severity
- H
- CCI
- CCI-002450
- Version
- PGS9-00-008200
- Vuln IDs
-
- V-214119
- V-72993
- Rule IDs
-
- SV-214119r508027_rule
- SV-87645
Checks: C-15335r360988_chk
First, as the system administrator, run the following to see if FIPS is enabled: $ cat /proc/sys/crypto/fips_enabled If fips_enabled is not 1, this is a finding.
Fix: F-15333r360989_fix
Configure OpenSSL to be FIPS compliant. PostgreSQL uses OpenSSL for cryptographic modules. To configure OpenSSL to be FIPS 140-2 compliant, see the official RHEL Documentation: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide-Federal_Standards_And_Regulations-Federal_Information_Processing_Standard.html For more information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G.
- RMF Control
- SC-28
- Severity
- M
- CCI
- CCI-001199
- Version
- PGS9-00-008300
- Vuln IDs
-
- V-214120
- V-72995
- Rule IDs
-
- SV-214120r508027_rule
- SV-87647
Checks: C-15336r360991_chk
If the application owner and Authorizing Official have determined that encryption of data at rest is NOT required, this is not a finding. One possible way to encrypt data within PostgreSQL is to use the pgcrypto extension. To check if pgcrypto is installed on PostgreSQL, as a database administrator (shown here as "postgres"), run the following command: $ sudo su - postgres $ psql -c "SELECT * FROM pg_available_extensions where name='pgcrypto'" If data in the database requires encryption and pgcrypto is not available, this is a finding. If disk or filesystem requires encryption, ask the system owner, DBA, and SA to demonstrate the use of disk-level encryption. If this is required and is not found, this is a finding. If controls do not exist or are not enabled, this is a finding.
Fix: F-15334r360992_fix
Apply appropriate controls to protect the confidentiality and integrity of data at rest in the database. The pgcrypto module provides cryptographic functions for PostgreSQL. See supplementary content APPENDIX-E for documentation on installing pgcrypto. With pgcrypto installed, it is possible to insert encrypted data into the database: INSERT INTO accounts(username, password) VALUES ('bob', crypt('a_secure_password', gen_salt('xdes')));
- RMF Control
- CM-11
- Severity
- M
- CCI
- CCI-001812
- Version
- PGS9-00-008400
- Vuln IDs
-
- V-214121
- V-72997
- Rule IDs
-
- SV-214121r508027_rule
- SV-87649
Checks: C-15337r360994_chk
If PostgreSQL supports only software development, experimentation and/or developer-level testing (that is, excluding production systems, integration testing, stress testing, and user acceptance testing), this is not a finding. Review PostgreSQL and database security settings with respect to non-administrative users' ability to create, alter, or replace logic modules, to include but not necessarily only stored procedures, functions, triggers, and views. To list the privileges for all tables and schemas, as the database administrator (shown here as "postgres"), run the following: $ sudo su - postgres $ psql -c "\dp" $ psql -c "\dn+" The privileges are as follows: rolename=xxxx -- privileges granted to a role =xxxx -- privileges granted to PUBLIC r -- SELECT ("read") w -- UPDATE ("write") a -- INSERT ("append") d -- DELETE D -- TRUNCATE x -- REFERENCES t -- TRIGGER X -- EXECUTE U -- USAGE C -- CREATE c -- CONNECT T -- TEMPORARY arwdDxt -- ALL PRIVILEGES (for tables, varies for other objects) * -- grant option for preceding privilege /yyyy -- role that granted this privilege If any such permissions exist and are not documented and approved, this is a finding.
Fix: F-15335r360995_fix
Document and obtain approval for any non-administrative users who require the ability to create, alter or replace logic modules. Implement the approved permissions. Revoke any unapproved permissions.
- RMF Control
- SC-2
- Severity
- M
- CCI
- CCI-001082
- Version
- PGS9-00-008500
- Vuln IDs
-
- V-214122
- V-72999
- Rule IDs
-
- SV-214122r508027_rule
- SV-87651
Checks: C-15338r360997_chk
Check PostgreSQL settings and vendor documentation to verify that administrative functionality is separate from user functionality. As the database administrator (shown here as "postgres"), list all roles and permissions for the database: $ sudo su - postgres $ psql -c "\du" If any non-administrative role has the attribute "Superuser", "Create role", "Create DB" or "Bypass RLS", this is a finding. If administrator and general user functionality are not separated either physically or logically, this is a finding.
Fix: F-15336r360998_fix
Configure PostgreSQL to separate database administration and general user functionality. Do not grant superuser, create role, create db or bypass rls role attributes to users that do not require it. To remove privileges, see the following example: ALTER ROLE <username> NOSUPERUSER NOCREATEDB NOCREATEROLE NOBYPASSRLS;
- RMF Control
- AU-14
- Severity
- M
- CCI
- CCI-001464
- Version
- PGS9-00-008600
- Vuln IDs
-
- V-214123
- V-73001
- Rule IDs
-
- SV-214123r508027_rule
- SV-87653
Checks: C-15339r361000_chk
As the database administrator (shown here as "postgres"), check the current settings by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If pgaudit is not in the current setting, this is a finding. As the database administrator (shown here as "postgres"), check the current settings by running the following SQL: $ psql -c "SHOW log_destination" If stderr or syslog are not in the current setting, this is a finding.
Fix: F-15337r361001_fix
Configure PostgreSQL to enable auditing. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. For session logging we suggest using pgaudit. For instructions on how to setup pgaudit, see supplementary content APPENDIX-B.
- RMF Control
- SC-28
- Severity
- M
- CCI
- CCI-002475
- Version
- PGS9-00-008700
- Vuln IDs
-
- V-214124
- V-73003
- Rule IDs
-
- SV-214124r508027_rule
- SV-87655
Checks: C-15340r361003_chk
Review the system documentation to determine whether the organization has defined the information at rest that is to be protected from modification, which must include, at a minimum, PII and classified information. If no information is identified as requiring such protection, this is not a finding. Review the configuration of PostgreSQL, operating system/file system, and additional software as relevant. If any of the information defined as requiring cryptographic protection from modification is not encrypted in a manner that provides the required level of protection, this is a finding. One possible way to encrypt data within PostgreSQL is to use pgcrypto extension. To check if pgcrypto is installed on PostgreSQL, as a database administrator (shown here as "postgres"), run the following command: $ sudo su - postgres $ psql -c "SELECT * FROM pg_available_extensions where name='pgcrypto'" If data in the database requires encryption and pgcrypto is not available, this is a finding. If disk or filesystem requires encryption, ask the system owner, DBA, and SA to demonstrate filesystem or disk level encryption. If this is required and is not found, this is a finding.
Fix: F-15338r361004_fix
Configure PostgreSQL, operating system/file system, and additional software as relevant, to provide the required level of cryptographic protection. The pgcrypto module provides cryptographic functions for PostgreSQL. See supplementary content APPENDIX-E for documentation on installing pgcrypto. With pgcrypto installed, it's possible to insert encrypted data into the database: INSERT INTO accounts(username, password) VALUES ('bob', crypt('a_secure_password', gen_salt('md5')));
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-000133
- Version
- PGS9-00-008800
- Vuln IDs
-
- V-214125
- V-73005
- Rule IDs
-
- SV-214125r508027_rule
- SV-87657
Checks: C-15341r361006_chk
Check PostgreSQL settings and existing audit records to verify information specific to the source (origin) of the event is being captured and stored with audit records. As the database administrator (usually postgres, check the current log_line_prefix and log_hostname setting by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_line_prefix" $ psql -c "SHOW log_hostname" For a complete list of extra information that can be added to log_line_prefix, see the official documentation: https://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-LINE-PREFIX If the current settings do not provide enough information regarding the source of the event, this is a finding.
Fix: F-15339r361007_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. If logging is enabled the following configurations can be made to log the source of an event. First, as the database administrator, edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf ###### Log Line Prefix Extra parameters can be added to the setting log_line_prefix to log source of event: # %a = application name # %u = user name # %d = database name # %r = remote host and port # %p = process ID # %m = timestamp with milliseconds For example: log_line_prefix = '< %m %a %u %d %r %p %m >' ###### Log Hostname By default only IP address is logged. To also log the hostname the following parameter can also be set in postgresql.conf: log_hostname = on Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- PGS9-00-008900
- Vuln IDs
-
- V-214126
- V-73007
- Rule IDs
-
- SV-214126r508027_rule
- SV-87659
Checks: C-15342r361009_chk
To get a list of all extensions installed, use the following commands: $ sudo su - postgres $ psql -c "select * from pg_extension where extname != 'plpgsql'" If any extensions exist that are not approved, this is a finding.
Fix: F-15340r361010_fix
To remove extensions, use the following commands: $ sudo su - postgres $ psql -c "DROP EXTENSION <extension_name>" Note: It is recommended that plpgsql not be removed.
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- PGS9-00-009100
- Vuln IDs
-
- V-214127
- V-73009
- Rule IDs
-
- SV-214127r508027_rule
- SV-87661
Checks: C-15343r361012_chk
PostgreSQL’s Copy command can interact with the underlying OS. Only superuser has access to this command. First, as the database administrator (shown here as "postgres"), run the following SQL to list all roles and their privileges: $ sudo su - postgres $ psql -x -c "\du" If any role has "superuser" that should not, this is a finding. It is possible for an extension to contain code that could access external executables via SQL. To list all installed extensions, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -x -c "SELECT * FROM pg_available_extensions WHERE installed_version IS NOT NULL" If any extensions are installed that are not approved, this is a finding.
Fix: F-15341r361013_fix
To remove superuser from a role, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "ALTER ROLE <role-name> WITH NOSUPERUSER" To remove extensions from PostgreSQL, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "DROP EXTENSION extension_name"
- RMF Control
- CM-7
- Severity
- M
- CCI
- CCI-000381
- Version
- PGS9-00-009200
- Vuln IDs
-
- V-214128
- V-73011
- Rule IDs
-
- SV-214128r508027_rule
- SV-87663
Checks: C-15344r361015_chk
To list all installed packages, as the system administrator, run the following: # RHEL/CENT Systems $ sudo yum list installed | grep postgres # Debian Systems $ dpkg --get-selections | grep postgres If any packages are installed that are not required, this is a finding.
Fix: F-15342r361016_fix
To remove any unneeded executables, as the system administrator, run the following: # RHEL/CENT Systems $ sudo yum erase <package_name> # Debian Systems $ sudo apt-get remove <package_name>
- RMF Control
- AC-16
- Severity
- M
- CCI
- CCI-002263
- Version
- PGS9-00-009400
- Vuln IDs
-
- V-214129
- V-73013
- Rule IDs
-
- SV-214129r508027_rule
- SV-87665
Checks: C-15345r361018_chk
If security labeling is not required, this is not a finding. First, as the database administrator (shown here as "postgres"), run the following SQL against each table that requires security labels: $ sudo su - postgres $ psql -c "\d+ <schema_name>.<table_name>" If security labeling requirements have been specified, but the security labeling is not implemented or does not reliably maintain labels on information in process, this is a finding.
Fix: F-15343r361019_fix
In addition to the SQL-standard privilege system available through GRANT, tables can have row security policies that restrict, on a per-user basis, which rows can be returned by normal queries or inserted, updated, or deleted by data modification commands. This feature is also known as Row-Level Security (RLS). RLS policies can be very different depending on their use case. For one example of using RLS for Security Labels, see supplementary content APPENDIX-D.
- RMF Control
- IA-5
- Severity
- M
- CCI
- CCI-000196
- Version
- PGS9-00-009500
- Vuln IDs
-
- V-214130
- V-73015
- Rule IDs
-
- SV-214130r508027_rule
- SV-87667
Checks: C-15346r361021_chk
To check if password encryption is enabled, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "SHOW password_encryption" If password_encryption is not on, this is a finding. Next, to identify if any passwords have been stored without being hashed and salted, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -x -c "SELECT * FROM pg_shadow" If any password is in plaintext, this is a finding.
Fix: F-15344r361022_fix
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 = on 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?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} restart
- RMF Control
- CM-5
- Severity
- M
- CCI
- CCI-001813
- Version
- PGS9-00-009600
- Vuln IDs
-
- V-214131
- V-73017
- Rule IDs
-
- SV-214131r508027_rule
- SV-87669
Checks: C-15347r361024_chk
To list all the permissions of individual roles, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "\du If any role has SUPERUSER that should not, this is a finding. Next, list all the permissions of databases and schemas by running the following SQL: $ sudo su - postgres $ psql -c "\l" $ psql -c "\dn+" If any database or schema has update ("W") or create ("C") privileges and should not, this is a finding.
Fix: F-15345r361025_fix
Configure PostgreSQL to enforce access restrictions associated with changes to the configuration of PostgreSQL or database(s). Use ALTER ROLE to remove accesses from roles: $ psql -c "ALTER ROLE <role_name> NOSUPERUSER" Use REVOKE to remove privileges from databases and schemas: $ psql -c "REVOKE ALL PRIVILEGES ON <table> FROM <role_name>"
- RMF Control
- AU-10
- Severity
- M
- CCI
- CCI-000166
- Version
- PGS9-00-009700
- Vuln IDs
-
- V-214132
- V-73019
- Rule IDs
-
- SV-214132r508027_rule
- SV-87671
Checks: C-15348r361027_chk
First, as the database administrator, review the current log_line_prefix settings by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_line_prefix" If log_line_prefix does not contain at least '< %m %a %u %d %r %p %m >', this is a finding. Next, review the current shared_preload_libraries settings by running the following SQL: $ psql -c "SHOW shared_preload_libraries" If shared_preload_libraries does not contain "pgaudit", this is a finding.
Fix: F-15346r361028_fix
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. Configure the database to supply additional auditing information to protect against a user falsely repudiating having performed organization-defined actions. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. Modify the configuration of audit logs to include details identifying the individual user: First, as the database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Extra parameters can be added to the setting log_line_prefix to identify the user: log_line_prefix = '< %m %a %u %d %r %p %m >' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload Use accounts assigned to individual users. Where the application connects to PostgreSQL using a standard, shared account, ensure that it also captures the individual user identification and passes it to PostgreSQL.
- RMF Control
- AU-5
- Severity
- M
- CCI
- CCI-001855
- Version
- PGS9-00-009900
- Vuln IDs
-
- V-214133
- V-73023
- Rule IDs
-
- SV-214133r508027_rule
- SV-87675
Checks: C-15349r361030_chk
Review system configuration. If no script/tool is monitoring the partition for the PostgreSQL log directories, this is a finding. If appropriate support staff are not notified immediately upon storage volume utilization reaching 75%, this is a finding.
Fix: F-15347r361031_fix
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. Configure the system to notify appropriate support staff immediately upon storage volume utilization reaching 75%. PostgreSQL does not monitor storage, however, it is possible to monitor storage with a script. ##### Example Monitoring Script #!/bin/bash PGDATA=/var/lib/psql/${PGVER?}/data CURRENT=$(df ${PGDATA?} | grep / | awk '{ print $5}' | sed 's/%//g') THRESHOLD=75 if [ "$CURRENT" -gt "$THRESHOLD" ] ; then mail -s 'Disk Space Alert' mail@support.com << EOF The data directory volume is almost full. Used: $CURRENT %EOF fi Schedule this script in cron to run around the clock.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-001914
- Version
- PGS9-00-010000
- Vuln IDs
-
- V-214134
- V-73025
- Rule IDs
-
- SV-214134r508027_rule
- SV-87677
Checks: C-15350r361033_chk
First, as the database administrator, check if pgaudit is present in shared_preload_libraries: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If pgaudit is not present in the result from the query, this is a finding.
Fix: F-15348r361034_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. For audit logging we suggest using pgaudit. For instructions on how to setup pgaudit, see supplementary content APPENDIX-B. As a superuser (postgres), any pgaudit parameter can be changed in postgresql.conf. Configurations can only be changed by a superuser. ### Example: Change Auditing To Log Any ROLE Statements Note: This will override any setting already configured. Alter the configuration to do role-based logging: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log = 'role' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload ### Example: Set An Auditing Role And Grant Privileges An audit role can be configured and granted privileges to specific tables and columns that need logging. ##### Create Test Table $ sudo su - postgres $ psql -c "CREATE TABLE public.stig_audit_example(id INT, name TEXT, password TEXT);" ##### Define Auditing Role As PostgreSQL superuser (such as postgres), add the following to postgresql.conf or any included configuration files. $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.role = 'auditor' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload Next in PostgreSQL create a new role: postgres=# CREATE ROLE auditor; postgres=# GRANT select(password) ON public.stig_audit_example TO auditor; Note: This role is created with NOLOGIN privileges by default. Now any SELECT on the column password will be logged: $ sudo su - postgres $ psql -c "SELECT password FROM public.stig_audit_example;" $ cat ${PGDATA?}/pg_log/<latest_log> < 2016-01-28 16:46:09.038 UTC bob postgres: >LOG: AUDIT: OBJECT,6,1,READ,SELECT,TABLE,public.stig_audit_example,SELECT password FROM stig_audit_example;,<none> ## Change Configurations During A Specific Timeframe Deploy PostgreSQL that allows audit configuration changes to take effect within the timeframe required by the application owner and without involving actions or events that the application owner rules unacceptable. Crontab can be used to do this. For a specific audit role: # Grant specific audit privileges to an auditing role at 5 PM every day of the week, month, year at the 0 minute mark. 0 5 * * * postgres /usr/bin/psql -c "GRANT select(password) ON public.stig_audit_example TO auditor;" # Revoke specific audit privileges to an auditing role at 5 PM every day of the week, month, year at the 0 minute mark. 0 17 * * * postgres /usr/bin/psql -c "REVOKE select(password) ON public.stig_audit_example FROM auditor;"
- RMF Control
- IA-11
- Severity
- M
- CCI
- CCI-002038
- Version
- PGS9-00-010100
- Vuln IDs
-
- V-214135
- V-73027
- Rule IDs
-
- SV-214135r508027_rule
- SV-87679
Checks: C-15351r361036_chk
Determine all situations where a user must re-authenticate. Check if the mechanisms that handle such situations use the following SQL: To make a single user re-authenticate, the following must be present: SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE user='<username>' To make all users re-authenticate, run the following: SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE user LIKE '%' If the provided SQL does not force re-authentication, this is a finding.
Fix: F-15349r361037_fix
Modify and/or configure PostgreSQL and related applications and tools so that users are always required to reauthenticate when changing role or escalating privileges. To make a single user re-authenticate, the following must be present: SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE user='<username>' To make all users re-authenticate, the following must be present: SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE user LIKE '%'
- RMF Control
- IA-5
- Severity
- H
- CCI
- CCI-000186
- Version
- PGS9-00-010200
- Vuln IDs
-
- V-214136
- V-73029
- Rule IDs
-
- SV-214136r508027_rule
- SV-87681
Checks: C-15352r361039_chk
First, as the database administrator (shown here as "postgres"), verify the following settings: Note: If no specific directory given before the filename, the files are stored in PGDATA. $ sudo su - postgres $ psql -c "SHOW ssl_ca_file" $ psql -c "SHOW ssl_cert_file" $ psql -c "SHOW ssl_crl_file" $ psql -c "SHOW ssl_key_file" If the directory these files are stored in is not protected, this is a finding.
Fix: F-15350r361040_fix
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. Store all PostgreSQL PKI private keys in a FIPS 140-2-validated cryptographic module. Ensure access to PostgreSQL PKI private keys is restricted to only authenticated and authorized users. PostgreSQL private key(s) can be stored in $PGDATA directory, which is only accessible by the database owner (usually postgres, DBA) user. Do not allow access to this system account to unauthorized users. To put the keys in a different directory, as the database administrator (shown here as "postgres"), set the following settings to a protected directory: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf ssl_ca_file = "/some/protected/directory/root.crt" ssl_crl_file = "/some/protected/directory/root.crl" ssl_cert_file = "/some/protected/directory/server.crt" ssl_key_file = "/some/protected/directory/server.key" Now, as the system administrator, restart the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl restart postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} restart For more information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G.
- RMF Control
- SC-23
- Severity
- M
- CCI
- CCI-002470
- Version
- PGS9-00-010300
- Vuln IDs
-
- V-214137
- V-73031
- Rule IDs
-
- SV-214137r508027_rule
- SV-87683
Checks: C-15353r361042_chk
As the database administrator (shown here as "postgres"), verify the following setting in postgresql.conf: $ sudo su - postgres $ psql -c "SHOW ssl_ca_file" $ psql -c "SHOW ssl_cert_file" If the database is not configured to used approved certificates, this is a finding.
Fix: F-15351r361043_fix
Revoke trust in any certificates not issued by a DoD-approved certificate authority. Configure PostgreSQL to accept only DoD and DoD-approved PKI end-entity certificates. To configure PostgreSQL to accept approved CA's, see the official PostgreSQL documentation: http://www.postgresql.org/docs/current/static/ssl-tcp.html For more information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G.
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-000130
- Version
- PGS9-00-010400
- Vuln IDs
-
- V-214138
- V-73033
- Rule IDs
-
- SV-214138r508027_rule
- SV-87685
Checks: C-15354r361045_chk
As the database administrator (shown here as "postgres"), verify the current log_line_prefix setting in postgresql.conf: $ sudo su - postgres $ psql -c "SHOW log_line_prefix" Verify that the current settings are appropriate for the organization. The following is what is possible for logged information: # %a = application name # %u = user name # %d = database name # %r = remote host and port # %h = remote host # %p = process ID # %t = timestamp without milliseconds # %m = timestamp with milliseconds # %i = command tag # %e = SQL state # %c = session ID # %l = session line number # %s = session start timestamp # %v = virtual transaction ID # %x = transaction ID (0 if none) # %q = stop here in non-session # processes If the audit record does not log events required by the organization, this is a finding. Next, verify the current settings of log_connections and log_disconnections by running the following SQL: $ psql -c "SHOW log_connections" $ psql -c "SHOW log_disconnections" If both settings are off, this is a finding.
Fix: F-15352r361046_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. If logging is enabled the following configurations must be made to log connections, date/time, username and session identifier. First, edit the postgresql.conf file as a privileged user: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Edit the following parameters based on the organization's needs (minimum requirements are as follows): log_connections = on log_disconnections = on log_line_prefix = '< %m %u %d %c: >' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- SC-28
- Severity
- M
- CCI
- CCI-002476
- Version
- PGS9-00-010500
- Vuln IDs
-
- V-214139
- V-73035
- Rule IDs
-
- SV-214139r508027_rule
- SV-87687
Checks: C-15355r361048_chk
To check if pgcrypto is installed on PostgreSQL, as a database administrator (shown here as "postgres"), run the following command: $ sudo su - postgres $ psql -c "SELECT * FROM pg_available_extensions where name='pgcrypto'" If data in the database requires encryption and pgcrypto is not available, this is a finding. If a disk or filesystem requires encryption, ask the system owner, DBA, and SA to demonstrate the use of filesystem and/or disk-level encryption. If this is required and is not found, this is a finding.
Fix: F-15353r361049_fix
Configure PostgreSQL, operating system/file system, and additional software as relevant, to provide the required level of cryptographic protection for information requiring cryptographic protection against disclosure. Secure the premises, equipment, and media to provide the required level of physical protection. The pgcrypto module provides cryptographic functions for PostgreSQL. See supplementary content APPENDIX-E for documentation on installing pgcrypto. With pgcrypto installed, it is possible to insert encrypted data into the database: INSERT INTO accounts(username, password) VALUES ('bob', crypt('a_secure_password', gen_salt('md5')));
- RMF Control
- SC-23
- Severity
- M
- CCI
- CCI-001185
- Version
- PGS9-00-010600
- Vuln IDs
-
- V-214140
- V-73037
- Rule IDs
-
- SV-214140r508027_rule
- SV-87689
Checks: C-15356r361051_chk
As the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "SHOW tcp_keepalives_idle" $ psql -c "SHOW tcp_keepalives_interval" $ psql -c "SHOW tcp_keepalives_count" $ psql -c "SHOW statement_timeout" If these settings are not set, this is a finding.
Fix: F-15354r361052_fix
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. As the database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi $PGDATA/postgresql.conf Set the following parameters to organizational requirements: statement_timeout = 10000 #milliseconds tcp_keepalives_idle = 10 # seconds tcp_keepalives_interval = 10 # seconds tcp_keepalives_count = 10 Now, as the system administrator, restart the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl restart postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} restart
- RMF Control
- AU-9
- Severity
- M
- CCI
- CCI-001493
- Version
- PGS9-00-010700
- Vuln IDs
-
- V-214141
- V-73039
- Rule IDs
-
- SV-214141r508027_rule
- SV-87691
Checks: C-15357r361054_chk
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. Only the database owner and superuser can alter configuration of PostgreSQL. Make sure the pg_log directory are owned by postgres user and group: $ sudo su - postgres $ ls -la ${PGDATA?}/pg_log If pg_log is not owned by the database owner, this is a finding. Make sure the data directory are owned by postgres user and group. $ sudo su - postgres $ ls -la ${PGDATA?} If PGDATA is not owned by the database owner, this is a finding. Make sure pgaudit installation is owned by root: $ sudo su - postgres $ ls -la /usr/pgsql-${PGVER?}/share/contrib/pgaudit If pgaudit installation is not owned by root, this is a finding. Next, as the database administrator (shown here as "postgres"), run the following SQL to list all roles and their privileges: $ sudo su - postgres $ psql -x -c "\du" If any role has "superuser" that should not, this is a finding.
Fix: F-15355r361055_fix
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. If pg_log or data directory are not owned by postgres user and group, configure them as follows: $ sudo chown -R postgres:postgres ${PGDATA?} If the pgaudit installation is not owned by root user and group, configure it as follows: $ sudo chown -R root:root /usr/pgsql-${PGVER?}/share/contrib/pgaudit To remove superuser from a role, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "ALTER ROLE <role-name> WITH NOSUPERUSER"
- RMF Control
- AU-3
- Severity
- M
- CCI
- CCI-000131
- Version
- PGS9-00-011100
- Vuln IDs
-
- V-214142
- V-73041
- Rule IDs
-
- SV-214142r508027_rule
- SV-87693
Checks: C-15358r361057_chk
As the database administrator (usually postgres), run the following SQL: $ sudo su - postgres $ psql -c "SHOW log_line_prefix" If the query result does not contain "%m", this is a finding.
Fix: F-15356r361058_fix
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. Logging must be enabled in order to capture timestamps. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. If logging is enabled the following configurations must be made to log events with timestamps: First, as the database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add %m to log_line_prefix to enable timestamps with milliseconds: log_line_prefix = '< %m >' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-9
- Severity
- M
- CCI
- CCI-001495
- Version
- PGS9-00-011200
- Vuln IDs
-
- V-214143
- V-73043
- Rule IDs
-
- SV-214143r508027_rule
- SV-87695
Checks: C-15359r361060_chk
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. As the database administrator (shown here as "postgres"), verify the permissions of PGDATA: $ sudo su - postgres $ ls -la ${PGDATA?} If PGDATA is not owned by postgres:postgres or if files can be accessed by others, this is a finding. As the system administrator, verify the permissions of pgsql shared objects and compiled binaries: $ ls -la /usr/pgsql-${PGVER?}/bin $ ls -la /usr/pgsql-${PGVER?}/include $ ls -la /usr/pgsql-${PGVER?}/lib $ ls -la /usr/pgsql-${PGVER?}/share If any of these are not owned by root:root, this is a finding.
Fix: F-15357r361061_fix
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. As the system administrator, change the permissions of PGDATA: $ sudo chown -R postgres:postgres ${PGDATA?} $ sudo chmod 700 ${PGDATA?} As the system administrator, change the permissions of pgsql: $ sudo chown -R root:root /usr/pgsql-${PGVER?}
- RMF Control
- AU-4
- Severity
- M
- CCI
- CCI-001851
- Version
- PGS9-00-011300
- Vuln IDs
-
- V-214144
- V-73045
- Rule IDs
-
- SV-214144r508027_rule
- SV-87697
Checks: C-15360r361063_chk
First, as the database administrator (shown here as "postgres"), ensure PostgreSQL uses syslog by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_destination" If log_destination is not syslog, this is a finding. Next, as the database administrator, check which log facility is configured by running the following SQL: $ psql -c "SHOW syslog_facility" Check with the organization to see how syslog facilities are defined in their organization. If the wrong facility is configured, this is a finding. If PostgreSQL does not have a continuous network connection to the centralized log management system, and PostgreSQL audit records are not transferred to the centralized log management system weekly or more often, this is a finding.
Fix: F-15358r361064_fix
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. Configure PostgreSQL or deploy and configure software tools to transfer audit records to a centralized log management system, continuously and in near-real time where a continuous network connection to the log management system exists, or at least weekly in the absence of such a connection. To ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. With logging enabled, as the database administrator (shown here as "postgres"), configure the follow parameters in postgresql.conf (the example uses the default values - tailor for environment): Note: Consult the organization on how syslog facilities are defined in the syslog daemon configuration. $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf log_destination = 'syslog' syslog_facility = 'LOCAL0' syslog_ident = 'postgres' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- SC-23
- Severity
- M
- CCI
- CCI-001188
- Version
- PGS9-00-011400
- Vuln IDs
-
- V-214145
- V-73047
- Rule IDs
-
- SV-214145r508027_rule
- SV-87699
Checks: C-15361r361066_chk
To check if PostgreSQL is configured to use ssl, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "SHOW ssl" If this is not set to on, this is a finding.
Fix: F-15359r361067_fix
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 configure PostgreSQL to use SSL, as a database owner (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameter: ssl = on Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload For more information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G. For further SSL configurations, see the official documentation: https://www.postgresql.org/docs/current/static/ssl-tcp.html
- RMF Control
- IA-2
- Severity
- M
- CCI
- CCI-000764
- Version
- PGS9-00-011500
- Vuln IDs
-
- V-214146
- V-73049
- Rule IDs
-
- SV-214146r508027_rule
- SV-87701
Checks: C-15362r361069_chk
Review PostgreSQL settings to determine whether organizational users are uniquely identified and authenticated when logging on/connecting to the system. To list all roles in the database, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "\du" If organizational users are not uniquely identified and authenticated, this is a finding. Next, as the database administrator (shown here as "postgres"), verify the current pg_hba.conf authentication settings: $ sudo su - postgres $ cat ${PGDATA?}/pg_hba.conf If every role does not have unique authentication requirements, this is a finding. If accounts are determined to be shared, determine if individuals are first individually authenticated. If individuals are not individually authenticated before using the shared account, this is a finding.
Fix: F-15360r361070_fix
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. Configure PostgreSQL settings to uniquely identify and authenticate all organizational users who log on/connect to the system. To create roles, use the following SQL: CREATE ROLE <role_name> [OPTIONS] For more information on CREATE ROLE, see the official documentation: https://www.postgresql.org/docs/current/static/sql-createrole.html For each role created, the database administrator can specify database authentication by editing pg_hba.conf: $ sudo su - postgres $ vi ${PGDATA?}/pg_hba.conf An example pg_hba entry looks like this: # TYPE DATABASE USER ADDRESS METHOD host test_db bob 192.168.0.0/16 md5 For more information on pg_hba.conf, see the official documentation: https://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html
- RMF Control
- AC-12
- Severity
- M
- CCI
- CCI-002361
- Version
- PGS9-00-011600
- Vuln IDs
-
- V-214147
- V-73051
- Rule IDs
-
- SV-214147r508027_rule
- SV-87703
Checks: C-15363r361072_chk
Review system documentation to obtain the organization's definition of circumstances requiring automatic session termination. If the documentation explicitly states that such termination is not required or is prohibited, this is not a finding. If the documentation requires automatic session termination, but PostgreSQL is not configured accordingly, this is a finding.
Fix: F-15361r361073_fix
Configure PostgreSQL to automatically terminate a user session after organization-defined conditions or trigger events requiring session termination. Examples follow. ### Change a role to nologin and disconnect the user ALTER ROLE '<username>' NOLOGIN; SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE usename='<usename>'; ### Disconnecting users during a specific time range See supplementary content APPENDIX-A for a bash script for this example. The script found in APPENDIX-A using the -l command can disable all users with rolcanlogin=t from logging in. The script keeps track of who it disables in a .restore_login file. After the specified time is over, the same script can be run with the -r command to restore all login connections. This script would be added to a cron job: # lock at 5 am every day of the week, month, year at the 0 minute mark. 0 5 * * * postgres /var/lib/pgsql/no_login.sh -d postgres -l # restore at 5 pm every day of the week, month, year at the 0 minute mark. 0 17 * * * postgres /var/lib/pgsql/no_login.sh -d postgres -r
- RMF Control
- AC-6
- Severity
- H
- CCI
- CCI-002235
- Version
- PGS9-00-011700
- Vuln IDs
-
- V-214148
- V-73053
- Rule IDs
-
- SV-214148r508027_rule
- SV-87705
Checks: C-15364r361075_chk
Review the system documentation to obtain the definition of the PostgreSQL functionality considered privileged in the context of the system in question. Review the PostgreSQL security configuration and/or other means used to protect privileged functionality from unauthorized use. If the configuration does not protect all of the actions defined as privileged, this is a finding. If PostgreSQL instance uses procedural languages, such as pl/Python or pl/R, without AO authorization, this is a finding.
Fix: F-15362r361076_fix
Configure PostgreSQL security to protect all privileged functionality. If pl/R and pl/Python are used, document their intended use, document users that have access to pl/R and pl/Python, as well as their business use case, such as data-analytics or data-mining. Because of the risks associated with using pl/R and pl/Python, their use must have AO risk acceptance. To remove unwanted extensions, use: DROP EXTENSION <extension_name> To remove unwanted privileges from a role, use the REVOKE command. See the PostgreSQL documentation for more details: http://www.postgresql.org/docs/current/static/sql-revoke.html
- RMF Control
- IA-5
- Severity
- M
- CCI
- CCI-000187
- Version
- PGS9-00-011800
- Vuln IDs
-
- V-214149
- V-73055
- Rule IDs
-
- SV-214149r508027_rule
- SV-87707
Checks: C-15365r361078_chk
The cn (Common Name) attribute of the certificate will be compared to the requested database user name, and if they match the login will be allowed. To check the cn of the certificate, using openssl, do the following: $ openssl x509 -noout -subject -in client_cert If the cn does not match the users listed in PostgreSQL and no user mapping is used, this is a finding. User name mapping can be used to allow cn to be different from the database user name. If User Name Maps are used, run the following as the database administrator (shown here as "postgres"), to get a list of maps used for authentication: $ sudo su - postgres $ grep "map" ${PGDATA?}/pg_hba.conf With the names of the maps used, check those maps against the user name mappings in pg_ident.conf: $ sudo su - postgres $ cat ${PGDATA?}/pg_ident.conf If user accounts are not being mapped to authenticated identities, this is a finding. If the cn and the username mapping do not match, this is a finding.
Fix: F-15363r361079_fix
Configure PostgreSQL to map authenticated identities directly to PostgreSQL user accounts. For information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G.
- RMF Control
- SC-4
- Severity
- M
- CCI
- CCI-001090
- Version
- PGS9-00-011900
- Vuln IDs
-
- V-214150
- V-73057
- Rule IDs
-
- SV-214150r508027_rule
- SV-87709
Checks: C-15366r361081_chk
Review the procedures for the refreshing of development/test data from production. Review any scripts or code that exists for the movement of production data to development/test systems, or to any other location or for any other purpose. Verify that copies of production data are not left in unprotected locations. If the code that exists for data movement does not comply with the organization-defined data transfer policy and/or fails to remove any copies of production data from unprotected locations, this is a finding.
Fix: F-15364r361082_fix
Modify any code used for moving data from production to development/test systems to comply with the organization-defined data transfer policy, and to ensure copies of production data are not left in unsecured locations.
- RMF Control
- SC-4
- Severity
- M
- CCI
- CCI-001090
- Version
- PGS9-00-012000
- Vuln IDs
-
- V-214151
- V-73059
- Rule IDs
-
- SV-214151r508027_rule
- SV-87711
Checks: C-15367r361084_chk
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. Review the permissions granted to users by the operating system/file system on the database files, database log files and database backup files. To verify that all files are owned by the database administrator and have the correct permissions, run the following as the database administrator (shown here as "postgres"): $ sudo su - postgres $ ls -lR ${PGDATA?} If any files are not owned by the database administrator or allow anyone but the database administrator to read/write/execute, this is a finding. If any user/role who is not an authorized system administrator with a need-to-know or database administrator with a need-to-know, or a system account for running PostgreSQL processes, is permitted to read/view any of these files, this is a finding.
Fix: F-15365r361085_fix
Note: The following instructions use the PGDATA environment variable. See supplementary content APPENDIX-F for instructions on configuring PGDATA. Configure the permissions granted by the operating system/file system on the database files, database log files, and database backup files so that only relevant system accounts and authorized system administrators and database administrators with a need to know are permitted to read/view these files. Any files (for example: extra configuration files) created in PGDATA must be owned by the database administrator, with only owner permissions to read, write, and execute.
- RMF Control
- AU-9
- Severity
- M
- CCI
- CCI-001494
- Version
- PGS9-00-012200
- Vuln IDs
-
- V-214152
- V-73061
- Rule IDs
-
- SV-214152r508027_rule
- SV-87713
Checks: C-15368r361087_chk
All configurations for auditing and logging can be found in the postgresql.conf configuration file. By default, this file is owned by the database administrator account. To check that the permissions of the postgresql.conf are owned by the database administrator with permissions of 0600, run the following as the database administrator (shown here as "postgres"): $ sudo su - postgres $ ls -la ${PGDATA?} If postgresql.conf is not owned by the database administrator or does not have 0600 permissions, this is a finding. #### stderr Logging To check that logs are created with 0600 permissions, check the postgresql.conf file for the following setting: $ sudo su - postgres $ psql -c "SHOW log_file_mode" If permissions are not 0600, this is a finding. #### syslog Logging If PostgreSQL is configured to use syslog, verify that the logs are owned by root and have 0600 permissions. If they are not, this is a finding.
Fix: F-15366r361088_fix
Apply or modify access controls and permissions (both within PostgreSQL and in the file system/operating system) to tools used to view or modify audit log data. Tools must be configurable by authorized personnel only. $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf log_file_mode = 0600 Next, as the database administrator (shown here as "postgres"), change the ownership and permissions of configuration files in PGDATA: $ sudo su - postgres $ chown postgres:postgres ${PGDATA?}/*.conf $ chmod 0600 ${PGDATA?}/*.conf
- RMF Control
- IA-7
- Severity
- H
- CCI
- CCI-000803
- Version
- PGS9-00-012300
- Vuln IDs
-
- V-214153
- V-73063
- Rule IDs
-
- SV-214153r508027_rule
- SV-87715
Checks: C-15369r361090_chk
As the system administrator, run the following: $ openssl version If "fips" is not included in the openssl version, this is a finding.
Fix: F-15367r361091_fix
Configure OpenSSL to meet FIPS Compliance using the following documentation in section 9.1: http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1758.pdf For more information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G.
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-012500
- Vuln IDs
-
- V-214154
- V-73065
- Rule IDs
-
- SV-214154r508027_rule
- SV-87717
Checks: C-15370r361093_chk
As the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain "pgaudit", this is a finding. Verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15368r361094_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations can be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log='ddl, role, read, write' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-012600
- Vuln IDs
-
- V-214155
- V-73067
- Rule IDs
-
- SV-214155r508027_rule
- SV-87719
Checks: C-15371r361096_chk
As the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain "pgaudit", this is a finding. Verify that role, read, write, and ddl auditing are enabled: $ psql -c "SHOW pgaudit.log" If the output does not contain role, read, write, and ddl, this is a finding.
Fix: F-15369r361097_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. If logging is enabled, the following configurations must be made to log unsuccessful connections, date/time, username, and session identifier. As the database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Edit the following parameters: log_connections = on log_line_prefix = '< %m %u %c: >' pgaudit.log = 'read, write' Where: * %m is the time and date * %u is the username * %c is the session ID for the connection As the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- AU-12
- Severity
- M
- CCI
- CCI-000172
- Version
- PGS9-00-012700
- Vuln IDs
-
- V-214156
- V-73069
- Rule IDs
-
- SV-214156r508027_rule
- SV-87721
Checks: C-15372r361099_chk
As the database administrator, verify pgaudit is enabled by running the following SQL: $ sudo su - postgres $ psql -c "SHOW shared_preload_libraries" If the output does not contain "pgaudit", this is a finding. Verify that connections and disconnections are being logged by running the following SQL: $ sudo su - postgres $ psql -c "SHOW log_connections" $ psql -c "SHOW log_disconnections" If the output does not contain "on", this is a finding.
Fix: F-15370r361100_fix
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 ensure that logging is enabled, review supplementary content APPENDIX-C for instructions on enabling logging. Using pgaudit PostgreSQL can be configured to audit these requests. See supplementary content APPENDIX-B for documentation on installing pgaudit. With pgaudit installed the following configurations should be made: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameters (or edit existing parameters): pgaudit.log='ddl, role, read, write' log_connections='on' log_disconnections='on' Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload
- RMF Control
- IA-7
- Severity
- H
- CCI
- CCI-000803
- Version
- PGS9-00-012800
- Vuln IDs
-
- V-214157
- V-73071
- Rule IDs
-
- SV-214157r508027_rule
- SV-87723
Checks: C-15373r361102_chk
If the deployment incorporates a custom build of the operating system and PostgreSQL guaranteeing the use of FIPS 140-2- compliant OpenSSL, this is not a finding. Go to the below webpage and click "show all": https://csrc.nist.gov/projects/cryptographic-module-validation-program/validated-modules/search Note: Certificates 3130, 3016, and 2441 are the most common. If the OS is not using a FIPS 140-2 certified implementation that is listed, this is a finding. If FIPS encryption is not enabled, this is a finding.
Fix: F-15371r361103_fix
Install PostgreSQL on an operating system with FIPS-compliant cryptography enabled; or by other means ensure that FIPS 140-2-certified OpenSSL libraries are used by the DBMS.
- RMF Control
- SC-13
- Severity
- M
- CCI
- CCI-002450
- Version
- PGS9-00-008100
- Vuln IDs
-
- V-220321
- V-72991
- Rule IDs
-
- SV-220321r508027_rule
- SV-87643
Checks: C-22036r392699_chk
If PostgreSQL is deployed in an unclassified environment, this is not applicable (NA). If PostgreSQL is not using NSA-approved cryptography to protect classified information in accordance with applicable federal laws, Executive Orders, directives, policies, regulations, and standards, this is a finding. To check if PostgreSQL is configured to use SSL, as the database administrator (shown here as "postgres"), run the following SQL: $ sudo su - postgres $ psql -c "SHOW ssl" If SSL is off, this is a finding. Consult network administration staff to determine whether the server is protected by NSA-approved encrypting devices. If not, this a finding.
Fix: F-22026r392700_fix
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 configure PostgreSQL to use SSL, as a database administrator (shown here as "postgres"), edit postgresql.conf: $ sudo su - postgres $ vi ${PGDATA?}/postgresql.conf Add the following parameter: ssl = on Now, as the system administrator, reload the server with the new configuration: # SYSTEMD SERVER ONLY $ sudo systemctl reload postgresql-${PGVER?} # INITD SERVER ONLY $ sudo service postgresql-${PGVER?} reload For more information on configuring PostgreSQL to use SSL, see supplementary content APPENDIX-G. Deploy NSA-approved encrypting devices to protect the server on the network.