SQL Server Security For Everyone

Slides:



Advertisements
Similar presentations
MySQL Access Privilege System
Advertisements

Login dan Permission dfd, Jenis Login dfd, 2012 SQL Server Authentication Membutuhkan password Windows Authentication Mode Tidak membutuhkan password.
Security Pertemuan 7 Matakuliah: T0413 Tahun: 2009.
Login dan Permission dfd, Jenis Login dfd, 2012 SQL Server Authentication Membutuhkan password Windows Authentication Mode Tidak membutuhkan password.
CREATE LOGIN James WITH PASSWORD = 'A' Answer: SQL 2005 and 2008 can enforce the password policy of the operating system. CREATE LOGIN James WITH PASSWORD.
Understand Database Security Concepts
Chapter 9 Security. Endpoints  A SQL Server endpoint is the point of entering into SQL Server.  It is implemented as a database object that defines.
Logins, Roles and Credentials Lesson 14. Skills Matrix.
System Administration Accounts privileges, users and roles
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.
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.
Introduction to SQL Server 2000 Security Dave Watts CTO, Fig Leaf Software
Today’s Objectives Chapters 10 and 11 Security in SQL Server –Manage server logins and database users. –Manage server-level, database-level, and application.
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.
Course Topics Administering SQL Server 2012 Jump Start 01 | Install and Configure SQL Server04 | Manage Data 02 | Maintain Instances and Databases05 |
Security David Frommer Principal Architect Business Intelligence Microsoft Partner of the Year 2005 & 2007.
MICROSOFT SQL SERVER 2005 SECURITY  Special Purpose Logins and Users  SQL Server 2005 Authentication Modes  Permissions  Roles  Managing Server Logins.
Module 9 Authenticating and Authorizing Users. Module Overview Authenticating Connections to SQL Server Authorizing Logins to Access Databases Authorization.
Module 4: Managing Security. Overview Implementing an Authentication Mode Assigning Login Accounts to Users and Roles Assigning Permissions to Users and.
Controlling User Access. Objectives After completing this lesson, you should be able to do the following: Create users Create roles to ease setup and.
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.
Securing SQL Server 2005 Anil Desai. Speaker Information Anil Desai –Independent consultant (Austin, TX) –Author of several SQL Server books –Instructor,
2. SQL Security Objectives –Learn SQL Server 2000 components Contents –Understanding the Authentication Process –Understanding the Authorization Process.
Lara Microsoft. What does it mean? Why do you need to care? How can you achieve your SoD goals?
Permissions Lesson 13. Skills Matrix Security Modes Maintaining data integrity involves creating users, controlling their access and limiting their ability.
Module 11 Authorizing Users to Access Resources. Module Overview Authorizing User Access to Objects Authorizing Users to Execute Code Configuring Permissions.
ADO.NET AND STORED PROCEDURES - Swetha Kulkarni. RDBMS ADO.NET Provider  SqlClient  OracleClient  OleDb  ODBC  SqlServerCE System.Data.SqlClient.
INTRO TO SQL SERVER SECURITY By Robert Biddle
Esri UC 2014 | Technical Workshop | Administering Your Microsoft SQL Server Geodatabase Shannon Shields Chet Dobbins.
SQL Server 2005 Implementation and Maintenance Chapter 6: Security and SQL Server 2005.
Oracle 11g: SQL Chapter 7 User Creation and Management.
SQL Server Administration. Overview  Security  Server roles  Database roles  Object permissions  Application roles  Managing data  Backups  Restoration.
1 Chapter Overview Granting Database-Specific Permissions Using Application Roles Designing an Access and Permissions Strategy.
Intro To Oracle :part 1 1.Save your Memory Usage & Performance. 2.Oracle Login ways. 3.Adding Database to DB Trees. 4.How to Create your own user(schema).
SQL Server Security Basics Starting with a good foundation Kenneth Fisher
Secure Data Access with SQL Server 2005 Doug Rees Associate Technologist, CM Group
SQL Server Permissions and Security Principals William Assaf Sparkhound, Inc. SQLSAT CLUTCH CITY 2015.
SQL Server Security The Low Hanging Fruit. Lindsay Clark Database Administrator at American Credit Acceptance
7.5 Using Stored-Procedure and Triggers NAME MATRIC NUM GROUP Muhammad Azwan Bin Khairul Anwar CS2305A Muhammad Faiz Bin Badrol Shah CS2305B.
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 Implementation & Administration
Administrating a Database
Microsoft SQL Server 2014 for Oracle DBAs Module 8
Securing Data with SQL Server 2016
Access, Users, Permissions
Introduction to SQL Server 2000 Security
Common Security Mistakes
OER- UNIT 3 Authorization
Designing Database Solutions for SQL Server
The Dirty Business of Auditing
5 WAYS TO BYPASS *OR ENSURE* SQL SERVER SECURITY MATT MARTIN
SQL Server Security from the ground up
or: How I Learned to Stop Using EXECUTE AS and Love Certificates
SQL Server Security 101 How did you get in here, and
SQL Server Security For Everyone
Intermediate Security Topics in SQL SERver
Outsourcing Database Administration
SQL .. An overview lecture3.
Copyright © 2013 – 2018 by Curt Hill
PT2520 Unit 8: Database Security I
SQL Server Security 101 How did you get in here, and
Administrating a Database
SQL Server Security from the ground up
We Need To Talk Security
Presentation transcript:

