|
|
|
Keeper of the Duck
Group: Moderators
Last Login: Today @ 1:55 PM
Points: 6,584,
Visits: 1,789
|
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Monday, February 11, 2008 6:54 PM
Points: 469,
Visits: 3
|
|
Fair coverage of the issues. We're in the process of creating a new system running on SQL Server and ARs are the only way I could see to sensibly enforce security. We've hit the issue of cross-database access, but in a way it was good as the developer was calling xp_cmdshell which was going to introduce more problems than it solved.
SJT
SJT
|
|
|
|
|
Keeper of the Duck
Group: Moderators
Last Login: Today @ 1:55 PM
Points: 6,584,
Visits: 1,789
|
|
The issue with cross-database access also applies to cross-database ownership chaining with respect to valid users. If a login doesn't have a valid user in a second database (and guest isn't enabled), they'll still be blocked. So it shows up again and again in the SQL Server security model.xp_cmdshell? *shudder* There is a reason it's not given out by default.
K. Brian Kelley, CISA, MCSE, Security+, MVP - SQL Server Regular Columnist (Security), SQLServerCentral.com Author of Introduction to SQL Server: Basic Skills for Any SQL Server User | Professional Development blog | Technical Blog | LinkedIn | Twitter
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Tuesday, September 11, 2012 1:10 PM
Points: 649,
Visits: 201
|
|
We hit another “gotcha” with connection pooling with a web application a long time back.
The ASPs called a DLL that uses SQL authentication (I know, I know) to access the database. We implement all database access through stored procedures, but there was this one routine where the developer decided to build and submit a SELECT statement within a stored procedure. Rather than harass him to do it differently I set up an application role with access rights to support the query, and the application acitvated the role if and as necessary.
This, however, messed up other ASP pages, as the application role didn’t have execute stored procedure rights (as I am always harsh over database access privileges), but it took a while to figure out. Say we had 20 connections open in the pool to support the web site; at any point in time, 0 to 20 of them could be working under the context of this application role, and this status is “undetectable” by the pool manager. It’d assign a connection based on server, login, database (and/or whatever else), but was completely unaware of application role status, resulting in a connection being assigned with inappropriate rights.
In the end I dumped the application role and harassed the developer to change his code. If there were a way to “undo” or roll back the application role setting, this would not have been a problem.
Philip
|
|
|
|
|
Keeper of the Duck
Group: Moderators
Last Login: Today @ 1:55 PM
Points: 6,584,
Visits: 1,789
|
|
quote: In the end I dumped the application role and harassed the developer to change his code. If there were a way to “undo” or roll back the application role setting, this would not have been a problem.
I agree wholeheartedly. While a simple stored procedure can reset client settings, nothing exists to reset an app role back to the base user. Not sure why as it would make resource pooling more friendly.
K. Brian Kelley, CISA, MCSE, Security+, MVP - SQL Server Regular Columnist (Security), SQLServerCentral.com Author of Introduction to SQL Server: Basic Skills for Any SQL Server User | Professional Development blog | Technical Blog | LinkedIn | Twitter
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 3:26 PM
Points: 31,425,
Visits: 13,738
|
|
Nicely written Brian and shares many of my same views. I've tended to handle inappropriate access (like not using the applicaiton) administratively. A chewing out, a writeup, or a termination if people see the need to use Access or some other tool to change data.
However, I'm curious about a couple things. What if you used a "shared login" for all users that had minimal right before invoking the app role? Would that eliminate one of the cons?
Also, for pooling issues, an app could potentially just hold a connection open. For quite a few client/server apps, this might make sense. Alternatively, you could set a semaphore of some sort in the app when the role is invoked and not reissue "sp_setapprole" if the semaphore is set. A simple check could determine "which role" you had.
Lastly, not sure the server roles item applies for this. The apps where we want to prevent access wouldn't usually have server roles for someone. There are exceptions, but not sure they're enough to mark this as a "con", more as an FYI.
Again, great article.
Steve Jones sjones@sqlservercentral.com http://www.sqlservercentral.com/columnists/sjones www.dkranch.net
Follow me on Twitter: @way0utwest
 Forum Etiquette: How to post data/code on a forum to get the best help
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Yesterday @ 9:05 AM
Points: 163,
Visits: 356
|
|
quote: I'll try and be fair and balanced in this article, but I've provided this disclaimer in case I'm not.
I think Fox News will be starting another lawsuit because you used the phrase "fair and balanced." First Al Franken, now Brian Kelley...
|
|
|
|
|
Keeper of the Duck
Group: Moderators
Last Login: Today @ 1:55 PM
Points: 6,584,
Visits: 1,789
|
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:17 AM
Points: 6,862,
Visits: 8,049
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 8:12 AM
Points: 2,554,
Visits: 7,209
|
|
We're thinking of using application roles, but I don't quite get how to give it permissions. We currently have a sql login that's being used & abused. It has dbo access, and I want to use an app role that also has dbo access so that it can create work tables via an application. I can see how to grant access to specific tables and SPs, but I don't want to have to manually manage specific objects. What am I missing ?
|
|
|
|