join the MSSQLTips community

Today's Site Sponsor


 

SQL Compare quickly and easily compares and synchronizes SQL Server database schemas
 



SQL Server permissions and security auditing: Idera SQL secure

Security Issues with the SQL Server BUILTIN\Administrators Group

Written By: Jeremy Kadlec -- 7/31/2006 -- read/post comments -- print -- Bookmark and Share

Rating: (not rated yet) Rate

Problem
The principal of least privileges is a cornerstone to most security implementations.  The premise behind the principal is to only grant users, developers, DBAs, network administrators, etc. the needed rights and nothing more.  If additional rights are required, evaluate the rights and grant the access accordingly.

With SQL Server 2000 and 2005 one area that does not seem to follow this principal is related to the default rights for the BUILTIN\Administrators group.  By default this group has SQL Server System Administrator rights to SQL Server when it is installed.  The same level of default rights are also granted to BUILTIN\Administrators group in SQL Server 2005 during the installation.  What this means is that any account in the Windows Local Administrators group has SQL Server System Administrator rights.

Solution
The BUILTIN\Administrators can easily be removed from SQL Server to prevent this security issue, but heed the warnings below prior to removing the group from SQL Server.

What steps should I take prior to considering removing this group?

  1. Verify that you know the "sa" password by logging into the SQL Server with the "sa" account with either Query Analyzer or Management Studio on the SQL Server you want to modify.
  2. Validate other Windows groups or Windows logins are assigned SQL Server System Administrator rights on this SQL Server.
  3. Review the rights assigned to the BUILTIN\Administrators group.
  4. Research the members of the Windows Local Administrators group.
  5. Figure out if an additional group should be created in Active Directory and assigned rights in SQL Server or if specific logins should be assigned rights to SQL Server.
  6. If necessary, create the additional logins and groups in Active Directory and assign rights in SQL Server to ensure a minimum of 1 login and/or the "sa" login has SQL Server System Administrator rights.
  7. Validate that the members of the BUILTIN\Administrators group do not own any databases, objects, Jobs, etc and that none of the logins are connected to SQL Server.
  8. If any of these steps were not completed, repeat the needed steps.  If all of these steps have been followed and you are confident that removing the BUILTIN\Administrators group will not cause any issues proceed to the next set of directions.

*** NOTE *** - Do not remove the BUILTIN\Administrators group from SQL Server if other logins or groups do not have SQL Server System Administrator rights or if you do not know the "sa" password.

With all of that being said, how do I remove the BUILTIN\Administrators group?

Method Directions
SQL Server 2000
T-SQL Commands
USE MASTER
GO
exec sp_revokelogin N'BUILTIN\Administrators'
GO
 

OR

SQL Server 2000
Enterprise Manager
  1. Open Enterprise Manager.
  2. Navigate to the Security folder.
  3. Double click on the Logins icon, which will load the SQL Server logins and groups in the right pane.
  4. Locate the BUILTIN\Administrators group.
  5. Right click on the BUILTIN\Administrators group and select the 'Delete' option.
  6. On the subsequent screen, read the message and if you agree press 'Yes' to remove the group.
  7. Refresh the pane to verify the group has been dropped.
 
Method Directions
SQL Server 2005   
T-SQL Commands
DROP LOGIN [BUILTIN\Administrators]

OR

SQL Server 2005
Management Studio
  1. Open Management Studio.
  2. Navigate to the Security folder.
  3. Expand (+) the Logins folder, which will load the SQL Server logins and groups in the right pane.
  4. Locate the BUILTIN\Administrators group.
  5. Right click on the BUILTIN\Administrators group and select the 'Delete' option.
  6. On the subsequent screen, review the screen and if you agree press 'OK' to remove the login.
  7. Refresh the pane to verify the login has been dropped.

Next Steps

  • Review some of your key SQL Servers to determine if the BUILTIN\Administrators Group has the default System Administrator rights in SQL Server.
  • Talk with your team members about this security change and others to ensure these types of changes make sense in your environment.
  • Work towards building a solidified process to secure your SQL Servers as you deploy them to meet the organizational needs.
  • Stay tuned for more simple steps to secure your SQL Servers...
Readers Who Read This Tip Also Read Free Live Webcast Comment or Ask Questions About This Tip



Get Our Tips Newsletter

We keep 50,000+ SQL Server professionals informed.



Idera - SQL secure

Idera SQL secure collects and analyzes permissions data from SQL Server and Active Directory as well as the file system and registry to show who has access to what database objects and how that access is granted. SQL secure also monitors changes made to access rights so that unapproved changes can be easily identified and fixed. SQL secure also collects and evaluates key security settings within SQL Server and provides proactive recommendations to improve server security.

Download now!

More SQL Server Tools
SQL safe backup

SQL Prompt

SQL Data Generator

SQL defrag manager

SQL compliance manager


Sponsor Information
Free SQL Server performance monitoring dashboard – Idera SQL check

Realistic test data in just one click with SQL Data Generator.

SQL Server Issues? Not sure where to turn for answers? Innovative SQL DBA consultants

Looking for SQL Server interview questions and answers?

Free whitepaper - Top 10 Things You Should Know About Optimizing SQL Server Performance



Copyright (c) 2006-2010 Edgewood Solutions, LLC All rights reserved
privacy statement | disclaimer | copyright | advertise | write for mssqltips | feedback | about
Some names and products listed are the registered trademarks of their respective owners.


CareerQandA.com | MSSharePointTips.com | MSSQLTips.com