A Question about SQL Server Security When Building Client-Server Applications.

I have a client-server application that uses SQL Server 2k as the backend. One of the things that I have done successfully is to require that all applications access the database via stored procedures. I don't have any grant permissions on any tables, views, or functions. I have already blogged about the problems with having a dbo as a user and enforcing row-level security, so none of my application user contexts are dbo's--at least until today.

I want members of a certain role to be able to manage which users are able to access the database via the application. I've built an ASP .NET Page that provides the UI for adding/removing users, setting their roles, etc.. The problem is that since my application-level 'admin' role is not in fact a dbo, it cannot execute the SQL 2k stored procedures to add/remove login/users to the database.

For now I've created a special login and added it to the securityadmin server role and set it up as a dbo to get around this problem. My question for the community is this: is there a way to allow my app to add and remove users using SQL Server Security and without knowing the login of a dbo, perhaps through a stored procedure? Can I create a role or something with those kind of permissions that is still not a dbo?

Comments

# re: A Question about SQL Server Security When Building Client-Server Applications.

Saturday, March 19, 2005 12:13 AM by Robert Hurlbut

I believe SQL Server 2005 is set to address some of these issues in a better way (from what I have seen so far).

In the meantime, if you look at, for example, the stored procedure sp_addlogin in the Master database, you will see it immediately checks if the user calling the procedure is a member of the SQL Server role "dbo". So, this is a restriction placed with inside the procedure which you can't get around short of changing the default Master procedures (not advisable).

# re:A Question about SQL Server Security When Building Client-Server Applications.

Sunday, April 10, 2005 2:57 AM by TrackBack

^_^,Pretty Good!

Leave a Comment

(required) 
(required) 
(optional)
(required)