Deny member of sysadmin user access to databases

  • 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.

  • No. You cannot prevent sa from accessing the databases through permissions.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • 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
    @kbriankelley

  • Hi,

    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.

    Thanks,

    Swathi

  • 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.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply