Advanced Security Protecting Data from the DBA

Slides:



Advertisements
Similar presentations
System Administration Accounts privileges, users and roles
Advertisements

Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 4 Profiles, Password Policies, Privileges, and Roles.
Auditing Database DDL Changes with SQLVer. About PASS The PASS community encompasses everyone who uses the Microsoft SQL Server or Business Intelligence.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Administering Your.
BARBARIN DAVID SQL Server Senior Consultant Pragmantic SA SQL Server Denali : New administration features.
Mike Fal - SQL SERVER SECURITY GRANTING, CONTROLLING, AND AUDITING DATABASE ACCESS March 17, 2011.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Duong Ngo October 14, POST-EXPLOITATION  Got access to a MSSQL box? (SQL injection, brute force…)  Privileges: sa / dbo / normal user  Got all.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 4 Profiles, Password Policies, Privileges, and Roles.
Chapter 6 : Designing SQL Server Service-Level Security MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide.
1 SQL Server 2000 Administration Kashef Mughal MSB.
MICROSOFT SQL SERVER 2005 SECURITY  Special Purpose Logins and Users  SQL Server 2005 Authentication Modes  Permissions  Roles  Managing Server Logins.
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
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.
Chapter 10: Rights, User, and Group Administration.
SQL Server 2005 Implementation and Maintenance Chapter 6: Security and SQL Server 2005.
SQL Server Administration. Overview  Security  Server roles  Database roles  Object permissions  Application roles  Managing data  Backups  Restoration.
SQL Server Security Basics Starting with a good foundation Kenneth Fisher
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
Security, Security, Secuirty =tg= Thomas Grohser, NTT Data SQL Server MVP SQL Server Performance Engineering SQL Saturday #506 BI Edition April 30 th 2016,
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
Security, Security, Secuirty
Recommended Practices & Fundamentals
Effective T-SQL Solutions
Microsoft SQL Server 2014 for Oracle DBAs Module 8
Establishing a Service Level Agreement SLA
Securing Data with SQL Server 2016
Optimizing SQL Server and Databases for large Fact Tables
Outsourcing Database Administration
Establishing a Service Level Agreement SLA
Establishing a Service Level Agreement SLA
DBA and IT Professional for ~9 years. Currently I am a Data Architect
SQL Server Security For Everyone
Optimizing SQL Server and Databases for large Fact Tables
# - it’s not about social media it’s about temporary tables and data
# - it’s not about social media it’s about temporary tables and data
Who Has What to Which? (The Permissions Superset)
Designing Database Solutions for SQL Server
Code-Less Securing of SQL Server
DevOps Database Administration
Auditing in SQL Server 2008 DBA-364-M
Security, Security, Secuirty
DevOps Database Administration
Why most candidates fail the interview in the first five minutes
5 WAYS TO BYPASS *OR ENSURE* SQL SERVER SECURITY MATT MARTIN
What’s new in SQL Server 2016 Availability Groups
SQL Server Security from the ground up
Service Level Agreement
Shaving of Microseconds
Why most candidates fail the interview in the first minute
Optimizing SQL Server and Databases for large Fact Tables
SQL Server Security 101 How did you get in here, and
SQL Server Security For Everyone
DBA for ~4+years, IT Professional for 7.5 years.
Intermediate Security Topics in SQL SERver
Outsourcing Database Administration
Why most candidates fail the interview in the first five minutes
Copyright © 2013 – 2018 by Curt Hill
SQL Server Security 101 How did you get in here, and
=tg= Thomas Grohser SQL Saturday Philadelphia 2019 TSQL Functions 42.
Why most Candidates fail the Interview in the first five Minutes
SQL Server Security from the ground up
Why most Candidates fail the Interview in the first five Minutes
42 TSQL Functions =tg= Thomas Grohser SQL Saturday
Hybrid Buffer Pool The Good, the Bad and the Ugly
Visual Studio and SQL Server Data Tools
Presentation transcript:

Advanced Security Protecting Data from the DBA =tg= Thomas Grohser Advanced Security Protecting Data from the DBA

select * from =tg= where topic = =tg= Thomas Grohser Senior Director Technical Solutions Architecture email: Thomas.grohser@nttdata.com tg@grohser.com Focus on SQL Server Security, Performance Engineering, Infrastructure and Architecture Wrote some of Close Relationship with SQLCAT (SQL Server Customer Advisory Team) SCAN (SQL Server Customer Advisory Network) TAP (Technology Adoption Program) Product Teams in Redmond Active PASS member and PASS Summit Speaker @@Version Remark SQL 4.21 First SQL Server ever used (1994) SQL 6.0 First Log Shipping with failover SQL 6.5 First SQL Server Cluster (NT4.0 + Wolfpack) SQL 7.0 2+ billion rows / month in a single Table SQL 2000 938 days with 100% availability SQL 2000 IA64 First SQL Server on Itanium IA64 SQL 2005 IA64 First OLTP long distance database mirroring SQL 2008 IA64 First Replication into mirrored databases SQL 2008R2 IA64 SQL 2008R2 x64 First 256 CPUs & >500.000 STMT/sec First Scale out > 1.000.000 STMT/sec First time 1.2+ trillion rows in a table SQL 2012 > 220.000 Transactions per second > 1.3 Trillion Rows in a table SQL 2014 > 400.000 Transactions per second Fully automated deploy and management SQL 2016 AlwaysOn Automatic HA and DR, crossed the PB in storage SQL vNext Can’t wait to push the limits even further

