Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server 2008 Audit_Amazing_Expecting Comments Expand / Collapse
Author
Message
Posted Tuesday, April 30, 2013 4:18 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 1, 2013 2:05 PM
Points: 3, Visits: 3
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
Post #1447941
Posted Tuesday, April 30, 2013 6:10 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, August 5, 2014 5:20 AM
Points: 3,546, Visits: 2,651
Hi Dinesh, Audit definition might help. could you post here ?
Post #1447980
Posted Tuesday, April 30, 2013 11:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 1, 2013 2:05 PM
Points: 3, Visits: 3
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.
Post #1448176
Posted Wednesday, May 1, 2013 2:06 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 1, 2013 2:05 PM
Points: 3, Visits: 3
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

Post #1448603
Posted Thursday, May 9, 2013 4:01 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, August 5, 2014 5:20 AM
Points: 3,546, Visits: 2,651
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.
Post #1450976
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse