PostgreSQL 17 — Native Password Policy Support
PostgreSQL 17 — Native Password Policy Support
От:
Mohammad Abu Ata <MohammadAA@leading-point.com>
Дата:
Вложения:
Hello PostgreSQL Community,
We are evaluating PostgreSQL 17 for enterprise use. Could you please confirm whether PostgreSQL provides built-in password policy enforcement without third-party extensions?
Specifically, we need to know whether PostgreSQL natively supports:
- Password complexity and minimum length
- Password expiration
- Password history and prevention of password reuse
- Account lockout after repeated failed login attempts
We are aware of the `passwordcheck` module. Does it provide these capabilities, or are additional extensions or external authentication systems required?
Thank you for your clarification.
Best Regards,
Mohammad Abuata | |
Leading Point Software | |
90, Wasfi At-Tall Street, Amman | |
T: +96265604808 | |
M: +96879101447 | |
Re: PostgreSQL 17 — Native Password Policy Support
От:
KENAN ÇİFTÇİ <kciftci89@gmail.com>
Дата:
Вложения:
Hı,
You can use LDAP authentication.
26 Eki 2026 Pzt 13:16 tarihinde Mohammad Abu Ata <MohammadAA@leading-point.com> şunu yazdı:
Hello PostgreSQL Community,We are evaluating PostgreSQL 17 for enterprise use. Could you please confirm whether PostgreSQL provides built-in password policy enforcement without third-party extensions?Specifically, we need to know whether PostgreSQL natively supports:- Password complexity and minimum length- Password expiration- Password history and prevention of password reuse- Account lockout after repeated failed login attemptsWe are aware of the `passwordcheck` module. Does it provide these capabilities, or are additional extensions or external authentication systems required?Thank you for your clarification.Best Regards,
Mohammad Abuata
Senior Software EngineerLeading Point Software
90, Wasfi At-Tall Street, Amman
T: +96265604808
M: +96879101447
Re: PostgreSQL 17 — Native Password Policy Support
От:
Christophe Pettus <xof@thebuild.com>
Дата:
> On Oct 26, 2026, at 09:43, Mohammad Abu Ata wrote: > > We are evaluating PostgreSQL 17 for enterprise use. Could you please confirm whether PostgreSQL provides built-in password policy enforcement without third-party extensions? The question is a bit more nuanced than "yes" or "no." `passwordcheck` provides basic password complexity checking, but does not provide the other aspects of policy enforcement you are looking for. As the `passwordcheck` documentation notes, password complexity checking within PostgreSQL's core server is difficult to provide for authentication methods where the password is stored in the database itself, as the client has the option to send over a pre-hashed password. Again, as the `passwordcheck` documentation notes, if you have security requirements of the type you describe, it's better to use an external password management system such as GSSAPI, rather than store passwords direclty in the database. This also meets a very common requirement for immediate blanket revocation of authorization for a terminated user, rather than having to disable accounts piecemeal across the environment. PostgreSQL does provide a wide range of authentication mechanisms directly in the core distribution; you can see the full list at: https://www.postgresql.org/docs/current/client-authentication.html Best, -- Christophe
Re: PostgreSQL 17 — Native Password Policy Support
От:
yuvaraj ganapathy <gyuvaraj_g@hotmail.com>
Дата:
Вложения:
Mohammad, Please find below
PostgreSQL 17 does not provide comprehensive, built-in enterprise password policy enforcement out of the box. Core PostgreSQL deliberately delegates advanced identity and credential lifecycle management to external identity providers or specialized extensions.
Password Complexity & Min Length - Partial / Minimal - Not natively configurable in core SQL syntax. Without modules, passwords of any length or composition are accepted.
Password Expiration - Partial - Supported via the
VALID UNTIL 'timestamp' clause during CREATE ROLE or ALTER ROLE. However, there is no automatic expiration interval (e.g., forcing a rotation every 90 days); administrators must explicitly set a static date for each role.
Password History & Reuse Prevention - No - Core PostgreSQL does not store previous password hashes or maintain password history. A user can cycle back to an old password immediately.
Account Lockout on Failed LoginsNoFailed authentication attempts do not trigger an automatic account lockout.
Capabilities and Limitations of
passwordcheck The
passwordcheck module is a sample contrib library included with PostgreSQL distributions that hooks into check_password_hook.- Enforces basic complexity: requires passwords to contain a mix of letters and non-letters and rejects passwords identical to the username or reversed username.
- In PostgreSQL 17, it enforces a hard-coded minimum length of 8 characters (the configurable
passwordcheck.min_password_lengthparameter was introduced in PostgreSQL 18). - Can optionally link to
CrackLib, but this requires rebuilding the module from source due to licensing. - It does not manage password expiration intervals, enforce password rotation policies, maintain password history, or prevent password reuse.
- It has no awareness of authentication events, meaning it cannot track failed logins or perform account lockouts.
- It only evaluates passwords sent in clear text during
CREATE ROLEorALTER ROLEstatements; pre-hashed passwords (such asSCRAM-SHA-256strings generated by client tools) bypasspasswordcheckcompletely.
PostgreSQL Extensions
If you must enforce policies within local database accounts, you will need third-party extensions:
credcheck/password_profile: Specialized extensions that implement password history tracking, reuse blocking, minimum change intervals, and automatic failed-attempt lockouts via PostgreSQL's internal C hooks (check_password_hookandClientAuthentication_hook).auth_delay(Bundled Contrib): Adds a configurable millisecond delay (e.g., 500ms–2000ms) on failed logins to slow down brute-force attacks, though it does not lock the account.
Regards
Yuvaraj Ganapathy
+1 214-460-3006 (Mobile)
Yuvaraj Ganapathy
+1 214-460-3006 (Mobile)
From: Mohammad Abu Ata <MohammadAA@leading-point.com>
Sent: Monday, October 26, 2026 05:43
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Cc: Abdelrahman Mansour <abdelrahman.mansour@stc.com.kw>; Ahmad Y Al Kandari <ahmad.alkandarei@stc.com.kw>; Mahmoud Al-Muhtaseb <MahmmudM@leading-point.com>
Subject: PostgreSQL 17 — Native Password Policy Support
Sent: Monday, October 26, 2026 05:43
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Cc: Abdelrahman Mansour <abdelrahman.mansour@stc.com.kw>; Ahmad Y Al Kandari <ahmad.alkandarei@stc.com.kw>; Mahmoud Al-Muhtaseb <MahmmudM@leading-point.com>
Subject: PostgreSQL 17 — Native Password Policy Support
Hello PostgreSQL Community,
We are evaluating PostgreSQL 17 for enterprise use. Could you please confirm whether PostgreSQL provides built-in password policy enforcement without third-party extensions?
Specifically, we need to know whether PostgreSQL natively supports:
- Password complexity and minimum length
- Password expiration
- Password history and prevention of password reuse
- Account lockout after repeated failed login attempts
We are aware of the `passwordcheck` module. Does it provide these capabilities, or are additional extensions or external authentication systems required?
Thank you for your clarification.
Best Regards,
Mohammad Abuata | |
Leading Point Software | |
90, Wasfi At-Tall Street, Amman | |
T: +96265604808 | |
M: +96879101447 | |