SlideShare a Scribd company logo
11/5/2009




                                                      How do you ensure SQL Server is 100% 
                                                                   Secure?
                                                      • Simple …….. You turn it off. 
       SQL Server Security Best                       • 100% security is not possible
             Practices                                • There are a number of best practices that you 
               Part 1                                   can take to make your SQL Server instance 
                                                               k        k       SQ S        i
      Fall 2009 Ohio Behavioral Health MIS              more secure
                  Users Group                         • The goal is to harden your SQL Server in a way 
                Jody McCluggage                         that it discourages attackers (e.g. don’t be the 
                                                        low hanging fruit)




                  Overview                                            Physical Security
• The primary focus will be on 2005/08                • Server housing production SQL Server should 
• Will mention some best practices for 97/2000          be secured and only accessible to those who 
  (but really, you should be using 2005/08 now)         need access
• This will be a high‐level overview.  If you have 
   hi ill b hi h l l             i      f     h
  any questions on the details of anything in this 
  presentation, please let me know.  Can do a 
  follow‐up with all the gory details if enough 
  people are interested.




     Disclaimer and Warning                               Turn off/Disable any unnecessary 
(Warning! Warning! Will Robinson)                                      services
• Use care and thoroughly think through and           • Turn off unnecessary services
                                                      • 2005/2008
  test before implementing any of the                    – Most unnecessary services are turned off by default
  suggestions in this presentation.                      – SQL Server Configuration Manager 
                                                         – SQL Server Surface Area Configuration Manager (2005)/ 
                                                            Q                           g              g (     )/
• I will not be held responsible if you break your
  I will not be held responsible if you break your         Policy manager (2008)
  system (and will probably deny even knowing         • 97/2000
  you)                                                   – Services MMC snap‐in Administrator Tools
                                                      • SQL Browser service is not needed if there is only a 
                                                        default instance
                                                         – Can also be disabled if you explicitly define and map ports 
                                                           from application to named instances




                                                                                                                             1
11/5/2009




         SQL Server Service Accounts
                                                                              SQL Server Service Accounts (cont.)
• Run SQL services under a low privilege local                                • Monitor services accounts for failed logons and 
  domain user account(s)                                                        account lockouts (account lockout will not prevent a 
                                                                                currently running SQL Server from running)
• Do not run under the context of the local                                   • 97/2000
   y     ,                   , (             p
  system, local administrator, or (heaven help                                   – Takes a little work but can be done
                                                                                   Takes a little work but can be done
  you) a Domain Administrator account                                            – May require changing some directory and registry 
• Service account for SQL Server requires Full                                     permissions
  Control  permission on the directories where                                • 2005/2008
  data will be read and written to                                               – Configured by default to not run under an 
                                                                                   administrator/system account
   – Data, log, backup, and replication snapshot                                 – Change using SQL Server Configuration Manager




                        Port Security                                                         Authentication Mode

• Block/filter ports SQL Server is listening on                               • Windows Authentication only (Integrated Security) or SQL Server 
                                                                                and Windows Authentication (Mixed‐Mode)
  perimeter devices                                                           • If able to, use Windows Authentication only (may not be possible 
       • 1433 (TCP) / 1434 (UDP)                                                depending upon the applications that will be connecting)
                                                                                 – Can take advantage of controls built into windows (AD, Group Policy, 
       • Default instance                                                          account policies,  groups, etc)
       • Any additional named instances will listen on a                         – B
                                                                                   Better management and auditing controls
                                                                                                           d di i           l
         different port                                                       • Mixed Mode (if you have to) recommendation
           – 2000 or less ‐ incremented default port by one for each             – Use SQL Accounts only for applications that don’t support Windows 
                                                                                   Authentication
             named instance
                                                                                 – Don’t use sa account for administration.  Assign long complex 
           – SQL Server 2005 and higher – uses SQL Browser service to              password and lock away.
             listen on 1434 UDP and direct requests to dynamically created       – Use Windows accounts with appropriate permissions for 
             ports                                                                 administration
       • Can be manually changed and set                                         – Take advantage of Windows password policies (2005/08 only)




          The Infamous “sa” account                                                 Auditing (more about setting up 
                                                                                         custom auditing later)
• All powerful SQL Server account
• Needs to be assigned a very strong password
                                                                              • By default no auditing is turned on
   – Especially if running in Mixed Mode since account cannot be disabled     • At a minimum turn on auditing for failed logon 
     or locked out
   – Should not be used.  Every administrator should have their own 
     administrator level account (preferably tied to the Windows account)
                                                                                attempts
   – Give it a long and complex password and put the password in a giant 
               l      d       l         d d         h          d                 –B tt t
                                                                                  Best to turn on for both failed and successful 
                                                                                                  f b th f il d d            f l
     lockbox (preferably not the one that houses the social security 
     deposits).                                                                   attempts
• 2005/08 – if Windows authentication is specified, the sa account is 
  disabled and a cryptographically random password is assigned.  This 
  prevents the re‐enabling  of the account without having to assign a 
  new password.  It also ensures that there is never a blank sa
  password (as was the case with some unpatched earlier versions)




                                                                                                                                                                  2
11/5/2009




        Disable unnecessary features
                                                                     Secure End Points
• Common dangerous and dangerous and/or                • All connections pass through end points
  unneeded services:                                   • Can create and configure new end‐points 
  – xp_cmdshell
                                                         (2005/08 only)
  – OPENROWSET & OPENDATASET
  – OLE Automation                                     • Can filter traffic by protocol and origination
                                                              fil      ffi b          l d i i i
  – SQL Mail (use Database Mail instead)                 – System (most common one that users will deal 
                                                           with. Created by default)
• Most can be managed through Surface 
  Configuration manager (2005)/Policy manger             – TCP (must be created)
  (2008) and sp_configure                                – HTTP (must be created)




         Secure End Points (cont.)                     TCP end point (default and custom)
• System end point                                     • Configurable options
  –   Shared Memory Protocol                             – Listening port
  –   Default TCP
                                                         – Listening IP address
  –   Named Pipes
  –   VIA                                                – Traffic encryption
                                                           Traffic encryption
  –   Dedicated Admin Connection ‐ DAC (specialized         • All login packets are by default encrypted.  All other 
      emergency admin access. Cannot be disabled)             traffic is not. 
                                                            • Requires certificate installed on server
• Only enable/create those that you need.  In most 
  production systems you need only TCP and               – Hide instance 
  Shared Memory.




       User Account management                               User Account management
• Manage groups not users                              • Filter all data access through Stored 
  – Assign all users to meaningful logical groups        Procedures
  – Assign permissions to groups                         – Finer control 
  – More robust and flexible
    More robust and flexible                             – Eliminates the need to give the user direct access
                                                           Eliminates the need to give the user direct access 
• Follow the principle of least privilege when             to the underlying tables and views
  managing users. Should only give users               • Take advantage of Schemas to control 
  privileges they need to do their job and               permissions.   
  nothing more (don’t be handing out sysadmin 
  or db owner privileges like there candy from a 
  Pez dispenser)




                                                                                                                               3
11/5/2009




     Schemas (the most under 
                                                                          Schemas (cont)
    appreciated security feature)
• Container of SQL objects (tables, views, stored    • Each object is a assigned to only one schema
  procedures, functions, etc).                       • Schemas if setup correctly can create valuable 
• Prior to 2005, schema = owner. 2005                  security boundaries
  decoupled the schema from the owner and 
  decoupled the schema from the owner and
  brought it closer to the ANSI standard
• Schemas are now separate from users. A user 
  can be assigned to more than one schema and 
  a schema can be assigned to more than one 
  user




             Schema example                                    Schema example (cont.)
Example:  Julie, John, and Jerry from the 
                                                         Accounting_Group
  accounting department need to have execute              Julie, Jim, and Jerry

  permissions on a group of stored procedures.  
  You could assign execute permission to the 
  You could assign execute permission to the                                            Accounting Schema
                                                                                        A     ti S h
  Accounting group (remember its best to work                                       db.Accounting.usp_getBalance
                                                                                    db.Accounting.usp_insertEntry
  with groups) on each individual stored                                            db.Accounting.usp_enterClient

  procedure.  Or you could assign all the needed 
  stored procedures to an “Accounting” schema        GRANT EXECUTE ON SCHEMA::Accounting TO 
  and just give the accounting group execute          Accounting_Group
  permission on the “Accounting” schema.




                                                          Permissions are hierarchical
                 Permissions
                                                                  (2005/08)
• Permissions can be assigned to “Securables”        • Instance level and database level permissions 
• Securable Hierarchy                                  are grouped into hierarchies.  Permissions 
  – Instance                                           lower in an assigned hierarchy are also 
  – Database
         b                                             granted (unless explicitly revoked)
                                                       granted (unless explicitly revoked)
  – Schemas                                          • Database level permission example:
  – Database Objects (tables, views, stored            – Create Table
    procedures, functions, etc)                           •   Insert
                                                          •   Update
• Permissions can be granted or revoked
                                                          •   Delete
                                                          •   Select




                                                                                                                           4
11/5/2009




     Column Level Encryption                                      Column Level Encryption Key 
  (warning: technical data ahead)                                         Hierarchy
• Starting with SQL Server 2005, column level                • Service Master Key
  encryption was supported                                      – Created automatically when SQL Server Instance first 
                                                                  started
• Any encryption strategy needs to be well                      – Should backup to a secure location before implementing 
  planed before implementing.  Good key 
  planed before implementing Good key                             data level encryption. 
                                                                  data level encryption
  management is a must or you may just end up                • Database Master Key
  locking your self out of your data.                           – Created manually for each database you want to encrypt 
                                                                  data items
                                                                – Not required but recommended 
                                                                – Encrypted by Service Master Key
                                                                – Should backup to a secure location before implementing 
                                                                  data level encryption. 




                                                                      Column Level Encryption 
  Column Data Encryption (Cont.)
                                                                            Continued
• Data Level Encryption Keys                                 Most common scenario when used:
  – Asymmetric Keys                                          An Asymmetric Key encrypted by a certificate is 
     • Single key for both encryption and decryption           used to encrypt desired data elements.  An 
     • Fast                                                    encryption function is created that is called 
                                                               encryption function is created that is called
     • Securing the key is an issue
                                                               within a stored procedure.
  – Asymmetric Key/Certificate
     • Two keys (Public and Private) are used 
     • Data encrypted by one key can only be decrypted by 
       the other and vice‐versa. 




      Database Level Encryption                               Database Level Encryption (Cont.)
• This column‐level encryption seems complex                 • Any data saved to EFS protected directories 
  and messy, why not just encrypt the entire                   would be encrypted. Encryption is at the 
  database when at rest?                                       directory level
• Prior to 2008 this could be done using EFS
  Prior to 2008 this could be done using EFS                    – Data moved out of protected directories would no
                                                                  Data moved out of protected directories would no 
  (make sure you have a domain EFS recovery                       longer be encrypted. 
  agent in place before doing this).  The                    • SQL Server 2008 to the rescue with 
  directories that housed the database and                     Transparent Data Encryption (TDE)
  backups (don’t forget the backups) need to                    – Encryption at the database level.
  have EFS enabled on them.                                     – Database encrypted with Database Master Key
                                                                – Backups automatically encrypted also




                                                                                                                                   5
11/5/2009




                        Auditing                                               Auditing (Cont.)
• DML (database manipulation language)                           • DDL (data definition Language) trigger
  Triggers                                                         – A cool feature introduced in SQL 2005 that allows 
    – Actions can be taken or recorded based on DML                  you to take action based on a DDL event (Create, 
      events (INSERT, UPDATE, DELETE, etc)
      events (INSERT UPDATE DELETE etc)                              Drop, Alter, etc).
                                                                         p,     , )
       • An example would be to create a DML Trigger that          – For example you could create a trigger that could 
         records writes to a special log table when, who, and        intercept a create table command, log who, when, 
         what data was modified in a designated table.               and what to a special log file, roll‐back the 
                                                                     transaction, and fire off an email.




                 Auditing (Cont.)                                                     Part 2
