Inspired and written by ChatGPT
Tested and validated by Me
PostgreSQL passwordcheck implementation
Captures CREATE ROLE and ALTER ROLE requests. Currently validates if a passwords has at least 8 symbols including at least 1 uppercase letter, 1 non alphabetic and non numeric symbol, at least 1 number and letters
- Download the Postgresql source
- Untar
- Navigate to contrib/passwordcheck
- Modify passwordcheck.c contents (paste this file)
- Go to the root of the source tree
- Run ./configure and fix errors if any
- Run make
- Navigate to contrib/passwordcheck
- Run make
- Run sudo systemctl stop postgresql.service
- Run sudo make install
- Update /etc/postgresql/16/main/postgresql.conf: modify shared_preload_libraries and include /usr/local/pgsql/lib/passwordcheck
- Run sudo systemctl start postgresql.service
Any suggestions are welcomed. Feel free to create issues.