目录
环境
文档用途
详细信息
环境
系统平台:Linux x86-64 Red Hat Enterprise Linux 7
版本:4.3.4.7
文档用途
本文档用于修改瀚高安全版数据库审计策略配置
详细信息
1、查看审计策略配置
审计管理员syssao可以通过"select show_audit_param();"来查看当前的审计策略配置
[root@host ~]# psql -U syssao -d highgo
highgo=> select show_audit_param();
show_audit_param
---------------------------------------
hg_audit_Log = all, +
hg_audit_LogCatalog = on, +
hg_audit_LogClient = off, +
hg_audit_LogLevel = log, +
hg_audit_LogParameter = off, +
hg_audit_LogRelation = off, +
hg_audit_LogStatementOnce = off, +
hg_audit_Role = , +
hg_audit_filename = %d_%H, +
hg_audit_truncate_on_rotation = off, +
hg_audit_RotationAge = 1440 min, +
hg_audit_RotationSize = 10240 KB, +
2、修改审计策略配置
审计管理员syssao可以通过"select set_audit_param('参数','选项');"修改审计策略配置,重启数据库使参数生效
highgo=> --审计范围修改为ddl
highgo=> select set_audit_param('hg_audit_Log','ddl');
set_audit_param
---------------------------------
set configuration successfully.
(1 row)
highgo=> --开启审计日志循环覆盖
highgo=> select set_audit_param('hg_audit_truncate_on_rotation','on');
set_audit_param
---------------------------------
set configuration successfully.
(1 row)
highgo=> --审计日志覆盖间隔为一周,60*24*7=10080
highgo=> select set_audit_param('hg_audit_RotationAge','10080');
set_audit_param
---------------------------------
set configuration successfully.
(1 row)
highgo=> --审计日志名称以星期缩写格式命名
highgo=> select set_audit_param('hg_audit_filename','%a');
set_audit_param
---------------------------------
set configuration successfully.
(1 row)
highgo=> \q
[root@host ~]# pg_ctl restart