introduction to sql server security

42
Introduction to SQL Server Security

Upload: jason-strate

Post on 25-May-2015

1.402 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Introduction to SQL Server Security

Introduction to SQL Server Security

Page 2: Introduction to SQL Server Security

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

• Founded 2008 by MSFT MVP Brian Knight • Focused on the MSFT SQL Server Platform • Provides services, training and software • MSFT/HP “go to” partner: • Gold Certified:

o BI o Data Management o SQL Performance

• Team led by multiple MVP’s • Offices throughout the US with Corporate

HQ in Jacksonville, FL

Pragmatic Works Company History

Page 3: Introduction to SQL Server Security

Getting Started

Jason Strate

e: [email protected]

b: www.jasonstrate.com

t: StrateSQL

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 4: Introduction to SQL Server Security

Agenda

Overview

Securing SQL Server

Accessing SQL Server

Controlling Access

Validation

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 5: Introduction to SQL Server Security

OVERVIEW

Overview Securing SQL

Server Accessing SQL

Server Controlling

Access Validation

Page 6: Introduction to SQL Server Security

Overview

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 7: Introduction to SQL Server Security

Overview

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 8: Introduction to SQL Server Security

Overview

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 9: Introduction to SQL Server Security

Overview

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 10: Introduction to SQL Server Security

SECURING SQL SERVER

Overview Securing SQL

Server Accessing SQL

Server Controlling

Access Validation

Page 11: Introduction to SQL Server Security

Start With Installation

• Operating system?

• Services?

• Tools?

• Features?

• Configuration?

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 12: Introduction to SQL Server Security

Service Accounts

• Virtual Service account

• Managed Service account

• Domain user

• Local user

• Network Service account

• Local System account

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 13: Introduction to SQL Server Security

Security Tip

Principle of least

privilege

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 14: Introduction to SQL Server Security

Location, Location, Location

• Where is the server physically?

• Where is the server on the network?

• Behind the firewall?

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 15: Introduction to SQL Server Security

ACCESSING SQL SERVER

Overview Securing SQL

Server Accessing SQL

Server Controlling

Access Validation

Page 16: Introduction to SQL Server Security

Accessing the Server

• Login

– Windows Authentication

• Group

• User

– SQL Server Authentication

– Certificate

– Asymmetric Key

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 17: Introduction to SQL Server Security

SQL Server Authentication

• Password policy

– Account lockout duration

– Account lockout threshold

– Reset account lockout counter after

– Complexity

– Password history

• Enforce password expiration

• Change password next login

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 18: Introduction to SQL Server Security

Advanced Access

Certificate Asymmetric Key

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 19: Introduction to SQL Server Security

CONTROLLING ACCESS

Overview Securing SQL

Server Accessing SQL

Server Controlling

Access Validation

Page 20: Introduction to SQL Server Security

Security Model Basics

• Resource within SQL Server, such as a database, table, procedure, or feature. Securable

• Object to which permissions can be assigned, such as a login or certificate. Principal

• Activity on the securable that is granted to the principal, such as read or view. Permission

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 21: Introduction to SQL Server Security

Permission Modes

GRANT

DENY REVOKE

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 22: Introduction to SQL Server Security

Server Securables

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 23: Introduction to SQL Server Security

Security Tip

CONTROL SERVER is a

replacement for sysadmin

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 24: Introduction to SQL Server Security

Database Securables

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 25: Introduction to SQL Server Security

Example 1

• GRANT VIEW SERVER STATE TO SQLCHICKEN

• GRANT CONTROL SERVER TO SQLBALLS

• GRANT SHOW PLAN TO AUNTKATHI

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 26: Introduction to SQL Server Security

Example 2

• GRANT EXECUTE TO SQLCHICKEN

• DENY EXECUTE ON dbo.usp_action TO SQL CHICKEN

• GRANT SELECT ON dbo.table TO SQLBALLS

• GRANT VIEW DATABASE STATE TO AUNTKATHI

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 27: Introduction to SQL Server Security

Security Roles

• Server Roles

• Custom Server Roles

• Database Roles

• Custom Database Roles

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 28: Introduction to SQL Server Security

Server Roles

• Bulkadmin

• Dbcreator

• Diskadmin

• Processadmin

• Securityadmin

• Setupadmin

• Sysadmin

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 29: Introduction to SQL Server Security

Custom Server Roles

• New for SQL Server 2012

• Create what you need

– Junior DBA

– Security admin

– Monitoring

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Trust me, I’m a junior

DBA

Page 30: Introduction to SQL Server Security

Security Tip

CONTROL SERVER is a

replacement for sysadmin

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 31: Introduction to SQL Server Security

Database Roles

• Db_accessadmin

• Db_backupoperator

• Db_datareader

• Db_datawriter

• Db_ddladmin

• Db_denydatareader

• Db_denydatawriter

• Db_owner

• Db_securityadmin

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 32: Introduction to SQL Server Security

Security Tip

Beware of db_owner and

RESTRICTED_USER mode

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 33: Introduction to SQL Server Security

Custom Database Roles

• Been around since dirt

• Useful for

– Setting department permissions

– Grouping stored procedure access

– Simplifying permission management

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 34: Introduction to SQL Server Security

Security Tip

Use roles over logins for

permission assignments

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 35: Introduction to SQL Server Security

VALIDATION

Overview Securing SQL

Server Accessing SQL

Server Controlling

Access Validation

Page 36: Introduction to SQL Server Security

Validation

• Audits

– C2 Auditing

– Common Criteria Control

• SQL Server Audit

• Policy Based Management

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 37: Introduction to SQL Server Security

SQL Server Audit

• SQL Server 2008

– Enterprise edition feature

• SQL Server 2012

– Standard edition feature

– Accessible via Extended Events

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 38: Introduction to SQL Server Security

SQL Server Audit

• Server

– Permission changes

– DBCC events

– Failed logins

• Database

– DML activity

– SELECT activity

– Object modification

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 39: Introduction to SQL Server Security

Policy Based Management

• Introduced SQL Server 2008

– All editions

• Backwards compatibility

– To SQL Server 2000…. Kinda

• Checks

– DDL triggers

– Object properties

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 40: Introduction to SQL Server Security

Policy Based Management

• Add super power with…

Enterprise Policy Management Framework

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 41: Introduction to SQL Server Security

Wrapping Up

Securing SQL Server

Accessing SQL Server

Controlling Access

Validation

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 42: Introduction to SQL Server Security

Services Speed development through training, and rapid development services from Pragmatic Works.

Products BI products to covert to a Microsoft BI platform and simplify development on the platform.

Foundation Helping those who do not have the means to get into information technology achieve their dreams.

For more information…

Name: Jason Strate Email: [email protected] Blog: www.jasonstrate.com Resource: jasonstrate.com/go/Security