PostgreSQL database security hardening (thirteen) - encrypted authentication password


foreword

PostgreSQL passwords sent over the network in clear text can be easily discovered by unauthorized users. A compromised password could easily lead to unauthorized access to the database.

1. Check configuration

As the database administrator (shown here as "postgres"), look at the authentication entry in pg_hba.conf:

cat ${PGDATA?}/pg_hba.conf

As shown in the figure below, if any entry uses method (the last column in the record) other than "MD5", there is a security risk.
insert image description here

2. Reinforcement suggestions

As the database administrator (shown here as "postgres"), edit the pg_hba.conf file and change the "method" column value to "md5".

vi ${PGDATA?}/pg_hba.conf

As shown in the figure below, change the "method" column value of all entries to "md5".
insert image description here

Summarize

If used for authentication passwords, PostgreSQL must only transmit encrypted passwords.

Guess you like

Origin blog.csdn.net/ma286388309/article/details/129204406