GBase 8c
其他
文章
GBase 8c 数据库审计概述(六)
发表于2023-12-08 11:06:0669次浏览2个评论
在GBase 8c数据库中,查看审计结果的操作步骤如下:
操作步骤
步骤1 以操作系统用户gbase登录数据库主节点。
步骤2 使用如下命令连接数据库。
gsql -d postgres -p 5600
postgres为需要连接的数据库名称,5600为数据库主节点的端口号。连接成功后,系统显示类似如下信息:
gsql ((GBase8c 3.0.0BXX build d28887c9) compiled at 2022-05-13 11:31:40 commit 0 last mr 55 )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
gbase=#
步骤3 查询审计记录。
gbase=# select * from pg_query_audit('2022-06-06 16:00:00','2022-06-06 17:00:00');
查询结果如下:
time | type | result | userid | username | database
| client_conninfo | object_name |
detail_info
| node_name | thread_id |
local_port | remote_port
------------------------+---------------+--------+--------+----------+----------
+-----------------+-----------------+-------------------------------------------
--------------------------------------------------------------------------------
--------------------------------+-----------+---------------------------------+-
-----------+-------------
2022-06-06 16:00:00+08 | login_success | ok | 10 | gbase | postgres
| gs_ctl@XX.X.X.X | postgres | login db(postgres) success,the current use
r is:gbase, SSL=off
| hg1 | 140125749114624@707817600787469 |
5601 | 40412
……
该条记录表明,用户gbase在time字段标识的时间点登录数据库postgres。其中client_conninfo字段在log_hostname启动且IP连接时,字符@后显示反向DNS查找得到的主机名。
对于登录操作的记录,审计日志detail_info结尾会记录SSL信息,SSL=on表示客户端通过SSL连接,SSL=off表示客户端没有通过SSL连接。
----结束
热门帖子
- 12025-12-01浏览数:182759
- 22023-05-09浏览数:25052
- 42023-09-25浏览数:18521
- 52020-05-11浏览数:17526