Check: CD12-00-011500
Crunchy Data PostgreSQL STIG:
CD12-00-011500
(in versions v2 r2 through v1 r1)
Title
PostgreSQL must uniquely identify and authenticate organizational users (or processes acting on behalf of organizational users). (Cat II impact)
Discussion
To ensure accountability and prevent unauthenticated access, organizational users must be identified and authenticated to prevent potential misuse and compromise of the system. Organizational users include organizational employees or individuals the organization deems to have equivalent status of employees (e.g., contractors). Organizational users (and any processes acting on behalf of users) must be uniquely identified and authenticated for all accesses, except the following: (i) Accesses explicitly identified and documented by the organization. Organizations document specific user actions that can be performed on the information system without identification or authentication; and (ii) Accesses that occur through authorized use of group authenticators without individual authentication. Organizations may require unique identification of individuals using shared accounts, for detailed accountability of individual activity.
Check Content
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 Text
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 scram-sha-256 For more information on pg_hba.conf, see the official documentation: https://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html.
Additional Identifiers
Rule ID: SV-233612r879589_rule
Vulnerability ID: V-233612
Group Title: SRG-APP-000148-DB-000103
Expert Comments
CCIs
Number | Definition |
---|---|
CCI-000764 |
The information system uniquely identifies and authenticates organizational users (or processes acting on behalf of organizational users). |
Controls
Number | Title |
---|---|
IA-2 |
Identification And Authentication (Organizational Users) |