• SQL Server 2008 added two new auditing                         • Mitigating SQL Injection risks
  features                                                       • Securing SSIS, SSRS, and SSAS
    – Audit Object                                               • Scripting SQL Server (more PowerShell fun)
    – Identify a collection of actions to be tracked
      Identify a collection of actions to be tracked
    – Only available in Enterprise edition 
       • D*mn you Microsoft!
• Policy‐Based Management 
    – Replaces Surface Area Configuration Management
    – Can be configured to monitor and enforce a 
      baseline configuration




           Some useful resources
• SQL Server Books Online
• Google
• Microsoft SQL Server News groups
• How to Cheat at Securing Server 2005
• The Rational Guide to SQL Server 2005 
  Security
• Professional SQL Server 2008 Administration 




                                                                                                                            6

More Related Content

What's hot

KoprowskiT_SQLSatMoscow_WASDforBeginners
KoprowskiT_SQLSatMoscow_WASDforBeginnersKoprowskiT_SQLSatMoscow_WASDforBeginners
KoprowskiT_SQLSatMoscow_WASDforBeginners
Tobias Koprowski
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
Tobias Koprowski
 
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheCloudsKoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
Tobias Koprowski
 
The Spy Who Loathed Me - An Intro to SQL Server Security
The Spy Who Loathed Me - An Intro to SQL Server SecurityThe Spy Who Loathed Me - An Intro to SQL Server Security
The Spy Who Loathed Me - An Intro to SQL Server Security
Chris Bell
 
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBeganKoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
Tobias Koprowski
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
Peter Gfader
 
