auth_delay

在返回认证失败前暂停一会,避免爆破

概览

扩展包名版本分类许可证语言
auth_delay-SECPostgreSQLC
ID扩展名BinLibLoadCreateTrustReloc模式
7970auth_delay-
相关扩展pg_auth_mon credcheck login_hook passwordcheck passwordcheck_cracklib pgaudit set_user pg_permissions

版本

PG18PG17PG16PG15PG14
-----

安装

提示:这是 PostgreSQL 内核自带的 contrib 扩展

用法

auth_delay: 在报告认证失败前暂停

auth_delay 在报告认证失败前使服务器短暂暂停,使暴力破解密码攻击更加困难。

配置

添加到 postgresql.conf

shared_preload_libraries = 'auth_delay'
auth_delay.milliseconds = '500'

配置参数

参数默认值描述
auth_delay.milliseconds0报告认证失败前等待的毫秒数

注意事项

  • 必须通过 shared_preload_libraries 加载
  • 无法防止拒绝服务攻击(等待的进程仍然占用连接槽位)
  • 无需 CREATE EXTENSION —— 这仅是一个共享库模块

最后修改 2026-03-12: update extension pages (f579993)