Outsourcing Database Administration

Slides:



Advertisements
Similar presentations
Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
Advertisements

Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
WebGoat & WebScarab “What is computer security for $1000 Alex?”
Chapter 9 Auditing Database Activities
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 4 Profiles, Password Policies, Privileges, and Roles.
Brian Alderman | MCT, CEO / Founder of MicroTechPoint Pete Harris | Microsoft Senior Content Publisher.
Chapter 10 Overview  Implement Microsoft Windows Authentication Mode and Mixed Mode  Assign login accounts to database user accounts and roles  Assign.
Introduction to SQL 2005 Security Nick Ward SQL Server Specialist Nick Ward SQL Server Specialist
Lecture 18 Page 1 CS 111 Online Design Principles for Secure Systems Economy Complete mediation Open design Separation of privileges Least privilege Least.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
Today’s Objectives Chapters 10 and 11 Security in SQL Server –Manage server logins and database users. –Manage server-level, database-level, and application.
SCORCH – Fun Recipes for RunBooks MMS Minnesota 2014 Steve Jesok & Matthew #MMSSCOrch.
What to do for a Financial year end And When to do it.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 4 Profiles, Password Policies, Privileges, and Roles.
Attacking Applications: SQL Injection & Buffer Overflows.
Module 9 Authenticating and Authorizing Users. Module Overview Authenticating Connections to SQL Server Authorizing Logins to Access Databases Authorization.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
Copyright © 2013 Curt Hill Database Security An Overview with some SQL.
Module 10 Assigning Server and Database Roles. Module Overview Working with Server Roles Working with Fixed Database Roles Creating User-defined Database.
Module 15 Monitoring SQL Server 2008 R2 with Alerts and Notifications.
SQL Injection Jason Dunn. SQL Overview Structured Query Language For use with Databases Purpose is to retrieve information Main Statements Select Insert.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 9 Auditing Database Activities.
INTRO TO SQL SERVER SECURITY By Robert Biddle
SQL SERVER 2008 Installation Guide A Step by Step Guide Prepared by Hassan Tariq.
SQL Server 2005 Implementation and Maintenance Chapter 6: Security and SQL Server 2005.
Primenumbers.co.uk This presentation will help you get the most out of this service.
1 Chapter Overview Granting Database-Specific Permissions Using Application Roles Designing an Access and Permissions Strategy.
Secure Data Access with SQL Server 2005 Doug Rees Associate Technologist, CM Group
Introduction to SQL Server  Working with MS SQL Server and SQL Server Management Studio.
Dynamic SQL Writing Efficient Queries on the Fly ED POLLACK AUTOTASK CORPORATION DATABASE OPTIMIZATION ENGINEER.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
17 Copyright © 2006, Oracle. All rights reserved. Information Publisher.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
WELCOME! SQL Server Security. Scott Gleason This is my 9 th Jacksonville SQL Saturday Over ten years DBA experience Director of Database Operations
Defense In Depth: Minimizing the Risk of SQL Injection
SQL Database Management
Building a Home Grown Auditing Infrastructure for SQL Server
Microsoft SQL Server 2014 for Oracle DBAs Module 8
Dynamic SQL Writing Efficient Queries on the Fly
Section 13 - Integrating with Third Party Tools
Policy Based Management: Introduction & implementation
DBA and IT Professional for ~9 years. Currently I am a Data Architect
Dynamic SQL: Writing Efficient Queries on the Fly
Access, Users, Permissions
SQL Server Security For Everyone
Developing Production Quality SQL Code
Introduction to SQL Server 2000 Security
Deploying and Configuring SSIS Packages
Dynamic SQL Writing Efficient Queries on the Fly
Who Has What to Which? (The Permissions Superset)
Designing Database Solutions for SQL Server
Advanced Security Protecting Data from the DBA
DevOps Database Administration
Auditing in SQL Server 2008 DBA-364-M
Limiting SQL Server Exposure
DevOps Database Administration
5 WAYS TO BYPASS *OR ENSURE* SQL SERVER SECURITY MATT MARTIN
Making PowerShell Useful
SQL Server Security from the ground up
Dynamic SQL: Writing Efficient Queries on the Fly
SQL Server Security For Everyone
Limiting SQL Server Exposure
DBA for ~4+years, IT Professional for 7.5 years.
Making PowerShell Useful
Intermediate Security Topics in SQL SERver
Outsourcing Database Administration
DIY GP Maintenance Paul Johnson.
SSRS – Thinking Outside the Report
SQL Server Security from the ground up
Secure your high performance code
Presentation transcript:

