430 likes | 1.02k Views
DBI407. Auditing in Microsoft SQL Server 2012 . Il-Sung Lee Program Manager Microsoft Corporation. Agenda. What’s changed since SQL Server 2008? What is the performance impact? Can I protect the Audit log from the DBA? What happens if Audit fails to write?
E N D
DBI407 Auditing in MicrosoftSQL Server 2012 Il-Sung Lee Program Manager Microsoft Corporation
Agenda • What’s changed since SQL Server 2008? • What is the performance impact? • Can I protect the Audit log from the DBA? • What happens if Audit fails to write? • What do I do if the server fails to start because of SQL Server Audit? • Anything else I should know?
Lots. We’ve made SQL Server Audit more flexible and reliable.
Audit Supported on All SKUs • Basic Audit on all SKUs • Server Audit Specs only • DB Audit Specs for Enterprise • No longer need SQLTrace • Enjoy advantages of Audit • Performance • Multiple Audits and multiple targets • Persist state • Audit Resilience SQL ServerExpress
Improved Resilience • Before: • Write failures may silently lose Audit records • Use ON_FAILURE = SHUTDOWN • Now: • Automatically recover from most file or network errors • Added “ON_FAILURE = FAIL_OPERATION” • Added “MAX_FILES” option Select… Rollback
T-SQL Stack Information select salary from hr.payroll exec hr.viewsalary hr.viewsalary hr.payroll Audit Log
demo T-SQL Stack Information
User-Defined Audit Event • sp_audit_write() exec sp_audit_write 1234, 1, N‘Hello World’ @user_defined_event_id @succeeded @user_defined_info Audit Log
demo User-Defined Audit Event
Record Filtering • Tightly constrain info written to Audit log • Audit record generated but not written • Leverages Xevent filtering CREATE SERVER AUDIT audit_name TO { [ FILE (<file_options> [ , ...n ]) ] | APPLICATION_LOG | SECURITY_LOG } [ WITH ( <audit_options> [ , ...n ] ) ] [ FILTER = <predicate_expression> ] } … <predicate_expression> ::= { [ NOT ] <predicate_factor> | {( <predicate_expression> ) } [ { AND | OR } [ NOT ] { <predicate_factor> | ( <predicate_expression> ) } ] [ ,...n ] }
demo Record Filtering
Audit Performance • Depends upon: • The workload • What’s being audited • Comparison of SQL Server Audit against SQL Trace for 5 different typical customer workloads…
Audit Write Failure (Shutdown) • Server shuts down • Buffered audit events lost
What do I do if the server fails to start because of SQL Server Audit?
demo Using SQL Server Audit with Policy-Based Management
Other Things You Should Know • Parameterized queries • Audit Xevent Sessions may not be manipulated by Xevent DDL. • Audit logs are not encrypted or compressed • Audit events are fired with permission checks • Writing to files are much faster than to event log • No auditing of result sets
Other Things You Should Know • Both Audit and Audit Specifications have STATE parameters. • Can only change state outside user transaction. • All other audit changes can be done in a transaction, but with Audit or Audit Specification OFF.
Securely and Easily Track DB Activity • Consider SQL Server Audit for all security auditing requirements and leverage the 2012 enhancements • Carefully devise a strategy for what needs to be audited and where to send the audit information based on security and performance needs • Monitor administrator activity and prevent tampering of the logs.
Session Resources • Books Online: • Security Enhancements (Database Engine), http://msdn.microsoft.com/en-us/library/cc645578(v=sql.110).aspx • SQL Server Audit (Database Engine), http://msdn.microsoft.com/en-us/library/cc280386(v=SQL.110).aspx • Whitepaper: • Auditing in SQL Server 2008, http://msdn.microsoft.com/en-us/library/dd392015(v=SQL.100).aspx • SQL Server Security Forum: • http://social.msdn.microsoft.com/forums/en-US/sqlsecurity/threads/ • SQL Security Blog: • http://blogs.msdn.com/b/sqlsecurity/
Related Content Bare Metal Microsoft SQL Server 2012 Deployment and Management (S. Hall B WRK Rm1) Microsoft SQL Server: Mission Critical Confidence - Organizational Security and Compliance Demo Station (S. Hall A) Find Me Later At The Mission Critical Booth In The Expo
http://blogs.msdn.com/b/sqlsecurity/ ilsung@microsoft.com I’m not a tweeter Il-Sung Lee
Track Resources Hands-On Labs @sqlserver @ms_teched SQL Server 2012 Eval Copy Get Certified! mva Microsoft Virtual Academy
Resources Learning TechNet • Connect. Share. Discuss. • Microsoft Certification & Training Resources http://northamerica.msteched.com www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers • http://microsoft.com/technet http://microsoft.com/msdn
Required Slide Complete an evaluation on CommNet and enter to win!
Please Complete an Evaluation Your feedback is important! Multipleways to Evaluate Sessions Be eligible to win great daily prizes and the grand prize of a $5,000 Travel Voucher! Scan the Tag to evaluate this session now on myTechEdMobile
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.