SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
David Dye
Introduction 
What is Auditing 
Overview of auditing options 
Introduction to SQL Audit 
SQL Audit Objects 
Implementing SQL Audit 
Audit
David Dye 
ddye@capecoral.net 
HTTP://WWW.SQLSAFETY.COM
Tracking and logging of events 
◦Security events 
◦DDL events 
◦DML events 
◦Data access events 
Often required by oversight or governance 
◦HIPPA 
◦SOX 
◦PCI
C2 Auditing 
Common Criteria Compliance 
SQL Trace 
DDL/DML Triggers 
SQL Audit
Introduced in SQL 2000 
Meets Department of Defense C2 security requirements 
Configured at the server level 
Audit logs are stored in the SQL folder structure 
Audit logs viewed through SQL Profiler or fn_trace_gettablefunction
ALL events are defined and non-configurable 
Instance wide auditing 
Logs can ONLY be stored in default instance data directory 
Rollover file size is non-configurable 
Inability to write to log file results in SQL shut down
Introduced in SQL 2005 
◦SQL 05 SP1 Evaluation Assurance Level 1 (EAL1) 
◦SQL 05 SP2/SQL 08 EAL4++ 
Does not include all C2 audit mode functionality 
Includes 
◦Residual Information Protection (RIP) 
◦The ability to view login statistics 
◦Column GRANT should not override table DENY
Requires Enterprise, Evaluation, or Developer edition 
Does not incorporate all C2 audit mode functionality 
Can degrade performance 
EAL4++ requires running additional scripts
Traces can be scripted or created through profiler 
Traces are highly configurable and can be selective 
Results saved to file or table 
Templates can be utilized
Can degrade performance 
Trace scope can not be efficiently limited to object (database) or action 
Programmatic limitations
Capture DDL and most DML events 
Cons 
◦Can be expensive! 
◦Trigger fails-Transaction FAILS 
◦Can’t capture all events
What is SQL Audit 
SQL Audit Background
Introduced in SQL 2008 
Provides the ability to audit server, database, and audit level events 
Internal to the SQL server 
Available in Enterprise, developer, and trial editions
Uses extended events 
Created through T-SQL, PowerShell or SSMS 
Audits can have the following scopes: 
◦Server level 
Include server operations, Logon, Logoff, etc. 
◦Database level 
Database action, DML, or DDL 
◦Audit level 
Alter, Create, Drop, etc. audits 
Audits can be synchronous or asynchronous and logged to 
◦File 
◦Windows application log 
◦Windows security log 
Full management, configuration, and administration available through .NET using SMO
Server Audit 
Server Level Audit Groups 
Database Level Audit Groups 
◦Database Level Audit Actions 
Audit Level Specification Groups
1.Created in the master database 
•First audit object to be created 
•Defines 
How the audit will be stored 
File 
Max file size (2mb is default and 2,147,483,647 TB is max) 
Max number of rollover files (unlimited is default) 
Reserved disk space (reserves the max. file space unless this is unlimited) 
Application log 
Security log 
Synchronous or asynchronous 
State of the SQL service on failure to maintain audit
1.References the server audit defining how audit data is stored 
•Created to record server level audit actions 
1.SUCCESSFUL_LOGIN_GROUP 
2.LOGOUT_GROUP 
3.FAILED_LOGIN_GROUP 
4.LOGIN_CHANGE_PASSWORD_GROUP 
5.APPLICATION_ROLE_CHANGE_PASSWORD_GROUP 
6.SERVER_ROLE_MEMBER_CHANGE_GROUP 
7.DATABASE_ROLE_MEMBER_CHANGE_GROUP 
8.BACKUP_RESTORE_GROUP 
9.DBCC_GROUP 
10.SERVER_OPERATION_GROUP 
11.DATABASE_OPERATION_GROUP 
12.AUDIT_ CHANGE_GROUP 
13.SERVER_STATE_CHANGE_GROUP 
14.SERVER_OBJECT_CHANGE_GROUP 
15.SERVER_PRINCIPAL_CHANGE_GROUP 
16.DATABASE_CHANGE_GROUP 
17.DATABASE_OBJECT_CHANGE_GROUP 
18.DATABASE_PRINCIPAL_CHANGE_GROUP 
19.SCHEMA_OBJECT_CHANGE_GROUP 
20.SERVER_PRINCIPAL_IMPERSONATION_GROUP 
21.DATABASE_PRINCIPAL_IMPERSONATION_GROUP 
22.SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP 
23.DATABASE_OWNERSHIP_CHANGE_GROUP 
24.DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP 
25.SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP 
26.SERVER_PERMISSION_CHANGE_GROUP 
27.SERVER_OBJECT_PERMISSION_CHANGE_GROUP 
28.DATABASE_PERMISSION_CHANGE_GROUP 
29.DATABASE_OBJECT_PERMISSION_CHANGE_GROUP 
30.SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP 
31.DATABASE_OBJECT_ACCESS_GROUP 
32.SCHEMA_OBJECT_ACCESS_GROUP 
33.BROKER_LOGIN_GROUP 
34.DATABASE_MIRRORING_LOGIN_GROUP 
35.TRACE_CHANGE_GROUP
1.References the server audit defining how audit data is stored 
•Created to record database level audit actions 
1.DATABASE_ROLE_MEMBER_CHANGE_GROUP 
2.DATABASE_OPERATION_GROUP 
3.DATABASE_CHANGE_GROUP 
4.DATABASE_OBJECT_CHANGE_GROUP 
5.DATABASE_PRINCIPAL_CHANGE_GROUP 
6.SCHEMA_OBJECT_CHANGE_GROUP 
7.DATABASE_PRINCIPAL_IMPERSONATION_GROUP 
8.DATABASE_OWNERSHIP_CHANGE_GROUP 
9.DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP 
10.SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP 
11.DATABASE_PERMISSION_CHANGE_GROUP 
12.DATABASE_OBJECT_PERMISSION_CHANGE_GROUP 
13.SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP 
14.DATABASE_OBJECT_ACCESS_GROUP 
15.SCHEMA_OBJECT_ACCESS_GROUP
1.References the server audit defining how audit data is stored 
•Created to record database level actions 
1.SELECT 
2.UPDATE 
3.INSERT 
4.DELETE 
5.EXECUTE 
6.RECEIVE 
7.REFERENCES
1.References the server audit defining how audit data is stored 
•Created to record audit level action groups 
1.AUDIT_ CHANGE_GROUP 
•CREATE SERVER AUDIT 
•ALTER SERVER AUDIT 
•DROP SERVER AUDIT 
•CREATE SERVER AUDIT SPECIFICATION 
•ALTER SERVER AUDIT SPECIFICATION 
•DROP SERVER AUDIT SPECIFICATION 
•CREATE DATABASE AUDIT SPECIFICATION 
•ALTER DATABASE AUDIT SPECIFICATION 
•DROP DATABASE AUDIT SPECIFICATION
Creating Server Audit 
◦Demo Using SSMS 
Creating Audit Specification 
◦Demo Using SSMS 
Creating Server Specification 
◦Demo T-SQL 
Creating Database Specification 
◦Demo T-SQL 
Working with Audit Logs
1.Implementing a SQL audit begins with the server audit 
•Defines: 
•How audit is saved 
•Synchronous/Asynchronous 
•What happens on failure
1.Create server audit 
1.Using SSMS 
2.Write to application log 
3.Synchronous 
4.Stop sqlservice on failure
$dbServer= new-Object Microsoft.SqlServer.Management.Smo.Server("(local)") 
$dbAudit= New-Object Microsoft.SqlServer.Management.Smo.Audit($dbServer, "Test Audit") 
$dbAudit.DestinationType= [Microsoft.SqlServer.Management.Smo.AuditDestinationType]'File' 
$dbAudit.FilePath= "C:Audit" 
$dbAudit.Create() 
$dbAudit.Enable()
1.SQL audit specification is created at the server level 
•Audits all audit events 
•Utilizes a server audit
1.Create audit specification 
1.Using SSMS 
2.Using server audit 
3.All Audit_Changeevents
1.Implementing a SQL audit begins with the server audit 
•Defines: 
•What server audit will be used 
•The database level events to be audited
1.Create database audit specification 
1.Using T-SQL 
2.Using server audit 
3.SELECT and INSERT events on Person.Personby dbo 
4.SELECT events on HumanResources.Employeeby public

