Automated Enterprise-wide SQL Server Auditing

Slides:



Advertisements
Similar presentations
Burt King We will cover: Essentials --No command line needed here (mott) What is SQL Server How does it come to life What are the.
Advertisements

Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
Overview What is SQL Server? Creating databases Administration Security Backup.
Chapter 8 Hardening Your SQL Server Instance. Hardening  Hardening The process of making your SQL Server Instance more secure  New features Policy based.
Chapter-4 Windows 2000 Professional Win2K Professional provides a very usable interface and was designed for use in the desktop PC. Microsoft server system.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
SQL Server Security By Mattias Lind For PASS Security VC.
Module 14 Configuring Security for SQL Server Agent.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Windows 2000 Server Active Directory Groups User Accounts Frank Schneemann.
6/13/2015 Visit the Sponsor tables to enter their end of day raffles. Turn in your completed Event Evaluation form at the end of the day in the Registration.
New Instance… Now What? Presented by: James Donahoe Senior Solutions Engineer – TeleTracking Technologies MCSA: SQL Server 2012.
WELCOME! SQL Server Security. Scott Gleason This is my 9 th Jacksonville SQL Saturday Over ten years DBA experience Director of Database Operations
Securing SQL Server Processes with Certificates
DIT314 ~ Client Operating System & Administration
You Inherited a Database Now What?
Amazon Web Services RDS with SQL Server
Introduction to Operating Systems
Policy Based Management: Introduction & implementation
Disaster Recovery and SQL for new and non-DBAs
Solving the Hard Problems
SQL Server Monitoring Overview
Reading execution plans successfully
Automating SQL Server Management
DevOps Database Administration
Get to know SysKit Monitor
Auditing in SQL Server 2008 DBA-364-M
Limiting SQL Server Exposure
SQL Server May Let You Do It, But it Doesn’t Mean You Should
Tips for SQL Server Performance and Resiliency
Making PowerShell Useful
Please support our sponsors
Intro to Machine Learning
DevOps Database Administration
SQL Server and PowerShell Let’s Get Serious
Making PowerShell Useful
What’s new in SQL Server 2016 Availability Groups
Migrating your SQL Server Instance
Use PowerShell & dbatools to Manage your SQL Server Environment
dbatools - PowerShell and SQL Server Working Together
Maximizing SSMS for Developers and DBAs
Amazon Web Services RDS with SQL Server
Limiting SQL Server Exposure
Reliable, Repeatable, Configurable & Automated Validation with
PowerShell & PowerBi Reducing DBAs Context Switching
Making PowerShell Useful
PowerShell & PowerBi Reducing DBAs Context Switching
PowerShell & PowerBi Reducing DBAs Context Switching
Designing SSIS Packages for Performance
Outsourcing Database Administration
You Inherited a Database Now What?
Summit Nashville /3/2019 1:48 AM
BACHELOR’S THESIS DEFENSE
BACHELOR’S THESIS DEFENSE
BACHELOR’S THESIS DEFENSE
Thank you Sponsors.
SSIS Project Deployment: The T-SQL Way
Use PowerShell & dbatools to Manage your SQL Server Environment
Maximizing SSMS for Developers and DBAs
Administrator’s Manual
Michelle Haarhues Keeping up with SSMS.
The Fast and Easy Methods to Automate your SQL Server builds
SSRS – Thinking Outside the Report
SSDT, Docker, and (Azure) DevOps
The DBA Quit and now you’re it:
Environment Automation
Creating a Marketing Dashboard with Power BI & Dax
DAX: Functions and Context That’s What It’s All About!
An Introduction to Partitioning
Il-Sung Lee, Jack Richins Microsoft Corp
Presentation transcript:

Automated Enterprise-wide SQL Server Auditing Nem W. Schlecht (@[nemws1)@gmail.com] Automated Enterprise-wide SQL Server Auditing

October 30th Through November 3rd Join the brightest data professionals focused on the Microsoft Data Platform! October 30th Through November 3rd Pre-Conference Sessions – Monday/Tuesday Conference – Wednesday through Friday

SQLSatuday #682 – After Party 4th Floor of Mall of America at 6:30 PM Sponsored By:

Thank you Sponsors! Platinum Sponsor: Gold Sponsors:

PASSMN – News/Info Sponsors: Board Member Elections: Thanks to all our sponsors of 2017! We need Sponsors for 2018! Special thanks to our annual sponsor: Board Member Elections: 3 spots available for 2018-2019 term. Your chance to help out the MN SQL community!

About Me Fargo PASS Chapter Leader Twitter: @nemws1 E-mail: nemws1@gmail.com

About Me

IT Philosophy Modify your solutions for your needs. Stop modifying (constraining) yourself! Don't just fix the current problem… Fix it so it doesn't happen again

Introduction

Problem Lots of MSSQL Instances Need to set up new servers quickly and accurately Inconsistencies/Enterprise changes/Learning! Best Practices/Compliance (SOX, et. al.) 3rd Party software Jr. DBA / Domain Admins

Solution Collect data Compare data Check data Fix issues (yup, that simple)

Solution (Details) As close to all-SQL as possible (some PowerShell) Automated By default, uses servers from an SSMS Central Management Server List Run daily via a Windows Task Daily reports on changes and needed fixes

Collect Data If you need it, query it and record it All data collect queries stored in a table (of course) Simple key/value pairs Queries can be de-activated and sorted

Collect Data Working on community involvement and presets Minimum collection points Recommended Glenn Berry VM environments

Currently ~200 data points

Common Data Points All Agent Jobs (and Categories) All Database compatibility levels Free space on all drives Instant File Initialization?? Without Trace 3004 & 3605 Don't think we can check this yet…

Common Data Points Config:backup compression default Config:max server memory (MB) Config:max worker threads Default DATA Directory Default LOG Directory Login Audit Level SA has EMPTY password SA Last Modified

Compare Data If you record it, compare it. Compare today to the previous day Compare any 2 days

Daily Change E-mail Displays values between today and yesterday that have been: Changed Added Deleted

-- Changed Variables -- Instance: MB-MN01-VMG-003 Variable: SQL Server Start Time Old value: 2015-01-11 07:40:16 New value: 2015-01-13 00:43:06 -- New Variables -- Instance: MB-ND01-VMD-069\SPIDEV Variable: Database:SalesLead New value: 100 -- Old Variables -- -- *** No old values ***

Rule Checking If you record it, check it. Run sanity checks on your servers. Make sure: Backup compression is turned on 'sa' has a password set max memory is set

INSERT INTO auditRules ( ruleName , runOrder , action , configKey , target ) VALUES ( 'sa-a.bob.smith' -- name , 1100 -- order , 'notcontains' -- check/action , 'ServerRole:sysadmin' -- key to check , 'MBND\a.bob.smith' -- value to check ;

-- Rule Checks -- Rule: sa-a.bob.smith Result: notcontains:match Instance: MB-ND01-SC-005 Variable: ServerRole:sysadmin Value: BUILTIN\administrators,MBND\a.bob.smith,MBND\a.nem.schlecht,MBND\DomainAdmins,MBND\s.CCM,MBND\s.sccm,MBND\s.SQLSentry,NT AUTHORITY\SYSTEM,NT SERVICE\MSSQLSERVER,NT SERVICE\SQLSERVERAGENT,sa

Fixing Rule Violations If you check it, and it's wrong, fix it.

-- Fix sa-a.bob.smith--notcontains--ServerRole:sysadmin :connect SERVER1 IF (@@SERVERNAME <> 'SERVER1') BEGIN PRINT ' *** Wrong Server! ' + @@SERVERNAME + ' <> SERVER1'; SET NOEXEC ON; END USE [master] GO EXEC master..sp_dropsrvrolemember @loginame = N'MBND\a.bob.smith' , @rolename = N'sysadmin' -- End fix sa-a.bob.smith--notcontains--ServerRole:sysadmin

Fixing Rule Violations Make sure you make rules for everything Make sure they're in the right order! Create a rule to check for/create a user before you run the rule to assign them a role

ToDo Rules should be more flexible Many rules need SQL snippet fixes to be written for them yet New/old (or down) servers mess up the change report Use Server Groups from the Centralized Server Management list in rules Ex: Apply rule only if in the 'dev' group, etc.

Want to try it our yourself? http://ndgeek.com/sqlaudit/

About Me Fargo PASS Chapter Leader Twitter: @nemws1 E-mail: nemws1@gmail.com

Wake Up!!! I'm done! Any questions?