Log Analytics by VMware Log Insight
Log Analytics by VMware Log InsightLog Analytics by VMware Log Insight
Log Analytics by VMware Log Insight
Kiss Tibor
 
KoprowskiT_SQLSatHolland_SQLServerSecurityInTheCloud
KoprowskiT_SQLSatHolland_SQLServerSecurityInTheCloudKoprowskiT_SQLSatHolland_SQLServerSecurityInTheCloud
KoprowskiT_SQLSatHolland_SQLServerSecurityInTheCloud
Tobias Koprowski
 
SQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorld
SQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorldSQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorld
SQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorldPolish SQL Server User Group
 
BizTalk Server 2013 in Windows Azure IaaS
BizTalk Server 2013 in Windows Azure IaaSBizTalk Server 2013 in Windows Azure IaaS
BizTalk Server 2013 in Windows Azure IaaS
BizTalk360
 
KACE Endpoint Systems Management Appliances - What’s New for 2017
KACE Endpoint Systems Management Appliances - What’s New for 2017KACE Endpoint Systems Management Appliances - What’s New for 2017
KACE Endpoint Systems Management Appliances - What’s New for 2017
Quest
 
07 automate windowsenvironmentswithansibleanddsc
07 automate windowsenvironmentswithansibleanddsc07 automate windowsenvironmentswithansibleanddsc
07 automate windowsenvironmentswithansibleanddsc
Khairul Zebua
 
SQL ON Azure (decision-matrix)
SQL  ON  Azure (decision-matrix)SQL  ON  Azure (decision-matrix)
SQL ON Azure (decision-matrix)
PARIKSHIT SAVJANI
 
Oracle security 08-oracle network security
Oracle security 08-oracle network securityOracle security 08-oracle network security
Oracle security 08-oracle network security
Zhaoyang Wang
 
All about Kerberos In Microsoft BI
All about Kerberos In Microsoft BIAll about Kerberos In Microsoft BI
All about Kerberos In Microsoft BI
PARIKSHIT SAVJANI
 
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLAKoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
Tobias Koprowski
 
WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!
Maarten Smeets
 
Pvs slide
Pvs slidePvs slide
Pvs slide
Mohit Gupta
 
Oracle Audit vault
Oracle Audit vaultOracle Audit vault
Oracle Audit vault
uzzal basak
 
Azure Nights Melbourne July 2017 Meetup
Azure Nights Melbourne July 2017 MeetupAzure Nights Melbourne July 2017 Meetup
Azure Nights Melbourne July 2017 Meetup
Michael Frank
 

What's hot (20)

KoprowskiT_SQLSatMoscow_WASDforBeginners
KoprowskiT_SQLSatMoscow_WASDforBeginnersKoprowskiT_SQLSatMoscow_WASDforBeginners
KoprowskiT_SQLSatMoscow_WASDforBeginners
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheCloudsKoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
KoprowskiT_SQLRelayCaerdydd_SQLSecurityInTheClouds
 
The Spy Who Loathed Me - An Intro to SQL Server Security
The Spy Who Loathed Me - An Intro to SQL Server SecurityThe Spy Who Loathed Me - An Intro to SQL Server Security
The Spy Who Loathed Me - An Intro to SQL Server Security
 
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBeganKoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
Log Analytics by VMware Log Insight
Log Analytics by VMware Log InsightLog Analytics by VMware Log Insight
Log Analytics by VMware Log Insight
 
KoprowskiT_SQLSatHolland_SQLServerSecurityInTheCloud
KoprowskiT_SQLSatHolland_SQLServerSecurityInTheCloudKoprowskiT_SQLSatHolland_SQLServerSecurityInTheCloud
KoprowskiT_SQLSatHolland_SQLServerSecurityInTheCloud
 
SQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorld
SQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorldSQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorld
SQLDay2013_Denny Cherry - SQLServer2012inaHighlyAvailableWorld
 
BizTalk Server 2013 in Windows Azure IaaS
BizTalk Server 2013 in Windows Azure IaaSBizTalk Server 2013 in Windows Azure IaaS
BizTalk Server 2013 in Windows Azure IaaS
 
KACE Endpoint Systems Management Appliances - What’s New for 2017
KACE Endpoint Systems Management Appliances - What’s New for 2017KACE Endpoint Systems Management Appliances - What’s New for 2017
KACE Endpoint Systems Management Appliances - What’s New for 2017
 
