Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Deny member of sysadmin user access to databases Expand / Collapse
Posted Tuesday, March 12, 2013 9:18 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 9:25 AM
Points: 361, Visits: 1,458
Hi, I am not sure if this is possible, but here goes.

Can a user who is a member of the sysadmin role have specific access rights revoked to restrict their access?

The problem I have is, we recently moved a number of databases from our 2005 instance to a new 2008 instance. One of the applications used a sql login which I configured and gave dbowner rights on its database and public rights on the server login. When the application was tested it kept failing with failed logins to SQL Server. After speaking with the application's support team they asked about the SQL Login and said the login should be a member of the sysadmin server role. I said I didn't want it to be as it is a security risk to our database server which is used by lots of other applications. I asked if they could tell me what specific rights the login needed, but they didn't know, only that it needed sysadmin rights. For the minute I have given it sysadmin rights and the application is working fine.

Obviously, I would like to restrict this user a bit, but it is difficult to know what rights it requires as the application company wont/cant tell me. Can you give a login sysadmin roles, but revoke access to the login for certain databases?

Any help would be great.
Post #1429894
Posted Tuesday, March 12, 2013 9:24 AM



Group: General Forum Members
Last Login: Yesterday @ 2:52 PM
Points: 20,083, Visits: 18,257
No. You cannot prevent sa from accessing the databases through permissions.

Jason AKA CirqueDeSQLeil
I have given a name to my pain...


Posting Performance Based Questions - Gail Shaw
Post #1429898
Posted Tuesday, March 12, 2013 9:33 AM

Keeper of the Duck

Keeper of the Duck

Group: Moderators
Last Login: Friday, September 16, 2016 11:44 AM
Points: 6,639, Visits: 1,905
In this scenario you would want to look at setting up a separate database instance. You could even run on the same server.

K. Brian Kelley, CISA, MCSE, Security+, MVP - SQL Server
Regular Columnist (Security),
Author of Introduction to SQL Server: Basic Skills for Any SQL Server User
| Professional Development blog | Technical Blog | LinkedIn | Twitter
Post #1429904
Posted Friday, March 15, 2013 3:14 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, January 5, 2015 10:15 AM
Points: 1, Visits: 28

I would like to know what is the user's role .. basically on that particular db what the user does?? We don't prefer giving sysadmin rights to everyone .
I advice you if a user executing,reading, writing ,give him individual access else create a separate database , name it with different name,keep updating the data depending on the user requirement and give them complete rights.

Let me know if you got any other solution.

Post #1431786
Posted Wednesday, March 20, 2013 3:37 AM


Group: General Forum Members
Last Login: Today @ 10:53 AM
Points: 453, Visits: 825
You have fallen into a trap that I did some time ago. At least that is how it sounds.

A software vendor says "I need sysadmin/db_owner" or this software won't run"! I gave them those rights and ended up having to explain why one of them deleted a database they shouldn't have. Embarassing.

Now I ask the vendors what their application user needs to do and use a strict policy based on the application of minimum privilege. They don't like it (especially as most of the vendors don't really know what level of permission their user really needs!) and it makes me unpopular with some developers but then, they aren't the ones that have to pick up the pieces when they make a mistake.

The 'sa' account, sysadmin fixed server role and db_owner fixed database role should never be given out where it isn't strictly needed simply because they can do absolutely everything and privileges cannot be revoked from any of them.

It is always better to create a tailored account even if it means spending time on the phone treaking it until it does exactly what it is supposed to.
Post #1433089
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse