STIGQter STIGQter: STIG Summary: Crunchy Data PostgreSQL Security Technical Implementation Guide Version: 1 Release: 1 Benchmark Date: 20 Nov 2020:

Access to external executables must be disabled or restricted.

DISA Rule

SV-233593r617333_rule

Vulnerability Number

V-233593

Group Title

SRG-APP-000141-DB-000093

Rule Version

CD12-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-233593

Documentable

False

Rule Version

CD12-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

5254

Comments