Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    « Derived Column and the Data Flow TaskT-SQL To find Out If An Index Is Clustered Or Non Clustered »
    comments

    The question was raised again if SA should be disabled. First, it doesn't matter if you do not utilize SQL Server Authentication. The account is then disabled in the first place. Most instances have mixed mode enabled however so SA is a major concern and a huge pet peeve of mine.

    So to put it lightly...

    I want to get some things out of the way first that I believe in and go about while having SA on my database servers

    1. I think sa is a good thing and should be left as such provided you handle it
    2. If the password goes beyond the DBA you should lose your fingers
    3. Passwords for sa should be changed at a minimum of bi-weekly
    4. The sa account should not be the all mighty saving grace

    I’ll dive into those points starting with leaving SA on the instance at all. First note that in 2005 we were giving the ability to rename Mr. SA. It’s rather nice actually if you have to expose an instance to a DMZ

    This is how…

    1. ALTER LOGIN sa DISABLE;
    2. ALTER LOGIN sa WITH NAME = IAMGOD;
    3. ALTER LOGIN IAMGOD ENABLE;

    The first problem is that SA is an account recognized by the SQL Server team as a systems admin. Now I know in the last few version of SQL Server SA was not utilized. At least from my upgrade experience, I never saw it referenced. That being said it should not be required. I still have it in the back of my head there is no reason not to leave it there “just in case”. That brings us to handling it though.

    How many times have you seen this connection string?

    1. Provider=SQLNCLI10;Server=(local);Database=master;Uid=sa; Pwd=youbloodyidiot;

    That’s just wrong people! Let me ask this question. Is the application you decided needed SA in the connection strings a DBA? Even the applications I write to get me the one button click maintenance do not connect with SA. And I am the DBA! That alone should tell you the connection is really bad.

    So what are the best practices for handling the SA account? I’ve always been frustrated that BOL never really hard a hardened best practice. At least I’ve never read on in the release of best practices on each version of SQL Server

    Check 2008 here: http://msdn.microsoft.com/en-us/library/dd283095.aspx

    I just told you to leave SA alone basically and have it enabled. A lot of DBAs are going to disagree with me on that and I hope they put their arguments here in the comments. The SA account always makes for interesting conversation. Sense I just told you to leave SA alone however, you MUST handle that god like account. Handling it on my instances is pretty straight forward.

    First, Active Directory group setup for the DBAs is the only ones that have access to the password for SA which is held securely in the password manager. See here for storing critical and sensitive passwords

    http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/securing-you-password-for-sql-server-200

    So now that I got it out that only the DBAs should at any time be able to access sa in any way shape or form, what about the password?

    Here is how I’ve handled SA and its password in my career. Bi-weekly (every two weeks) I have a process that calls a password generator to create an extremely strong password. This process first updates the encrypted password in the place they are stored and then resets the SA accounts actual password to the new one.

    That does a few things for you. First it resets the password frequently enough it is less likely to be compromised. Two, if it is somehow used by some person that you trusted with your life, whatever they used it on will break. I love that moment when it does to ;-) Out come the lashes with a wet noodle!

    Last point I wanted to talk about is the fact that SA should never be the account you go to in order to save your ass. Yes, I really meant to be that direct on that statement. You as a DBA are in charge of securing the database servers. That means you have to secure your path into them for disasters and recovery points as well. This means the thought process must be handled of a complete loss of active directory and most accounts that would be typical or default to SQL Server. The SA account is default and that being said can be a point of disaster itself. In the least you should have an account on SQL Authentication that you can utilize for single user controls or dedicated admin connections. Trust me from experience of having these things break. You don’t want to be google'ing, “How do I recover the sa password”

    Happy is the DBA that protects from disaster!

    About the Author

    Ted Krueger is a SQL Server MVP and has been working in development and database administration for 13+ years. Specialties range from High Availability and Disaster / Recovery setup and testing methods down to custom assembly development for SQL Server Reporting Services. Ted blogs and is also one of the founders of LessThanDot.com technology community. Some of the articles focused on are Backup / Recovery, Security, SSIS and working on SQL Server and using all of the SQL Server features available to create stable and scalable database services. @onpnt
    Social SitingsTwitterLinkedInLTD RSS Feed
    4442 views
    Instapaper

    9 comments

    Comment from: SQLDenis [Member] Email
    SQLDenis At least you need a password now for sa back in the 2000/msde days you could leave it blank.....then the slammer worm hit and service pack 3a came along that fixed that
    10/07/09 @ 07:26
    Comment from: Ted Krueger (onpnt) [Member]
    Ted Krueger (onpnt) Oh man that used to make me SO mad!!!!
    10/07/09 @ 07:27
    Comment from: SQLDenis [Member] Email
    SQLDenis At least you would know what the password was....no need to guess :-)
    10/07/09 @ 07:32
    Comment from: Jason Strate [Visitor] Email · http://feeds.feedburner.com/stratesql
    *****
    Jason Strate Good post. I prefer to disable the sa account. If needed, I'll create a similar account with a different name and leave it for extreme emergency access. Of course, the password is typically know only by the person that sets it. And a copy of the password kept in a safe or other secured location in the event the account is needed. Like when there is only a single DBA and the DBA is on vacation and something that requires sysadmin access comes up.
    10/08/09 @ 13:09
    Comment from: Ted Krueger (onpnt) [Member]
    Ted Krueger (onpnt) Thanks Jason!
    10/08/09 @ 13:17
    Comment from: alex [Visitor]
    ****-
    alex let's not forget the folks that use 'sa' in the sql agent jobs as the owner.

    and then you change the 'sa' password.
    10/10/09 @ 05:46
    Comment from: Steve B. [Visitor] · http://www.dsafutures.com
    *****
    Steve B. In it's current incarnation, SQL Server no longer requires an SA account. There are those of us who like it there because it's familiar, but it's really not needed any more.

    Why shouldn't it it be used for application logins, developers, or other users ?

    I submit the reasons are obvious. Just like I wouldn't share out the password for my personal privileged account, the SA account should be treated the same way, period.
    10/11/09 @ 06:40
    Comment from: Jack Richins [Visitor] · http://blogs.msdn.com/sqlsecurity
    ****-
    Jack Richins What about SYSADMINs? I'm not aware of anything SA can do that SYSADMINs can't - other than being a default account that everyone assumes exists (which maybe part of the reason for the SQL Agent Job ownership). So do you make all your DBAs SYSADMINs?
    10/12/09 @ 10:02
    Comment from: Ted Krueger (onpnt) [Member]
    Ted Krueger (onpnt) Interesting question Jack. I think that is the next level of conversation on the topic though. Sense sysadmin is a role and sa is a login they are slighly apart from each other. The reason sa and sysadmin can do the same is sa is typically in sysadmin. This is the same as the first thing you do is remove BUILTIN\ADMINs from the sysadmin role. If you don't. domain admins typically can do whatever they want. scary stuff. The DBA question is also a good one. Team settign DBA would only be sysadmin on what they are in charge of. There would be a trust level here to overap that. If you can't trust your DBAs then who can you trust to secure and keep the data available :-)

    And yes, the sa on jobs drives me nuts also.
    10/12/09 @ 14:08

    Leave a comment


    Your email address will not be revealed on this site.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)