Weitere ähnliche Inhalte

Was ist angesagt?

How to Extend Apache Spark with Customized Optimizations
How to Extend Apache Spark with Customized OptimizationsHow to Extend Apache Spark with Customized Optimizations
How to Extend Apache Spark with Customized OptimizationsDatabricks
 
Explain the explain_plan
Explain the explain_planExplain the explain_plan
Explain the explain_planMaria Colgan
 
Practical Distributed Machine Learning Pipelines on Hadoop
Practical Distributed Machine Learning Pipelines on HadoopPractical Distributed Machine Learning Pipelines on Hadoop
Practical Distributed Machine Learning Pipelines on HadoopDataWorks Summit
 
Web API The Good Partsの紹介 ~美しいWebAPIの作り方~
Web API The Good Partsの紹介 ~美しいWebAPIの作り方~Web API The Good Partsの紹介 ~美しいWebAPIの作り方~
Web API The Good Partsの紹介 ~美しいWebAPIの作り方~Futa HIRAKOBA
 
B+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBB+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBOvais Tariq
 
Redis + Kafka = Performance at Scale | Julien Ruaux, Redis Labs
Redis + Kafka = Performance at Scale | Julien Ruaux, Redis LabsRedis + Kafka = Performance at Scale | Julien Ruaux, Redis Labs
Redis + Kafka = Performance at Scale | Julien Ruaux, Redis LabsHostedbyConfluent
 
Introduction to couchbase
Introduction to couchbaseIntroduction to couchbase
Introduction to couchbaseDipti Borkar
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architectureAjeet Singh
 
Azure SQL Database
Azure SQL Database Azure SQL Database
Azure SQL Database nj-azure
 
Загальні принципи розроблення АРМ оператора на базі SCADA/HMI
Загальні принципи розроблення АРМ оператора на базі SCADA/HMIЗагальні принципи розроблення АРМ оператора на базі SCADA/HMI
Загальні принципи розроблення АРМ оператора на базі SCADA/HMIПупена Александр
 
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta LakeSimplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta LakeDatabricks
 
DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!kwatch
 
InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)I Goo Lee.
 
DockerからKubernetesへのシフト
DockerからKubernetesへのシフトDockerからKubernetesへのシフト
DockerからKubernetesへのシフトmasaki nakayama
 
Real-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to StreamingReal-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to StreamingDatabricks
 
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
A Rusty introduction to Apache Arrow and how it applies to a  time series dat...A Rusty introduction to Apache Arrow and how it applies to a  time series dat...
A Rusty introduction to Apache Arrow and how it applies to a time series dat...Andrew Lamb
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテストKentaro Kawano
 
Portable UDFs: Write Once, Run Anywhere
Portable UDFs: Write Once, Run AnywherePortable UDFs: Write Once, Run Anywhere
Portable UDFs: Write Once, Run AnywhereDatabricks
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017Gianluca Hotz
 

Was ist angesagt? (20)

How to Extend Apache Spark with Customized Optimizations
How to Extend Apache Spark with Customized OptimizationsHow to Extend Apache Spark with Customized Optimizations
How to Extend Apache Spark with Customized Optimizations
 
Explain the explain_plan
Explain the explain_planExplain the explain_plan
Explain the explain_plan
 
Practical Distributed Machine Learning Pipelines on Hadoop
Practical Distributed Machine Learning Pipelines on HadoopPractical Distributed Machine Learning Pipelines on Hadoop
Practical Distributed Machine Learning Pipelines on Hadoop
 
Web API The Good Partsの紹介 ~美しいWebAPIの作り方~
Web API The Good Partsの紹介 ~美しいWebAPIの作り方~Web API The Good Partsの紹介 ~美しいWebAPIの作り方~
Web API The Good Partsの紹介 ~美しいWebAPIの作り方~
 
B+Tree Indexes and InnoDB
B+Tree Indexes and InnoDBB+Tree Indexes and InnoDB
B+Tree Indexes and InnoDB
 
Redis + Kafka = Performance at Scale | Julien Ruaux, Redis Labs
Redis + Kafka = Performance at Scale | Julien Ruaux, Redis LabsRedis + Kafka = Performance at Scale | Julien Ruaux, Redis Labs
Redis + Kafka = Performance at Scale | Julien Ruaux, Redis Labs
 
Introduction to couchbase
Introduction to couchbaseIntroduction to couchbase
Introduction to couchbase
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
Azure SQL Database
Azure SQL Database Azure SQL Database
Azure SQL Database
 
Загальні принципи розроблення АРМ оператора на базі SCADA/HMI
Загальні принципи розроблення АРМ оператора на базі SCADA/HMIЗагальні принципи розроблення АРМ оператора на базі SCADA/HMI
Загальні принципи розроблення АРМ оператора на базі SCADA/HMI
 
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta LakeSimplify CDC Pipeline with Spark Streaming SQL and Delta Lake
Simplify CDC Pipeline with Spark Streaming SQL and Delta Lake
 
DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!DBスキーマもバージョン管理したい!
DBスキーマもバージョン管理したい!
 
InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)
 
DockerからKubernetesへのシフト
DockerからKubernetesへのシフトDockerからKubernetesへのシフト
DockerからKubernetesへのシフト
 
Real-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to StreamingReal-Time Spark: From Interactive Queries to Streaming
Real-Time Spark: From Interactive Queries to Streaming
 
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
A Rusty introduction to Apache Arrow and how it applies to a  time series dat...A Rusty introduction to Apache Arrow and how it applies to a  time series dat...
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテスト
 
Portable UDFs: Write Once, Run Anywhere
Portable UDFs: Write Once, Run AnywherePortable UDFs: Write Once, Run Anywhere
Portable UDFs: Write Once, Run Anywhere
 
Mysql Optimization
Mysql OptimizationMysql Optimization
Mysql Optimization
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 

Ähnlich wie Implementing Auditing in SQL Server

Database Performance Tuning| Rahul Gulab Singh
Database Performance Tuning| Rahul Gulab SinghDatabase Performance Tuning| Rahul Gulab Singh
Database Performance Tuning| Rahul Gulab SinghRahul Singh
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsSQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsHostway|HOSTING
 
SQL Server 2008 Security Overview
SQL Server 2008 Security OverviewSQL Server 2008 Security Overview
SQL Server 2008 Security Overviewukdpe
 
Under New Management
Under New ManagementUnder New Management
Under New Managementukdpe
 
Sql server-performance-hafi
Sql server-performance-hafiSql server-performance-hafi
Sql server-performance-hafizabi-babi
 
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...SpanishPASSVC
 
Rock Solid SQL Server Management
Rock Solid SQL Server ManagementRock Solid SQL Server Management
Rock Solid SQL Server ManagementTony Bain
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availabilityPeter Gfader
 
Presentation database security audit vault & database firewall
Presentation   database security audit vault & database firewallPresentation   database security audit vault & database firewall
Presentation database security audit vault & database firewallxKinAnx
 
Auditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPASAuditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPASEDB
 
Oracle audit and reporting in one hour or less
Oracle audit and reporting in one hour or lessOracle audit and reporting in one hour or less
Oracle audit and reporting in one hour or lessLeon Rzhemovskiy
 
Oracle Enterprise Manager 12c: updates and upgrades.
Oracle Enterprise Manager 12c: updates and upgrades.Oracle Enterprise Manager 12c: updates and upgrades.
Oracle Enterprise Manager 12c: updates and upgrades.Rolta
 
Обзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorОбзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorBAKOTECH
 
Обзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorОбзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorMarina Gryshko
 

Ähnlich wie Implementing Auditing in SQL Server (20)

Auditing Data Access in SQL Server
Auditing Data Access in SQL ServerAuditing Data Access in SQL Server
Auditing Data Access in SQL Server
 
Database Performance Tuning| Rahul Gulab Singh
Database Performance Tuning| Rahul Gulab SinghDatabase Performance Tuning| Rahul Gulab Singh
Database Performance Tuning| Rahul Gulab Singh
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite ThingsSQL Server 2016: Just a Few of Our DBA's Favorite Things
SQL Server 2016: Just a Few of Our DBA's Favorite Things
 
DB2 LUW Auditing
DB2 LUW AuditingDB2 LUW Auditing
DB2 LUW Auditing
 
SQL Server 2008 Security Overview
SQL Server 2008 Security OverviewSQL Server 2008 Security Overview
SQL Server 2008 Security Overview
 
Under New Management
Under New ManagementUnder New Management
Under New Management
 
Sql server-performance-hafi
Sql server-performance-hafiSql server-performance-hafi
Sql server-performance-hafi
 
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
 
OER UNIT 5 Audit
OER UNIT  5 AuditOER UNIT  5 Audit
OER UNIT 5 Audit
 
Rock Solid SQL Server Management
Rock Solid SQL Server ManagementRock Solid SQL Server Management
Rock Solid SQL Server Management
 
Chetan.Kumar-SQL_DBA 9115
Chetan.Kumar-SQL_DBA 9115Chetan.Kumar-SQL_DBA 9115
Chetan.Kumar-SQL_DBA 9115
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
Presentation database security audit vault & database firewall
Presentation   database security audit vault & database firewallPresentation   database security audit vault & database firewall
Presentation database security audit vault & database firewall
 
Sql server basics
Sql server basicsSql server basics
Sql server basics
 
Auditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPASAuditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPAS
 
Oracle audit and reporting in one hour or less
Oracle audit and reporting in one hour or lessOracle audit and reporting in one hour or less
Oracle audit and reporting in one hour or less
 
Oracle Enterprise Manager 12c: updates and upgrades.
Oracle Enterprise Manager 12c: updates and upgrades.Oracle Enterprise Manager 12c: updates and upgrades.
Oracle Enterprise Manager 12c: updates and upgrades.
 
Обзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorОбзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change Auditor
 
Обзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorОбзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change Auditor
 
Vijaya_Lakshmi_Resume1
Vijaya_Lakshmi_Resume1Vijaya_Lakshmi_Resume1
Vijaya_Lakshmi_Resume1
 

Kürzlich hochgeladen

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Kürzlich hochgeladen (20)

WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Implementing Auditing in SQL Server

  • 2. Introduction What is Auditing Overview of auditing options Introduction to SQL Audit SQL Audit Objects Implementing SQL Audit Audit
  • 3. David Dye ddye@capecoral.net HTTP://WWW.SQLSAFETY.COM
  • 4. Tracking and logging of events ◦Security events ◦DDL events ◦DML events ◦Data access events Often required by oversight or governance ◦HIPPA ◦SOX ◦PCI
  • 5. C2 Auditing Common Criteria Compliance SQL Trace DDL/DML Triggers SQL Audit
  • 6. Introduced in SQL 2000 Meets Department of Defense C2 security requirements Configured at the server level Audit logs are stored in the SQL folder structure Audit logs viewed through SQL Profiler or fn_trace_gettablefunction
  • 7. ALL events are defined and non-configurable Instance wide auditing Logs can ONLY be stored in default instance data directory Rollover file size is non-configurable Inability to write to log file results in SQL shut down
  • 8.
  • 9. Introduced in SQL 2005 ◦SQL 05 SP1 Evaluation Assurance Level 1 (EAL1) ◦SQL 05 SP2/SQL 08 EAL4++ Does not include all C2 audit mode functionality Includes ◦Residual Information Protection (RIP) ◦The ability to view login statistics ◦Column GRANT should not override table DENY
  • 10. Requires Enterprise, Evaluation, or Developer edition Does not incorporate all C2 audit mode functionality Can degrade performance EAL4++ requires running additional scripts
  • 11.
  • 12. Traces can be scripted or created through profiler Traces are highly configurable and can be selective Results saved to file or table Templates can be utilized
  • 13. Can degrade performance Trace scope can not be efficiently limited to object (database) or action Programmatic limitations
  • 14.
  • 15. Capture DDL and most DML events Cons ◦Can be expensive! ◦Trigger fails-Transaction FAILS ◦Can’t capture all events
  • 16.
  • 17. What is SQL Audit SQL Audit Background
  • 18. Introduced in SQL 2008 Provides the ability to audit server, database, and audit level events Internal to the SQL server Available in Enterprise, developer, and trial editions
  • 19. Uses extended events Created through T-SQL, PowerShell or SSMS Audits can have the following scopes: ◦Server level Include server operations, Logon, Logoff, etc. ◦Database level Database action, DML, or DDL ◦Audit level Alter, Create, Drop, etc. audits Audits can be synchronous or asynchronous and logged to ◦File ◦Windows application log ◦Windows security log Full management, configuration, and administration available through .NET using SMO
  • 20. Server Audit Server Level Audit Groups Database Level Audit Groups ◦Database Level Audit Actions Audit Level Specification Groups
  • 21. 1.Created in the master database •First audit object to be created •Defines How the audit will be stored File Max file size (2mb is default and 2,147,483,647 TB is max) Max number of rollover files (unlimited is default) Reserved disk space (reserves the max. file space unless this is unlimited) Application log Security log Synchronous or asynchronous State of the SQL service on failure to maintain audit
  • 22. 1.References the server audit defining how audit data is stored •Created to record server level audit actions 1.SUCCESSFUL_LOGIN_GROUP 2.LOGOUT_GROUP 3.FAILED_LOGIN_GROUP 4.LOGIN_CHANGE_PASSWORD_GROUP 5.APPLICATION_ROLE_CHANGE_PASSWORD_GROUP 6.SERVER_ROLE_MEMBER_CHANGE_GROUP 7.DATABASE_ROLE_MEMBER_CHANGE_GROUP 8.BACKUP_RESTORE_GROUP 9.DBCC_GROUP 10.SERVER_OPERATION_GROUP 11.DATABASE_OPERATION_GROUP 12.AUDIT_ CHANGE_GROUP 13.SERVER_STATE_CHANGE_GROUP 14.SERVER_OBJECT_CHANGE_GROUP 15.SERVER_PRINCIPAL_CHANGE_GROUP 16.DATABASE_CHANGE_GROUP 17.DATABASE_OBJECT_CHANGE_GROUP 18.DATABASE_PRINCIPAL_CHANGE_GROUP 19.SCHEMA_OBJECT_CHANGE_GROUP 20.SERVER_PRINCIPAL_IMPERSONATION_GROUP 21.DATABASE_PRINCIPAL_IMPERSONATION_GROUP 22.SERVER_OBJECT_OWNERSHIP_CHANGE_GROUP 23.DATABASE_OWNERSHIP_CHANGE_GROUP 24.DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP 25.SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP 26.SERVER_PERMISSION_CHANGE_GROUP 27.SERVER_OBJECT_PERMISSION_CHANGE_GROUP 28.DATABASE_PERMISSION_CHANGE_GROUP 29.DATABASE_OBJECT_PERMISSION_CHANGE_GROUP 30.SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP 31.DATABASE_OBJECT_ACCESS_GROUP 32.SCHEMA_OBJECT_ACCESS_GROUP 33.BROKER_LOGIN_GROUP 34.DATABASE_MIRRORING_LOGIN_GROUP 35.TRACE_CHANGE_GROUP
  • 23. 1.References the server audit defining how audit data is stored •Created to record database level audit actions 1.DATABASE_ROLE_MEMBER_CHANGE_GROUP 2.DATABASE_OPERATION_GROUP 3.DATABASE_CHANGE_GROUP 4.DATABASE_OBJECT_CHANGE_GROUP 5.DATABASE_PRINCIPAL_CHANGE_GROUP 6.SCHEMA_OBJECT_CHANGE_GROUP 7.DATABASE_PRINCIPAL_IMPERSONATION_GROUP 8.DATABASE_OWNERSHIP_CHANGE_GROUP 9.DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP 10.SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP 11.DATABASE_PERMISSION_CHANGE_GROUP 12.DATABASE_OBJECT_PERMISSION_CHANGE_GROUP 13.SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP 14.DATABASE_OBJECT_ACCESS_GROUP 15.SCHEMA_OBJECT_ACCESS_GROUP
  • 24. 1.References the server audit defining how audit data is stored •Created to record database level actions 1.SELECT 2.UPDATE 3.INSERT 4.DELETE 5.EXECUTE 6.RECEIVE 7.REFERENCES
  • 25. 1.References the server audit defining how audit data is stored •Created to record audit level action groups 1.AUDIT_ CHANGE_GROUP •CREATE SERVER AUDIT •ALTER SERVER AUDIT •DROP SERVER AUDIT •CREATE SERVER AUDIT SPECIFICATION •ALTER SERVER AUDIT SPECIFICATION •DROP SERVER AUDIT SPECIFICATION •CREATE DATABASE AUDIT SPECIFICATION •ALTER DATABASE AUDIT SPECIFICATION •DROP DATABASE AUDIT SPECIFICATION
  • 26. Creating Server Audit ◦Demo Using SSMS Creating Audit Specification ◦Demo Using SSMS Creating Server Specification ◦Demo T-SQL Creating Database Specification ◦Demo T-SQL Working with Audit Logs
  • 27. 1.Implementing a SQL audit begins with the server audit •Defines: •How audit is saved •Synchronous/Asynchronous •What happens on failure
  • 28. 1.Create server audit 1.Using SSMS 2.Write to application log 3.Synchronous 4.Stop sqlservice on failure
  • 29. $dbServer= new-Object Microsoft.SqlServer.Management.Smo.Server("(local)") $dbAudit= New-Object Microsoft.SqlServer.Management.Smo.Audit($dbServer, "Test Audit") $dbAudit.DestinationType= [Microsoft.SqlServer.Management.Smo.AuditDestinationType]'File' $dbAudit.FilePath= "C:Audit" $dbAudit.Create() $dbAudit.Enable()
  • 30. 1.SQL audit specification is created at the server level •Audits all audit events •Utilizes a server audit
  • 31. 1.Create audit specification 1.Using SSMS 2.Using server audit 3.All Audit_Changeevents
  • 32. 1.Implementing a SQL audit begins with the server audit •Defines: •What server audit will be used •The database level events to be audited
  • 33. 1.Create database audit specification 1.Using T-SQL 2.Using server audit 3.SELECT and INSERT events on Person.Personby dbo 4.SELECT events on HumanResources.Employeeby public