暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

GBase 8s审计操作步骤

淮海路小佩奇 2023-06-19
143


步骤 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 连接。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论