Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

SQL Security Best Practices - Dealing With User Name Changes Expand / Collapse
Author
Message
Posted Monday, January 14, 2013 4:52 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 3:07 PM
Points: 2,194, Visits: 3,304
opc.three (1/14/2013)
YSLGuru (1/14/2013)
opc.three (1/12/2013)
AD Groups as SQL Logins and Database Users work great unless you need the User to have a default schema. In SQL 2012 the loop has been closed, but this is a 2008 forum.

@YSLGuru, I would look to rename them so they match the person's new name. Last name changes are pretty common and I rename Database Users and Server Logins all the time to keep up. Are you storing the Database User name in any audit tables? If the Database User name is used to maintain an audit trail then you may have a bit more to consider.


The schema that the app assumes for everything is 'dbo'.

If by 'assume' you meant that the app does not schema-qualify all object references and instead relies heavily on the default schema setup for each Database User then moving to AD Groups will not work for you until you move to SQL 2012.



I don't think that's true. While you cannot assign a default schema to the login, you can to the user. You just have to set it to "dbo" for each db for that group instead of at the login level.


SQL DBA,SQL Server MVP('07, '08, '09)

Carl Sagan said: "There is no such thing as a dumb question." Sagan obviously never watched a congressional hearing!
Post #1406986
Posted Monday, January 14, 2013 5:14 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:06 PM
Points: 7,125, Visits: 12,720
ScottPletcher (1/14/2013)
opc.three (1/14/2013)
YSLGuru (1/14/2013)
opc.three (1/12/2013)
AD Groups as SQL Logins and Database Users work great unless you need the User to have a default schema. In SQL 2012 the loop has been closed, but this is a 2008 forum.

@YSLGuru, I would look to rename them so they match the person's new name. Last name changes are pretty common and I rename Database Users and Server Logins all the time to keep up. Are you storing the Database User name in any audit tables? If the Database User name is used to maintain an audit trail then you may have a bit more to consider.


The schema that the app assumes for everything is 'dbo'.

If by 'assume' you meant that the app does not schema-qualify all object references and instead relies heavily on the default schema setup for each Database User then moving to AD Groups will not work for you until you move to SQL 2012.



I don't think that's true. While you cannot assign a default schema to the login, you can to the user. You just have to set it to "dbo" for each db for that group instead of at the login level.

From 2008 R2 BOL:

DEFAULT_SCHEMA cannot be specified when you are creating a user mapped to a Windows group, a certificate, or an asymmetric key.


Try it out though. You get an error when trying to set a default schema for a Database User based on a Login created from a Windows Group on 2008 R2 or below.

USE test
CREATE USER [DOMAIN\MyGroup] FROM LOGIN [DOMAIN\MyGroup] WITH DEFAULT_SCHEMA = [dbo];

Msg 15259, Level 16, State 1, Line 2
The DEFAULT_SCHEMA clause cannot be used with a Windows group or with principals mapped to certificates or asymmetric keys.


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1406989
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse