MySQL 服务器包括一个插件库,使管理员能够在连续失败尝试次数达到可配置的限制后,对连接尝试的服务器响应引入越来越长的延迟。这一功能提供了一种威慑,可以减缓对 MySQL 用户账户的暴力破解攻击。该插件库包含两个插件:MySQL Server includes a plugin library that enables administrators to introduce an increasing delay in server response to connection attempts after a configurable number of consecutive failed attempts. This capability provides a deterrent that slows down brute force attacks against MySQL user accounts. The plugin library contains two plugins:
CONNECTION_CONTROL检查传入的连接尝试,并在必要时对服务器响应添加延迟。该插件还公开了可配置其操作的系统变量以及提供基本监控信息的状态变量。CONNECTION_CONTROLchecks incoming connection attempts and adds a delay to server responses as necessary. This plugin also exposes system variables that enable its operation to be configured and a status variable that provides rudimentary monitoring information.CONNECTION_CONTROL插件使用审计插件接口(参见 编写审计插件)。为了收集信息,它订阅MYSQL_AUDIT_CONNECTION_CLASSMASK事件类,并处理MYSQL_AUDIT_CONNECTION_CONNECT和MYSQL_AUDIT_CONNECTION_CHANGE_USER子事件,以检查服务器在响应连接尝试前是否应引入延迟。TheCONNECTION_CONTROLplugin uses the audit plugin interface (see Writing Audit Plugins). To collect information, it subscribes to theMYSQL_AUDIT_CONNECTION_CLASSMASKevent class, and processesMYSQL_AUDIT_CONNECTION_CONNECTandMYSQL_AUDIT_CONNECTION_CHANGE_USERsubevents to check whether the server should introduce a delay before responding to connection attempts.CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS实现了一个INFORMATION_SCHEMA表,该表提供有关失败连接尝试的更详细的监控信息。有关此表的更多信息,请参见 第 28.6.2 节,“INFORMATION_SCHEMA CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS 表”。CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTSimplements anINFORMATION_SCHEMAtable that exposes more detailed monitoring information for failed connection attempts. For more information about this table, see Section 28.6.2, “The INFORMATION_SCHEMA CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS Table”.
以下部分提供有关连接控制插件的安装和配置的信息。The following sections provide information about connection control plugin installation and configuration.