Outsourcing Database Administration Repeatable, Automated, and Safe Leverage SQL Saturday #622 Albany, NY

About Stephen.Mokszycki@outlook.com DBA and IT Professional for ~9 years. Currently I am a Data Architect Worked with SQL 7.0/2000/2005/2008/2012/2014/2016 I have worked in a large environment: 300+ Instances, ~6000 databases, 10s TBs of data. I have worked in a small environments: 5 instances, 60 databases, 1TB of data Automation is my passion. https://www.linkedin.com/in/stephen-mokszycki-272b264a/

Overview: Outsourcing Database Administration to your Users Why and How do we enable self service? How do we secure it? How do we build it?

Why would you want to use a self service option? The little things are interruptive to the DBA(s). Empower the users safely, reducing time for both parties. DBAs have More time for the hard problems. Reduce administrative errors. And LESS WORK!

How it normally works DBA Does Everything User Needs Something User Submits a ticket User pings DBA DBA pauses, reviews request DBA request more info User sends more details DBA reviews again DBA executes DBA follows up with user User confirms DBA Does Everything

Securing Self Service : Controlled Access and Security Elevation (C. A Securing Self Service : Controlled Access and Security Elevation (C.A.S.E.) In order to create a self service option we have to grant people access. There are two ways to do this, the unsafe way and the safe way. Taking advantage of privilege escalation is the key idea. Talk about TRUSTWORTHY and

How to secure it Make it SAFE Using role based permissions Passing parameters safely with QuoteName() and injection checks Executing procedures as another login Using existing tool sets: SQL and powershell. Using something scary: TRUSTWORTHY Database.

Trustworthy and DBO From the docs: The TRUSTWORTHY database property is used to indicate whether the instance of SQL Server trusts the database and the contents within it. DBO: The dbo, or database owner, is a user account that has implied permissions to perform all activities in the database. Members of the sysadmin fixed server role are automatically mapped to dbo. What does this mean? What happens when the database owner is SA? Lets Find out!

The Two Options to Self Service Give the Helpdesk direct access aka SA Give Helpdesk Self Service via Controls HelpDesk Has Elevated Access HD tries to drop Login DBA has no clue Wrong Login is dropped! Business is down! DBA scrambles to figure out what happened. DBA URLT HelpDesk executes proc Tries to drop Login Action is blocked Action is logged DBA notified Business is safe. User URLT

A Trustworthy Database Is Dangerous Trustworthy lets the dbo do anything he can normally do outside of the database. Because of this we have to be careful with what we allow our users can do. We have to leverage Stored Procs and Role based permissions. We have to have safe repeatable code, with repeatable outcomes. Remember the goal: give the users some access into the admin world without compromising the integrity of our Server.

How to Build a little leverage with SQL! Things you can use: A database, where users can ONLY execute a limited set of objects. TRUSTWORTHY and “sa” as the owner. An audit and SQL Injection Check ORIGINAL_LOGIN() EXECUTE AS OWNER QUOTENAME() A Separate Schema and Role

Auditing, and Verification Auditing is hard when our sprocs are executed as owner….. ORIGINAL_LOGIN() Verify with IS_Member(), this may be overkill. But it helps! LOG EVERYTHING! All Variables used Sproc name Who did it Date and Time Logs can drive alerts!

SQL INJECTION! Watch out for the clever ones! Encapsulate your string inputs with QUOTENAME() LOG LOG LOG! Evidence may be necessary. You need to know what happened.

Demo Audit, Verify, and Injection

Expanding from here Increase your injection checks Add additional safety checks Add more to the log function and log tables. Raise eventlog errors Dump the users output somewhere, incase you need it later. Don’t copy paste, make a sproc or a function! Reusable code! Never write it twice!