STIGQter STIGQter: STIG Summary: PostgreSQL 9.x Security Technical Implementation Guide Version: 2 Release: 1 Benchmark Date: 23 Oct 2020:

Access to external executables must be disabled or restricted.

DISA Rule

SV-214127r508027_rule

Vulnerability Number

V-214127

Group Title

SRG-APP-000141-DB-000093

Rule Version

PGS9-00-009100

Severity

CAT II

CCI(s)

Weight

10

Fix Recommendation

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"

Check Contents

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.

Vulnerability Number

V-214127

Documentable

False

Rule Version

PGS9-00-009100

Severity Override Guidance

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.

Check Content Reference

M

Target Key

3994

Comments