SQL Server Security For Everyone Starting with a good foundation Kenneth Fisher @sqlstudent144 sqlstudent144@gmail.com www.sqlstudies.com

Who’s responsible for security? All of us

Why are we here? Our goal today is to go from zero knowledge of SQL Server security to a working knowledge of SQL Server security.

What are we doing? Definitions Using the GUI. Some best practices. It helps if we use a consistent terminology. Using the GUI. Where can we find security in the GUI? Using the GUI to learn to script. Some best practices. Guidelines from some really smart people.

Definitions Principals Securables Permissions

Permissions A permission is what the principal is allowed to do to the securable. Tables & Views SELECT INSERT UPDATE DELETE SPs & Functions EXECUTE SPs, Functions & Views VIEW DEFINITION Databases CONNECT BACKUP CREATE PROCEDURE VIEW DATABASE STATE

Securables A securable is an object that a principal wants access to. Database Schema Schema Stored Procedure Function View Table Column

Securables A securable is an object that a principal wants access to. Instance

Principals A principal is something requesting permissions to a securable. Server Database SQL login Server role Windows login Login mapped to a certificate User mapped to an asymmetric key Windows group Application role Login mapped to an asymmetric key Windows user SQL user Windows group User mapped to a certificate Database role

Principals A principal is something requesting permissions to a securable. Server Database Logins Users SQL login SQL user Roles AD\Windows login AD\Windows login Server role Database role AD\Windows group AD\Windows group Application role Login mapped to a certificate User mapped to a certificate Login mapped to an asymmetric key User mapped to an asymmetric key

Principals A role is a special type of principal that is designed to contain other principals and transfer permissions to them. Built in roles User defined roles Server and Database level roles that come with SQL Server most of which can’t be granted or denied permissions. Roles created by a user and can be granted/denied permissions. User defined server roles are new as of SQL Server 2012.

Tying it all together All of this data is available through system views. Instance Database sys.server_principals sys.server_permissions sys.server_role_members sys.database_principals sys.database_permissions sys.database_role_members These six views contain just the core data. There are several more views and functions with additional information.