07 automate windowsenvironmentswithansibleanddsc
07 automate windowsenvironmentswithansibleanddsc07 automate windowsenvironmentswithansibleanddsc
07 automate windowsenvironmentswithansibleanddsc
 
SQL ON Azure (decision-matrix)
SQL  ON  Azure (decision-matrix)SQL  ON  Azure (decision-matrix)
SQL ON Azure (decision-matrix)
 
Oracle security 08-oracle network security
Oracle security 08-oracle network securityOracle security 08-oracle network security
Oracle security 08-oracle network security
 
All about Kerberos In Microsoft BI
All about Kerberos In Microsoft BIAll about Kerberos In Microsoft BI
All about Kerberos In Microsoft BI
 
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLAKoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
KoprowskiT_SQLSat152_Bulgaria_HighAvailabilityOfSQLintheContextOfSLA
 
WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!
 
Pvs slide
Pvs slidePvs slide
Pvs slide
 
Oracle Audit vault
Oracle Audit vaultOracle Audit vault
Oracle Audit vault
 
Azure Nights Melbourne July 2017 Meetup
Azure Nights Melbourne July 2017 MeetupAzure Nights Melbourne July 2017 Meetup
Azure Nights Melbourne July 2017 Meetup
 

Similar to Sql Server Security Best Practices

Effective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database MirroringEffective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database Mirroringwebhostingguy
 
Sunil Kumar Thumma Resume
Sunil Kumar Thumma ResumeSunil Kumar Thumma Resume
Sunil Kumar Thumma Resumesunil thumma
 
Sunil Kumar Thumma Resume
Sunil Kumar Thumma ResumeSunil Kumar Thumma Resume
Sunil Kumar Thumma Resumesunil thumma
 
Weblogic Domain Activity
Weblogic Domain ActivityWeblogic Domain Activity
Weblogic Domain Activity
subash prakash
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
Novell
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
Novell
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
Novell
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
Novell
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
Novell
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_final
Joseph D'Antoni
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_final
Joseph D'Antoni
 
VMware Log Insight
VMware Log Insight VMware Log Insight
VMware Log Insight
Iwan Rahabok
 
Обзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorОбзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change Auditor
BAKOTECH
 
Обзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorОбзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change Auditor
Marina Gryshko
 
Lesson 5 security
Lesson 5   securityLesson 5   security
Lesson 5 security
Ram Kedem
 
Sql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday RichmondSql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday Richmond
Joseph D'Antoni
 
Sql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampaSql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampa
Joseph D'Antoni
 
Sql server 2012 ha and dr sql saturday dc
Sql server 2012 ha and dr sql saturday dcSql server 2012 ha and dr sql saturday dc
Sql server 2012 ha and dr sql saturday dc
Joseph D'Antoni
 
Ram Bhupal_SQLDBA
Ram Bhupal_SQLDBARam Bhupal_SQLDBA
Ram Bhupal_SQLDBArambhupal b
 

Similar to Sql Server Security Best Practices (20)

Effective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database MirroringEffective Usage of SQL Server 2005 Database Mirroring
Effective Usage of SQL Server 2005 Database Mirroring
 
Sunil Kumar Thumma Resume
Sunil Kumar Thumma ResumeSunil Kumar Thumma Resume
Sunil Kumar Thumma Resume
 
Sunil Kumar Thumma Resume
Sunil Kumar Thumma ResumeSunil Kumar Thumma Resume
Sunil Kumar Thumma Resume
 
Weblogic Domain Activity
Weblogic Domain ActivityWeblogic Domain Activity
Weblogic Domain Activity
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
 
Run Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin OrchestrateRun Book Automation with PlateSpin Orchestrate
Run Book Automation with PlateSpin Orchestrate
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_final
 
Sql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_finalSql server 2012 ha dr 24_hop_final
Sql server 2012 ha dr 24_hop_final
 
VMware Log Insight
VMware Log Insight VMware Log Insight
VMware Log Insight
 
Обзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorОбзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change Auditor
 
Обзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change AuditorОбзор и практическое применение Dell Change Auditor
Обзор и практическое применение Dell Change Auditor
 
Lesson 5 security
Lesson 5   securityLesson 5   security
Lesson 5 security
 
Sql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday RichmondSql Server 2012 HA and DR -- SQL Saturday Richmond
Sql Server 2012 HA and DR -- SQL Saturday Richmond
 
Sql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampaSql server 2012 ha and dr sql saturday tampa
Sql server 2012 ha and dr sql saturday tampa
 
