- 8.4.5.1 MySQL 企业审核的元素8.4.5.1 Elements of MySQL Enterprise Audit
- 8.4.5.2 安装或卸载 MySQL 企业审核8.4.5.2 Installing or Uninstalling MySQL Enterprise Audit
- 8.4.5.3 MySQL 企业审核的安全注意事项8.4.5.3 MySQL Enterprise Audit Security Considerations
- 8.4.5.4 审计日志文件格式8.4.5.4 Audit Log File Formats
- 8.4.5.5 配置审计日志记录特性8.4.5.5 Configuring Audit Logging Characteristics
- 8.4.5.6 阅读审计日志文件8.4.5.6 Reading Audit Log Files
- 8.4.5.7 审计日志过滤8.4.5.7 Audit Log Filtering
- 8.4.5.8 编写审计日志过滤定义8.4.5.8 Writing Audit Log Filter Definitions
- 8.4.5.9 禁用审计日志记录8.4.5.9 Disabling Audit Logging
- 8.4.5.10 传统模式审计日志过滤8.4.5.10 Legacy Mode Audit Log Filtering
- 8.4.5.11 审计日志参考8.4.5.11 Audit Log Reference
- 8.4.5.12 审计日志限制8.4.5.12 Audit Log Restrictions
MySQL Enterprise Audit 是包含在 MySQL 企业版中的一个扩展商业产品。要了解更多关于商业产品的信息,请参见 https://www.mysql.com/products/。MySQL Enterprise Audit is an extension included in MySQL Enterprise Edition, a commercial product. To learn more about commercial products, see https://www.mysql.com/products/.
MySQL 企业版包括通过名为 audit_log 的服务器插件实现的 MySQL Enterprise Audit。MySQL Enterprise Audit 使用开放的 MySQL 审计 API,使得能够基于标准和策略对在特定 MySQL 服务器上执行的连接和查询活动进行监控、记录和阻止。MySQL Enterprise Audit 旨在满足 Oracle 审计规范,为受内部和外部监管指南管理的应用程序提供开箱即用、易于使用的审计和合规解决方案。MySQL Enterprise Edition includes MySQL Enterprise Audit, implemented using a server plugin named
audit_log. MySQL Enterprise Audit uses the open MySQL Audit
API to enable standard, policy-based monitoring, logging, and
blocking of connection and query activity executed on specific
MySQL servers. Designed to meet the Oracle audit specification,
MySQL Enterprise Audit provides an out of box, easy to use auditing and
compliance solution for applications that are governed by both
internal and external regulatory guidelines.
安装后,审计插件使 MySQL 服务器能够生成包含服务器活动审计记录的日志文件。日志内容包括客户端何时连接和断开连接,以及他们在连接时执行的操作,例如访问哪些数据库和表。您可以添加每个查询的时间和大小统计信息,以检测异常值。When installed, the audit plugin enables MySQL Server to produce a log file containing an audit record of server activity. The log contents include when clients connect and disconnect, and what actions they perform while connected, such as which databases and tables they access. You can add statistics for the time and size of each query to detect outliers.
默认情况下,MySQL 企业审计使用 mysql 系统数据库中的表来持久存储过滤器和用户账户数据。要使用其他数据库,请在服务器启动时设置 audit_log_database 系统变量。By default, MySQL Enterprise Audit uses tables in the mysql
system database for persistent storage of filter and user account
data. To use a different database, set the
audit_log_database system
variable at server startup.
在安装审计插件后(参见 第 8.4.5.2 节,“安装或卸载 MySQL 企业审计”),它会写入审计日志文件。默认情况下,该文件在服务器数据目录中命名为 audit.log。要更改文件名称,请在服务器启动时设置 audit_log_file 系统变量。After you install the audit plugin (see
Section 8.4.5.2, “Installing or Uninstalling MySQL Enterprise Audit”), it writes an audit log
file. By default, the file is named audit.log
in the server data directory. To change the name of the file, set
the audit_log_file system
variable at server startup.
默认情况下,审计日志文件内容以新式 XML 格式编写,不进行压缩或加密。要选择文件格式,请在服务器启动时设置 audit_log_format 系统变量。有关文件格式和内容的详细信息,请参见 第 8.4.5.4 节,“审计日志文件格式”。By default, audit log file contents are written in new-style XML
format, without compression or encryption. To select the file
format, set the audit_log_format
system variable at server startup. For details on file format and
contents, see Section 8.4.5.4, “Audit Log File Formats”.
有关如何控制日志记录的详细信息,包括审核日志文件命名和格式选择,请参见第 8.4.5.5 节,“配置审核日志特性”。要执行审核事件的过滤,请参见第 8.4.5.7 节,“审核日志过滤”。有关用于配置审核日志插件的参数说明,请参见审核日志选项和变量。For more information about controlling how logging occurs, including audit log file naming and format selection, see Section 8.4.5.5, “Configuring Audit Logging Characteristics”. To perform filtering of audited events, see Section 8.4.5.7, “Audit Log Filtering”. For descriptions of the parameters used to configure the audit log plugin, see Audit Log Options and Variables.
如果启用了审计日志插件,性能模式(请参见 第 29 章,MySQL 性能模式)对此有相应的监控工具。要识别相关的监控工具,请使用以下查询:If the audit log plugin is enabled, the Performance Schema (see Chapter 29, MySQL Performance Schema) has instrumentation for it. To identify the relevant instruments, use this query:
SELECT NAME FROM performance_schema.setup_instruments WHERE NAME LIKE '%/alog/%';