SQL Server Permission Management: 12 Pitfalls and Misconceptions

23
SQL Server Permission Management 12 Pitfalls & Misconceptions

description

Your responsibilities as the DBA include the management of access permissions. To be able to live up to the expectation that you will be able to secure the data, you must know the 12 Pitfalls & Misconceptions that we will talk about in this session.

Transcript of SQL Server Permission Management: 12 Pitfalls and Misconceptions

Page 1: SQL Server Permission Management: 12 Pitfalls and Misconceptions

SQL ServerPermission Management

12 Pitfalls & Misconceptions

Page 2: SQL Server Permission Management: 12 Pitfalls and Misconceptions

About Me

Sebastian

Meine

Clean Code

SQL Stylistsqlity.

netFast

Code

Page 3: SQL Server Permission Management: 12 Pitfalls and Misconceptions

About Me

Sebastian

Meine

Clean Code

SQL Stylistsqlity.

netFast

Code

Page 4: SQL Server Permission Management: 12 Pitfalls and Misconceptions

Overview

©2011 sqlity.net llc, all rights reserved. emptyPic

Permission Management• What• When• Why• How

12 P&Ms• Pitfalls• Misconceptions

Page 5: SQL Server Permission Management: 12 Pitfalls and Misconceptions

I

Permission Management-

Why?

Page 6: SQL Server Permission Management: 12 Pitfalls and Misconceptions

ALTER SERVER ROLE sysadmin ADD MEMBER [public];

©2011 sqlity.net llc, all rights reserved. HoBT

Page 7: SQL Server Permission Management: 12 Pitfalls and Misconceptions

SQL Injection

©2011 sqlity.net llc, all rights reserved. HoBT

Page 8: SQL Server Permission Management: 12 Pitfalls and Misconceptions

SQL Injection

©2011 sqlity.net llc, all rights reserved. HoBT

Page 9: SQL Server Permission Management: 12 Pitfalls and Misconceptions

SQL Injection

©2011 sqlity.net llc, all rights reserved. HoBT

Exce

rpte

d fr

om

OW

ASP

Top

10 –

201

3 (P

age

4)

Page 10: SQL Server Permission Management: 12 Pitfalls and Misconceptions

I

Permission Management-

What?

Page 11: SQL Server Permission Management: 12 Pitfalls and Misconceptions

Least Privilege Principle

©2011 sqlity.net llc, all rights reserved. HoBT

Page 12: SQL Server Permission Management: 12 Pitfalls and Misconceptions

I

Permission Management-

When?

Page 13: SQL Server Permission Management: 12 Pitfalls and Misconceptions

After development is done.

©2011 sqlity.net llc, all rights reserved. HoBT

Page 14: SQL Server Permission Management: 12 Pitfalls and Misconceptions

After development is done.

©2011 sqlity.net llc, all rights reserved. HoBT

Security cannot be an afterthought

Page 15: SQL Server Permission Management: 12 Pitfalls and Misconceptions

I

Permission Management-

How?

Page 16: SQL Server Permission Management: 12 Pitfalls and Misconceptions

Permission Management

GRANT REVOKE DENY

Database Role

ServerRole

Application Role

©2011 sqlity.net llc, all rights reserved. HoBT

Page 17: SQL Server Permission Management: 12 Pitfalls and Misconceptions

GRANT Statement

©2011 sqlity.net llc, all rights reserved. HoBT

GRANT Privilege ON Securable TO Principal;

GRANTREVOKEDENY

Page 18: SQL Server Permission Management: 12 Pitfalls and Misconceptions

Privilege

SELECT UPDATE

CREATE ALTER

CONTROL …©2011 sqlity.net llc, all rights reserved. HoBT

Page 19: SQL Server Permission Management: 12 Pitfalls and Misconceptions

Securable

Table Schema

Database Server

Endpoint …©2011 sqlity.net llc, all rights reserved. HoBT

Page 20: SQL Server Permission Management: 12 Pitfalls and Misconceptions

Principal

ServerRole

Database Role

Application Role Login

User©2011 sqlity.net llc, all rights reserved. HoBT

Page 21: SQL Server Permission Management: 12 Pitfalls and Misconceptions

II

12 Pitfalls

& Misconceptions

Page 22: SQL Server Permission Management: 12 Pitfalls and Misconceptions

12 P&Ms

REVOKE = DENY

ALL PRIVILEGES

GRANT on all Columns =

GRANT on Table

REVOKE un-granted Column

Permission

REVOKE CONTROL

(Non)CASCADE

DENY (Non)CASCADE

Column GRANT >

Table DENY

DENY CONTROL

Role Ownership Implications

CONTROL SERVER Impact on

Securable Owner

Implicit User Creation Failure

Ownership Chaining

Quandary

©2011 sqlity.net llc, all rights reserved. HoBT

Page 23: SQL Server Permission Management: 12 Pitfalls and Misconceptions

References

SQL Stylist with sqlity.net

[email protected]

Sebastian Meine

©2011 sqlity.net llc, all rights reserved.

SQL Server Permission Management 12 P&Ms

http://goo.gl/YhsW1M