Sql server 2012 ha and dr sql saturday dc
Sql server 2012 ha and dr sql saturday dcSql server 2012 ha and dr sql saturday dc
Sql server 2012 ha and dr sql saturday dc
 
Ram Bhupal_SQLDBA
Ram Bhupal_SQLDBARam Bhupal_SQLDBA
Ram Bhupal_SQLDBA
 
working with sql server agent-2
working with sql server agent-2working with sql server agent-2
working with sql server agent-2
 

More from Information Technology (20)

Web303
Web303Web303
Web303
 
SAN
SANSAN
SAN
 
SAN Review
SAN ReviewSAN Review
SAN Review
 
SQL 2005 Disk IO Performance
SQL 2005 Disk IO PerformanceSQL 2005 Disk IO Performance
SQL 2005 Disk IO Performance
 
RAID Review
RAID ReviewRAID Review
RAID Review
 
Review of SQL
Review of SQLReview of SQL
Review of SQL
 
Sql 2005 high availability
Sql 2005 high availabilitySql 2005 high availability
Sql 2005 high availability
 
IIS 7: The Administrator’s Guide
IIS 7: The Administrator’s GuideIIS 7: The Administrator’s Guide
IIS 7: The Administrator’s Guide
 
MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2MOSS 2007 Deployment Fundamentals -Part2
MOSS 2007 Deployment Fundamentals -Part2
 
MOSS 2007 Deployment Fundamentals -Part1
MOSS 2007 Deployment Fundamentals -Part1MOSS 2007 Deployment Fundamentals -Part1
MOSS 2007 Deployment Fundamentals -Part1
 
Clustering and High Availability
Clustering and High Availability Clustering and High Availability
Clustering and High Availability
 
F5 beyond load balancer (nov 2009)
F5 beyond load balancer (nov 2009)F5 beyond load balancer (nov 2009)
F5 beyond load balancer (nov 2009)
 
WSS 3.0 & SharePoint 2007
WSS 3.0 & SharePoint 2007WSS 3.0 & SharePoint 2007
WSS 3.0 & SharePoint 2007
 
SharePoint Topology
SharePoint Topology SharePoint Topology
SharePoint Topology
 
Sharepoint Deployments
Sharepoint DeploymentsSharepoint Deployments
Sharepoint Deployments
 
Microsoft Clustering
Microsoft ClusteringMicrosoft Clustering
Microsoft Clustering
 
Scalable Internet Servers and Load Balancing
Scalable Internet Servers and Load BalancingScalable Internet Servers and Load Balancing
Scalable Internet Servers and Load Balancing
 
Web Hacking
Web HackingWeb Hacking
Web Hacking
 
Migration from ASP to ASP.NET
Migration from ASP to ASP.NETMigration from ASP to ASP.NET
Migration from ASP to ASP.NET
 
Internet Traffic Monitoring and Analysis
Internet Traffic Monitoring and AnalysisInternet Traffic Monitoring and Analysis
Internet Traffic Monitoring and Analysis
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 

Recently uploaded (20)

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 

