4.1 Ensure Interactive Login is Disabled

Information

When created, the PostgreSQL user may have interactive access to the operating system, which means that the PostgreSQL user could login to the host as any other user would.

Rationale:

Preventing the PostgreSQL user from logging in interactively may reduce the impact of a compromised PostgreSQL account. There is also more accountability, as accessing the operating system where the PostgreSQL server lies will require the user's own account and the apprpriate sudo configuration. Interactive access by the PostgreSQL user is unnecessary and should be disabled.

Impact:

This setting will prevent the PostgreSQL administrator from interactively logging into the operating system using the PostgreSQL user. Instead, the administrator will need to log in using one's own account and then sudo to the PostgreSQL administrator account.

Solution

Execute the following command:

sudo passwd -l postgres

See Also

https://workbench.cisecurity.org/benchmarks/17004

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-6(2), 800-53|AC-6(5)

Plugin: Unix

Control ID: a128ed7f763483af0c132c502244918ed243fff9563dd692a581ec4d2ba7eb42