Ultimate Security Goal:  URLT  CNURLT Avoid being the headline

Basic plan for security What needs to be protected? From whom? At which cost? What’s the risk if we don’t do it?

What needs to be protected? Data Reading Adding / Changing / Removing Code, Queries, Schema a.k.a. Intellectual Property

Protected from whom? Hobby hacker Disgruntled employee Criminals / Competitors (Professional hacker seeking money) Disgruntled employee with skills Professional Hacker seeking fame Stupid Users Social engineering Stupid Code Government Disgruntled DBA

At which cost? What’s worse? Loosing data and it’s gone Loosing data to someone else With other words: Would you rather destroy data than have it stolen?

The problem with security

One tiny little hole is enough…

SQL Server offers a lot of build in security Logins, Users and Roles Permissions (Server, Database, Schema, Table, Column, …) Row Level Security Encryption (Data, Transparent Database, Backups) Auditing

Problem is … It all requires that the DBA is trusted Would you trust this guy? I definitely do not! Not joking! Everyone can be coerced into doing something bad.

How to protect data from the DBA Don’t store the data CVV and CVV2 are great example Hash the data and store the hash instead Passwords are a great example Encrypt the data in the application CCN, SSN, Account numbers Use Always Encrypted for the above task Limit what DBA’s can do

Demo

Preventing DBAs and sysadmins from modifying data It is impossible to DENY a member of the sysadmin server role anything Workaround for writing operations On the table you want to prevent editing by sysadmins add a DML Trigger Check for either specific logins (use ORIGINAL_LOGIN()) and commit else rollback or Check for sysadmin membership and rollback, else commit Then create individual server level triggers that prevent sysadmins from dropping, altering or disabling them (individual triggers on each event) ALTER_TRIGGER CREATE_TRIGGER DROP_TRIGGER Then create a global DDL trigger (DDL_EVENTS) preventing sysadmins from dropping, altering or disabling them Make sure you have one backdoor account that can drop or disable triggers You might want to exclude other triggers in normal user databases Problem here is that disable trigger will not fire an event…

So how can we limit the DBA Simple don’t make her/him a member of the sysadmin server role Easy? Yes it is we just have to use a “security hole” for the good …

Database Owner Don’t confuse with member of db_owner database role or dbo schema Use MyDatabase EXEC dbo.sp_changedbowner @loginame = 'NoRightsLogin' Default = User that creates the database or restores it (normally a member of sysadmin server role – just keep that in mind)

Stored Procedures ALTER PROC dbo.DoHarm WITH EXECUTE AS OWNER -- Powerful and dangerous!!! AS -- Evil Things can happen here; Procedures can be executed under the security context of the database owner, whatever that user can do the procedure can do in that database.

Trustworthy databases ALTER DATABASE SET TRUSTWORTY ON This widens the ability of a stored procedure to execute under the context of the database owner and run server level commands as well. Excellent feature if stored procedure deployment is controlled. Deadly feature if not.

Using this for the good… !!! No other database should be owned by a sysadmin or trustworth Create a “tool” database Make it owned by sa and trustworthy Securely deploy vetted and audited code that wraps admin functions in stored procedures. Don’t give DBA’s sysadmin, give them execute on the procedures. Stephen Mokszycki had a detailed talk about the same process earlier today: “Outsourcing database administration to your users.” Run.Backup … List.LogSpace … Find.BlockingTransactions …

So what about stuff you did not wrap in a procedure? Four or more eye principle Don’t allow a DBA to access the machine as sysadmin alone Make them team up and watch each other Have someone independent approve the access Have them use a special workstation that records keystrokes and the screen output and have an independent auditor review the session after every access.

Secure Setup User DBA 1 DBA 2 Manager

Summary Protecting the data from the DBA is possible but a lot of work is required to do so. It boils down to a simple question Is the data I am protecting worth the effort or can I take out an insurance policy that is more cost effective?

THANK YOU! and may the force be with you… Questions? thomas.grohser@nttdata.com (9 to 5 5 days a week :-) tg@grohser.com (24x7) Please fill out the evaluations.