Sql Server Security Best Practices

  • 1. 11/5/2009 How do you ensure SQL Server is 100%  Secure? • Simple …….. You turn it off.  SQL Server Security Best • 100% security is not possible Practices • There are a number of best practices that you  Part 1 can take to make your SQL Server instance  k k SQ S i Fall 2009 Ohio Behavioral Health MIS  more secure Users Group • The goal is to harden your SQL Server in a way  Jody McCluggage that it discourages attackers (e.g. don’t be the  low hanging fruit) Overview Physical Security • The primary focus will be on 2005/08 • Server housing production SQL Server should  • Will mention some best practices for 97/2000  be secured and only accessible to those who  (but really, you should be using 2005/08 now) need access • This will be a high‐level overview.  If you have  hi ill b hi h l l i f h any questions on the details of anything in this  presentation, please let me know.  Can do a  follow‐up with all the gory details if enough  people are interested. Disclaimer and Warning Turn off/Disable any unnecessary  (Warning! Warning! Will Robinson) services • Use care and thoroughly think through and  • Turn off unnecessary services • 2005/2008 test before implementing any of the  – Most unnecessary services are turned off by default suggestions in this presentation.   – SQL Server Configuration Manager  – SQL Server Surface Area Configuration Manager (2005)/  Q g g ( )/ • I will not be held responsible if you break your I will not be held responsible if you break your  Policy manager (2008) system (and will probably deny even knowing  • 97/2000 you) – Services MMC snap‐in Administrator Tools • SQL Browser service is not needed if there is only a  default instance – Can also be disabled if you explicitly define and map ports  from application to named instances 1
  • 2. 11/5/2009 SQL Server Service Accounts SQL Server Service Accounts (cont.) • Run SQL services under a low privilege local  • Monitor services accounts for failed logons and  domain user account(s) account lockouts (account lockout will not prevent a  currently running SQL Server from running) • Do not run under the context of the local  • 97/2000 y , , ( p system, local administrator, or (heaven help  – Takes a little work but can be done Takes a little work but can be done you) a Domain Administrator account – May require changing some directory and registry  • Service account for SQL Server requires Full permissions Control  permission on the directories where  • 2005/2008 data will be read and written to – Configured by default to not run under an  administrator/system account – Data, log, backup, and replication snapshot – Change using SQL Server Configuration Manager Port Security Authentication Mode • Block/filter ports SQL Server is listening on  • Windows Authentication only (Integrated Security) or SQL Server  and Windows Authentication (Mixed‐Mode) perimeter devices • If able to, use Windows Authentication only (may not be possible  • 1433 (TCP) / 1434 (UDP)   depending upon the applications that will be connecting) – Can take advantage of controls built into windows (AD, Group Policy,  • Default instance account policies,  groups, etc) • Any additional named instances will listen on a  – B Better management and auditing controls d di i l different port  • Mixed Mode (if you have to) recommendation – 2000 or less ‐ incremented default port by one for each  – Use SQL Accounts only for applications that don’t support Windows  Authentication named instance – Don’t use sa account for administration.  Assign long complex  – SQL Server 2005 and higher – uses SQL Browser service to  password and lock away. listen on 1434 UDP and direct requests to dynamically created  – Use Windows accounts with appropriate permissions for  ports administration • Can be manually changed and set – Take advantage of Windows password policies (2005/08 only) The Infamous “sa” account Auditing (more about setting up  custom auditing later) • All powerful SQL Server account • Needs to be assigned a very strong password • By default no auditing is turned on – Especially if running in Mixed Mode since account cannot be disabled  • At a minimum turn on auditing for failed logon  or locked out – Should not be used.  Every administrator should have their own  administrator level account (preferably tied to the Windows account) attempts – Give it a long and complex password and put the password in a giant  l d l d d h d –B tt t Best to turn on for both failed and successful  f b th f il d d f l lockbox (preferably not the one that houses the social security  deposits). attempts • 2005/08 – if Windows authentication is specified, the sa account is  disabled and a cryptographically random password is assigned.  This  prevents the re‐enabling  of the account without having to assign a  new password.  It also ensures that there is never a blank sa password (as was the case with some unpatched earlier versions) 2
  • 3. 11/5/2009 Disable unnecessary features Secure End Points • Common dangerous and dangerous and/or  • All connections pass through end points unneeded services: • Can create and configure new end‐points  – xp_cmdshell (2005/08 only) – OPENROWSET & OPENDATASET – OLE Automation • Can filter traffic by protocol and origination fil ffi b l d i i i – SQL Mail (use Database Mail instead)  – System (most common one that users will deal  with. Created by default) • Most can be managed through Surface  Configuration manager (2005)/Policy manger  – TCP (must be created) (2008) and sp_configure – HTTP (must be created) Secure End Points (cont.) TCP end point (default and custom) • System end point • Configurable options – Shared Memory Protocol – Listening port – Default TCP – Listening IP address – Named Pipes – VIA – Traffic encryption Traffic encryption – Dedicated Admin Connection ‐ DAC (specialized  • All login packets are by default encrypted.  All other  emergency admin access. Cannot be disabled) traffic is not.  • Requires certificate installed on server • Only enable/create those that you need.  In most  production systems you need only TCP and  – Hide instance  Shared Memory. User Account management User Account management • Manage groups not users • Filter all data access through Stored  – Assign all users to meaningful logical groups Procedures – Assign permissions to groups – Finer control  – More robust and flexible More robust and flexible – Eliminates the need to give the user direct access Eliminates the need to give the user direct access  • Follow the principle of least privilege when  to the underlying tables and views managing users. Should only give users  • Take advantage of Schemas to control  privileges they need to do their job and  permissions.    nothing more (don’t be handing out sysadmin  or db owner privileges like there candy from a  Pez dispenser) 3
  • 4. 11/5/2009 Schemas (the most under  Schemas (cont) appreciated security feature) • Container of SQL objects (tables, views, stored  • Each object is a assigned to only one schema procedures, functions, etc). • Schemas if setup correctly can create valuable  • Prior to 2005, schema = owner. 2005  security boundaries decoupled the schema from the owner and  decoupled the schema from the owner and brought it closer to the ANSI standard • Schemas are now separate from users. A user  can be assigned to more than one schema and  a schema can be assigned to more than one  user Schema example Schema example (cont.) Example:  Julie, John, and Jerry from the  Accounting_Group accounting department need to have execute  Julie, Jim, and Jerry permissions on a group of stored procedures.   You could assign execute permission to the  You could assign execute permission to the Accounting Schema A ti S h Accounting group (remember its best to work  db.Accounting.usp_getBalance db.Accounting.usp_insertEntry with groups) on each individual stored  db.Accounting.usp_enterClient procedure.  Or you could assign all the needed  stored procedures to an “Accounting” schema  GRANT EXECUTE ON SCHEMA::Accounting TO  and just give the accounting group execute  Accounting_Group permission on the “Accounting” schema. Permissions are hierarchical Permissions (2005/08) • Permissions can be assigned to “Securables” • Instance level and database level permissions  • Securable Hierarchy are grouped into hierarchies.  Permissions  – Instance lower in an assigned hierarchy are also  – Database b granted (unless explicitly revoked) granted (unless explicitly revoked) – Schemas • Database level permission example: – Database Objects (tables, views, stored  – Create Table procedures, functions, etc) • Insert • Update • Permissions can be granted or revoked • Delete • Select 4
  • 5. 11/5/2009 Column Level Encryption Column Level Encryption Key  (warning: technical data ahead) Hierarchy • Starting with SQL Server 2005, column level  • Service Master Key encryption was supported – Created automatically when SQL Server Instance first  started • Any encryption strategy needs to be well  – Should backup to a secure location before implementing  planed before implementing.  Good key  planed before implementing Good key data level encryption.  data level encryption management is a must or you may just end up  • Database Master Key locking your self out of your data.   – Created manually for each database you want to encrypt  data items – Not required but recommended  – Encrypted by Service Master Key – Should backup to a secure location before implementing  data level encryption.  Column Level Encryption  Column Data Encryption (Cont.) Continued • Data Level Encryption Keys Most common scenario when used: – Asymmetric Keys An Asymmetric Key encrypted by a certificate is  • Single key for both encryption and decryption used to encrypt desired data elements.  An  • Fast encryption function is created that is called  encryption function is created that is called • Securing the key is an issue within a stored procedure. – Asymmetric Key/Certificate • Two keys (Public and Private) are used  • Data encrypted by one key can only be decrypted by  the other and vice‐versa.  Database Level Encryption Database Level Encryption (Cont.) • This column‐level encryption seems complex  • Any data saved to EFS protected directories  and messy, why not just encrypt the entire  would be encrypted. Encryption is at the  database when at rest? directory level • Prior to 2008 this could be done using EFS Prior to 2008 this could be done using EFS  – Data moved out of protected directories would no Data moved out of protected directories would no  (make sure you have a domain EFS recovery  longer be encrypted.  agent in place before doing this).  The  • SQL Server 2008 to the rescue with  directories that housed the database and  Transparent Data Encryption (TDE) backups (don’t forget the backups) need to  – Encryption at the database level. have EFS enabled on them. – Database encrypted with Database Master Key – Backups automatically encrypted also 5
  • 6. 11/5/2009 Auditing Auditing (Cont.) • DML (database manipulation language)  • DDL (data definition Language) trigger Triggers – A cool feature introduced in SQL 2005 that allows  – Actions can be taken or recorded based on DML  you to take action based on a DDL event (Create,  events (INSERT, UPDATE, DELETE, etc) events (INSERT UPDATE DELETE etc) Drop, Alter, etc). p, , ) • An example would be to create a DML Trigger that  – For example you could create a trigger that could  records writes to a special log table when, who, and  intercept a create table command, log who, when,  what data was modified in a designated table. and what to a special log file, roll‐back the  transaction, and fire off an email. Auditing (Cont.) Part 2 • SQL Server 2008 added two new auditing  • Mitigating SQL Injection risks features • Securing SSIS, SSRS, and SSAS – Audit Object • Scripting SQL Server (more PowerShell fun) – Identify a collection of actions to be tracked Identify a collection of actions to be tracked – Only available in Enterprise edition  • D*mn you Microsoft! • Policy‐Based Management  – Replaces Surface Area Configuration Management – Can be configured to monitor and enforce a  baseline configuration Some useful resources • SQL Server Books Online • Google • Microsoft SQL Server News groups • How to Cheat at Securing Server 2005 • The Rational Guide to SQL Server 2005  Security • Professional SQL Server 2008 Administration  6