Tying it all together How are server principals and database principals related? SID SQL Login  0x014EA8886B841C4CA1F7ED32489BBF62 AD Login 0x010500000000000515000000AA70DE8DE24F4D68F572D916EB8C0100 AD Group 0x010500000000000515000000AA70DE8DE24F4D68F572D91623FF0300 Certificate 0x01060000000000090100000069EE6684FF55FDC676DE368D07C2C200FE155810 Principal_ID Server Principals Database Principals Name SID

Tying it all together Orphaned Users Server Database Principals SID SQL Login  0x014EA8886B841C4CA1F7ED32489BBF62 AD Login 0x010500000000000515000000AA70DE8DE24F4D68F572D916EB8C0100 AD Group 0x010500000000000515000000AA70DE8DE24F4D68F572D91623FF0300 Certificate 0x01060000000000090100000069EE6684FF55FDC676DE368D07C2C200FE155810 Server Principals Database Principals

Tying it all together Orphaned Users – Windows Authenticated Server A Server B CREATE LOGIN [Domain\Dopey] FROM WINDOWS Logins Logins Users Users

Tying it all together Orphaned Users – SQL Authenticated Server A Server B CREATE LOGIN Dopey WITH PASSWORD = 'MyPass'; Logins Logins EXEC sp_change_users_login 'auto_fix','DOPEY'; or ALTER USER Dopey WITH LOGIN = Dopey; Users Users

Tying it all together Orphaned Users – SQL Authenticated Server A Server B Logins Logins EXEC sp_change_users_login 'auto_fix','DOPEY'; or ALTER USER Dopey WITH LOGIN = Dopey; Users Users

Tying it all together Orphaned Users – SQL Authenticated Server A Server B Logins Logins EXEC sp_change_users_login 'auto_fix','DOPEY'; or ALTER USER Dopey WITH LOGIN = Dopey; Users Users

Tying it all together Orphaned Users – SQL Authenticated Server A Server B CREATE LOGIN Dopey WITH PASSWORD = 'MyPass', SID = 0x014EA8886B841C4CA 1F7ED32489BBF62 Logins Logins Users Users

Tying it all together <> Orphaned Users – Exceptions Roles Contained Databases Server and database roles have no relation to each other. The database principals in a contained database have all of the information needed to connect to the server and database. Server A Server A Server B <> Login User Login User Roles Roles

Tying it all together How do we apply a permission to a principal? DENY GRANT A permission cannot be allowed. Allow a permission REVOKE Remove a GRANT or DENY.

Administrative Principals and Permissions These are the super users and deserve special attention. Each of them complete control over their associated securable. Single User Role Permission Instance sa sysadmin control server Database dbo db_owner control database

Where can we find security info? Using SSMS to help us learn to script.

Best Practices! Least Maintenance Least Surface Area Least Privileges

Best Practices! Least Maintenance Make your life as easy as possible. Don’t make permissions more granular than you have to. (Don’t grant permissions at a table level if granting them at a Schema or even better the database level will work) Using Roles and AD/Windows groups. Be consistent.

Best Practices! Least Surface Area Reduce the number of places an attack can come from. If you don’t need it either disable it (SSIS, SSAS, etc) or don’t install it (external apps, drivers, etc). Don’t create “extra” databases in production. (AdventureWorks for example) Disable unused SQL Server Protocols. (TCP\IP, Named Pipes, VIA, shared memory)

Best Practices! Least Privilege If they don't need to do then they shouldn’t be able to. Don’t add a developer to the db_Owner role, even on a development database. Grant permissions to views, SPs etc. rather than the underlying tables. Granting permissions at lowest level possible. (Don’t grant permissions at a database level if granting it at a Schema or even better an Object level will work.)

Best Practices! Security is all give and take. Security is a balance between granting sufficient permissions to allow users to get their job done and limiting those permissions to avoid mistakes and discourage malicious activities. To make security workable you also have to balance the risks of granting too many permissions against the maintenance cost of granting permissions at the minimum level.

It's a big scary world out there. Physical Security Network Security Social Engineering Server Security SQL Server Security

Thank You

The Quiz!