SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server 2008 Audit_Amazing_Expecting Comments


SQL Server 2008 Audit_Amazing_Expecting Comments

Author
Message
mailatdinesh
mailatdinesh
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 10
We enabled SQL Server external audit feature in our production server. We enabled only DML(Insert,Update,Delete) single audit event instead of group event on database level.Later, we reviewed the audit log file and everything looks good because all DML(Insert,Update,Delete)event was audit from all databases.

We amazing after seeing one thing, SELECT query was also audited on the file. We checked the action id column through select * from fn_get_audit_file(file_pattern,default,default) and it was showing as UP (it means that update event occurred against SELECT query).

Below is the query,

select tbl.name, schema_name(tbl.schema_id), tbl.type, cast(case when tbl.is_ms_shipped = 1 then 1when (select major_id from sys.extended_properties where major_id = tbl.object_id and minor_id = 0 and class = 1 and name = N'microsoft_database_tools_support')is not null then 1 else 0 end as bit)from sys.all_objects AS tbl where tbl.type in (N'U', N'S') and permissions(tbl.object_id) & 4096 <> 0

Question is : Why SELECT query was audited as UPDATE event?. Any idea? Post your valuable findings. Thanks

DINESH.D
sqlnaive
sqlnaive
SSCertifiable
SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)

Group: General Forum Members
Points: 6513 Visits: 2774
Hi Dinesh, Audit definition might help. could you post here ?
mailatdinesh
mailatdinesh
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 10
Below is the result snippet about audit specification which we enabled on all databases,

Query :
=====
select audit_action_id,audit_action_name,class,audited_result from sys.database_audit_specification_details

Result :
=====

audit_action_id audit_action_name class audited_result
DL DELETE 0 SUCCESS AND FAILURE
IN INSERT 0 SUCCESS AND FAILURE
UP UPDATE 0 SUCCESS AND FAILURE

Reply back if you need any more. Thanks for your effort.
mailatdinesh
mailatdinesh
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 10
I am posting here as you expected through Script button in SSMS.

SERVER LEVEL AUDIT FILE CREATION
================================

USE [master]
GO

CREATE SERVER AUDIT [Server_audit]
TO FILE
( FILEPATH = N'F:\AuditFiles\'
,MAXSIZE = 200 MB
,MAX_ROLLOVER_FILES = 5
,RESERVE_DISK_SPACE = OFF
)
WITH
( QUEUE_DELAY = 1000
,ON_FAILURE = CONTINUE
,AUDIT_GUID = 'a12345-0896-4112-b8f7-492d688a6ed3'
)
GO

DATABASE LEVEL DML AUDIT FILE ENABLING
=======================================

USE [XXXXX]
GO

CREATE DATABASE AUDIT SPECIFICATION [DML_Audit]
FOR SERVER AUDIT [Server_audit]
ADD (DELETE ON DATABASE::[XXXXX] BY [public]),
ADD (INSERT ON DATABASE::[XXXXX] BY [public]),
ADD (UPDATE ON DATABASE::[XXXXX] BY [public])
WITH (STATE = ON)
GO
sqlnaive
sqlnaive
SSCertifiable
SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)

Group: General Forum Members
Points: 6513 Visits: 2774
Could you send all the values of table sys.database_audit_specification_details for those UP action ? Seems confusing but will give it a try.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search