passwordcheck_cracklib

Strengthen PostgreSQL user password checks with cracklib

Overview

PackageVersionCategoryLicenseLanguage
passwordcheck_cracklib3.1.0SECLGPL-2.1C
IDExtensionBinLibLoadCreateTrustRelocSchema
7000passwordcheck_cracklibNoYesYesNoNoNo-
Relatedpg_auth_mon credcheck pgaudit login_hook auth_delay set_user sepgsql

Version

TypeRepoVersionPG VerPackageDeps
EXTMIXED3.1.01817161514passwordcheck_cracklib-
RPMPGDG3.1.01817161514passwordcheck_cracklib_$v-
DEBPIGSTY3.1.01817161514postgresql-$v-passwordcheck-cracklib-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.0.0
PGDG 3.0.0
el8.aarch64
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.0.0
PGDG 3.0.0
PGDG 3.0.0
el9.x86_64
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.0.0
PGDG 3.0.0
el9.aarch64
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.0.0
PGDG 3.0.0
PGDG 3.0.0
el10.x86_64
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.1.0
el10.aarch64
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.1.0
PGDG 3.1.0
d12.x86_64
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
d12.aarch64
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
d13.x86_64
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
d13.aarch64
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
u22.x86_64
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
u22.aarch64
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
u24.x86_64
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
u24.aarch64
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0
PIGSTY 3.1.0

Build

You can build the DEB packages for passwordcheck_cracklib using pig build:

pig build pkg passwordcheck_cracklib         # build DEB packages

Install

You can install passwordcheck_cracklib directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install passwordcheck_cracklib;          # Install for current active PG version
pig ext install -y passwordcheck_cracklib -v 18  # PG 18
pig ext install -y passwordcheck_cracklib -v 17  # PG 17
pig ext install -y passwordcheck_cracklib -v 16  # PG 16
pig ext install -y passwordcheck_cracklib -v 15  # PG 15
pig ext install -y passwordcheck_cracklib -v 14  # PG 14
dnf install -y passwordcheck_cracklib_18       # PG 18
dnf install -y passwordcheck_cracklib_17       # PG 17
dnf install -y passwordcheck_cracklib_16       # PG 16
dnf install -y passwordcheck_cracklib_15       # PG 15
dnf install -y passwordcheck_cracklib_14       # PG 14
apt install -y postgresql-18-passwordcheck-cracklib   # PG 18
apt install -y postgresql-17-passwordcheck-cracklib   # PG 17
apt install -y postgresql-16-passwordcheck-cracklib   # PG 16
apt install -y postgresql-15-passwordcheck-cracklib   # PG 15
apt install -y postgresql-14-passwordcheck-cracklib   # PG 14

Preload:

shared_preload_libraries = '$libdir/passwordcheck_cracklib';

Usage

passwordcheck_cracklib: Strengthen PostgreSQL user password checks with cracklib

passwordcheck_cracklib is like the regular PostgreSQL passwordcheck module, except it is built with cracklib for more strict password checks. It checks users’ passwords whenever they are set with CREATE ROLE or ALTER ROLE. If a password is considered too weak, it will be rejected and the command will terminate with an error.

Configuration

Add the library to shared_preload_libraries in postgresql.conf:

shared_preload_libraries = '$libdir/passwordcheck_cracklib'

Restart PostgreSQL to activate.

How It Works

Once loaded, any CREATE ROLE or ALTER ROLE command that sets a password will have the password checked against cracklib’s dictionary. Weak or easily guessable passwords will be rejected automatically.

-- This will be rejected if the password is too weak
CREATE ROLE myuser WITH LOGIN PASSWORD 'password123';
-- ERROR: password is easily cracked

-- A strong password will be accepted
CREATE ROLE myuser WITH LOGIN PASSWORD 'X9#kLm$vQ2!pR7';

No CREATE EXTENSION is required – this is a shared library module only.


Last Modified 2026-03-12: add pg extension catalog (95749bf)