Audit

Sybase ASE 審計 sp_addlogin sp_droplogin sp_modifylogin

  • December 9, 2018

我們需要在 Sybase ASE(Adaptive Server Enterprise/15.7/EBF 27351 SMP SP139 /P/ia64/HP-UX B.11.31/ase157sp138x/4041/64-bit/FBO/Tue Aug 8 07:33:11 上啟用審核2017),我在主數據庫上啟用了相同的功能,如下所示:

sp_displayaudit 的結果

我的印像是,這也將啟用對登錄/使用者(sp_addlogin,sp_modifylogin,sp_droplogin,sp_adduser,sp_dropuser)的任何更改的審核,因為創建/刪除/更改是在主級別處理的,但這是不正確的,因為這僅適用於對象而不是使用者/登錄名。最近我刪除了一個使用者,它沒有登錄審計事件;在檢查了 Sybase 文件和 Internet 上不同門戶上的多個文件後,並在供應商的幫助下,才知道需要啟用另一種類型的審計 (login_admin) 才能在審計事件中擷取這些事件。

我執行了下面的命令,並期望這將解決根本問題:

1> sp_audit "login_admin", "all", "all", "on"
2> go
Audit option has been changed and has taken effect immediately.
(return status = 0)
1> sp_displayaudit "login"
2> go
No logins currently have auditing enabled.
(return status = 0)
1>

從 sp_displayaudit 的結果可以明顯看出,登錄仍然沒有被審計。我不確定這是否需要重新啟動 ASE 才能生效,或者我在這裡遺漏了一些東西。

任何幫助將不勝感激。

在嘗試了這個但沒有找到任何可行的解決方案之後,提出了一個 Sybase 支持的案例,他們已經提供了解決方案。

以下是可用於滿足上述要求的命令:

--Audit any change at procedure level for login/user/alias

use sybsystemprocs 
go 
sp_audit "exec_procedure", "all", "sybsystemprocs.dbo.sp_addlogin", "on" 
go 
sp_audit "exec_procedure", "all", "sybsystemprocs.dbo.sp_droplogin", "on" 
go 
sp_audit "exec_procedure", "all", "sybsystemprocs.dbo.sp_modifylogin", "on" 
go 
sp_audit "exec_procedure", "all", "sybsystemprocs.dbo.sp_adduser", "on" 
go 
sp_audit "exec_procedure", "all", "sybsystemprocs.dbo.sp_dropuser", "on" 
go

sp_audit "exec_procedure", "all", "sybsystemprocs.dbo.sp_addalias", "on" 
go

sp_audit "exec_procedure", "all", "sybsystemprocs.dbo.sp_dropalias", "on" 
go


--Audit any change at table level for login/user/alias 

sp_audit "delete", "all", "master.dbo.syslogins", "on"
go
sp_audit "insert", "all", "master.dbo.syslogins", "on"
go
sp_audit "update", "all", "master.dbo.syslogins", "on"
go

sp_audit "delete", "all", "master.dbo.sysusers", "on"
go
sp_audit "insert", "all", "master.dbo.sysusers", "on"
go
sp_audit "update", "all", "master.dbo.sysusers", "on"
go

sp_audit "delete", "all", "master.dbo.sysalternates", "on"
go
sp_audit "insert", "all", "master.dbo.sysalternates", "on"
go
sp_audit "update", "all", "master.dbo.sysalternates", "on"
go


sp_audit "delete", "all", "master.dbo.syssrvroles", "on"
go
sp_audit "insert", "all", "master.dbo.syssrvroles", "on"
go
sp_audit "update", "all", "master.dbo.syssrvroles", "on"
go


sp_audit "delete", "all", "master.dbo.sysloginroles", "on"
go
sp_audit "insert", "all", "master.dbo.sysloginroles", "on"
go
sp_audit "update", "all", "master.dbo.sysloginroles", "on"
go

我相信這對任何想要在 Sybase ASE 級別啟用審計但不確定如何實現的人有所幫助。

引用自:https://dba.stackexchange.com/questions/223719