audit-labs/audit-tools

A collection of scripts, queries, and other goodies you can use in an audit.

clone: git clone https://gitbay.org/audit-labs/audit-tools.git

v1.0.0: databases/postgres/passwords.sql · raw

 1-- References:
 2--           : https://www.postgresql.org/docs/current/view-pg-shadow.html
 3--           : https://www.postgresql.org/docs/current/auth-password.html
 4--           : https://www.postgresql.org/docs/current/auth-password.html#AUTH-PASSWORD-ENCRYPTION
 5--           : https://www.postgresql.org/docs/current/runtime-config.html
 6
 7-- Defined password configuration
 8SELECT *
 9FROM pg_settings
10WHERE name LIKE 'password_%';
11
12-- Users and their password configurations
13SELECT 
14    usename AS user_name,
15    passwd AS password,
16    valuntil AS valid_until,
17    useconfig AS user_config
18FROM pg_shadow;