Microsoft SQL Server 2005: Security Configuration Benchmark For
Microsoft SQL Server 2005: Security Configuration Benchmark For
Leader:
Mike Taber
Moon River Consulting, Inc.
1|Page
Terms of Use Agreement
Background.
CIS provides benchmarks, scoring tools, software, data, information, suggestions, ideas, and other
services and materials from the CIS website or elsewhere (“Products”) as a public service to
Internet users worldwide. Recommendations contained in the Products (“Recommendations”)
result from a consensus-building process that involves many security experts and are generally
generic in nature. The Recommendations are intended to provide helpful information to
organizations attempting to evaluate or improve the security of their networks, systems and
devices. Proper use of the Recommendations requires careful analysis and adaptation to specific
user requirements. The Recommendations are not in any way intended to be a “quick fix” for
anyone’s information security needs.
CIS makes no representations, warranties or covenants whatsoever as to (i) the positive or negative
effect of the Products or the Recommendations on the operation or the security of any particular
network, computer system, network device, software, hardware, or any component of any of the
foregoing or (ii) the accuracy, reliability, timeliness or completeness of any Product or
Recommendation. CIS is providing the Products and the Recommendations “as is” and “as
available” without representations, warranties or covenants of any kind.
User agreements.
By using the Products and/or the Recommendations, I and/or my organization (“we”) agree and
acknowledge that:
No network, system, device, hardware, software or component can be made fully secure;
We are using the Products and the Recommendations solely at our own risk;
We are not compensating CIS to assume any liabilities associated with our use of the Products or
the Recommendations, even risks that result from CIS’s negligence or failure to perform;
We have the sole responsibility to evaluate the risks and benefits of the Products and
Recommendations to us and to adapt the Products and the Recommendations to our particular
circumstances and requirements;
Neither CIS, nor any CIS Party (defined below) has any responsibility to make any corrections,
updates, upgrades or bug fixes or to notify us if it chooses at it sole option to do so; and
Neither CIS nor any CIS Party has or will have any liability to us whatsoever (whether based in
contract, tort, strict liability or otherwise) for any direct, indirect, incidental, consequential, or
special damages (including without limitation loss of profits, loss of sales, loss of or damage to
reputation, loss of customers, loss of software, data, information or emails, loss of privacy, loss of
use of any computer or other equipment, business interruption, wasted management or other staff
resources or claims of any kind against us from third parties) arising out of or in any way connected
with our use of or our inability to use any of the Products or Recommendations (even if CIS has
been advised of the possibility of such damages), including without limitation any liability
associated with infringement of intellectual property, defects, bugs, errors, omissions, viruses,
worms, backdoors, Trojan horses or other harmful items.
2|Page
CIS hereby grants each user the following rights, but only so long as the user complies with all of the
terms of these Agreed Terms of Use:
Except to the extent that we may have received additional authorization pursuant to a written
agreement with CIS, each user may download, install and use each of the Products on a single
computer;
Each user may print one or more copies of any Product or any component of a Product that is in a
.txt, .pdf, .doc, .mcw, or .rtf format, provided that all such copies are printed in full and are kept
intact, including without limitation the text of this Agreed Terms of Use in its entirety.
The Products are protected by copyright and other intellectual property laws and by international
treaties. We acknowledge and agree that we are not acquiring title to any intellectual property
rights in the Products and that full title and all ownership rights to the Products will remain the
exclusive property of CIS or CIS Parties. CIS reserves all rights not expressly granted to users in the
preceding section entitled “Grant of limited rights.” Subject to the paragraph entitled “Special
Rules” (which includes a waiver, granted to some classes of CIS Members, of certain limitations in
this paragraph), and except as we may have otherwise agreed in a written agreement with CIS, we
agree that we will not (i) decompile, disassemble, reverse engineer, or otherwise attempt to derive
the source code for any software Product that is not already in the form of source code; (ii)
distribute, redistribute, encumber, sell, rent, lease, lend, sublicense, or otherwise transfer or exploit
rights to any Product or any component of a Product; (iii) post any Product or any component of a
Product on any website, bulletin board, ftp server, newsgroup, or other similar mechanism or
device, without regard to whether such mechanism or device is internal or external, (iv) remove or
alter trademark, logo, copyright or other proprietary notices, legends, symbols or labels in any
Product or any component of a Product; (v) remove these Agreed Terms of Use from, or alter these
Agreed Terms of Use as they appear in, any Product or any component of a Product; (vi) use any
Product or any component of a Product with any derivative works based directly on a Product or
any component of a Product; (vii) use any Product or any component of a Product with other
products or applications that are directly and specifically dependent on such Product or any
component for any part of their functionality, or (viii) represent or claim a particular level of
compliance with a CIS Benchmark, scoring tool or other Product. We will not facilitate or otherwise
aid other individuals or entities in any of the activities listed in this paragraph.
We hereby agree to indemnify, defend and hold CIS and all of its officers, directors, members,
contributors, employees, authors, developers, agents, affiliates, licensors, information and service
providers, software suppliers, hardware suppliers, and all other persons who aided CIS in the
creation, development or maintenance of the Products or Recommendations (“CIS Parties”)
harmless from and against any and all liability, losses, costs and expenses (including attorneys' fees
and court costs) incurred by CIS or any CIS Party in connection with any claim arising out of any
violation by us of the preceding paragraph, including without limitation CIS’s right, at our expense,
to assume the exclusive defense and control of any matter subject to this indemnification, and in
such case, we agree to cooperate with CIS in its defense of such claim. We further agree that all CIS
Parties are third-party beneficiaries of our undertakings in these Agreed Terms of Use.
Special rules.
CIS has created and will from time to time create special rules for its members and for other
persons and organizations with which CIS has a written contractual relationship. Those special
rules will override and supersede these Agreed Terms of Use with respect to the users who are
covered by the special rules. CIS hereby grants each CIS Security Consulting or Software Vendor
Member and each CIS Organizational User Member, but only so long as such Member remains in
good standing with CIS and complies with all of the terms of these Agreed Terms of Use, the right to
3|Page
distribute the Products and Recommendations within such Member’s own organization, whether by
manual or electronic means. Each such Member acknowledges and agrees that the foregoing grant
is subject to the terms of such Member’s membership arrangement with CIS and may, therefore, be
modified or terminated by CIS at any time.
We acknowledge and agree that these Agreed Terms of Use will be governed by and construed in
accordance with the laws of the State of Maryland, that any action at law or in equity arising out of
or relating to these Agreed Terms of Use shall be filed only in the courts located in the State of
Maryland, that we hereby consent and submit to the personal jurisdiction of such courts for the
purposes of litigating any such action. If any of these Agreed Terms of Use shall be determined to be
unlawful, void, or for any reason unenforceable, then such terms shall be deemed severable and
shall not affect the validity and enforceability of any remaining provisions. We acknowledge and
agree that we have read these Agreed Terms of Use in their entirety, understand them and agree to
be bound by them in all respects.
4|Page
Introduction
This document is derived from research conducted utilizing the SQL Server 2005 environment on
Windows XP Desktops and Windows 2003 servers. This document provides the necessary
settings and procedures for the secure installation, setup, configuration, and operation of an MS
SQL Server 2005 system. With the use of the settings and procedures in this document, an SQL
Server 2005 database may be secured from conventional “out of the box” threats. Recognizing the
nature of security cannot and should not be limited to only the application; the scope of this
document is not limited to only SQL Server 2005 specific settings or configurations, but also
addresses backups, archive logs, “best practices” processes and procedures that are applicable to
general software and hardware security.
Consensus Guidance
This guide was created using a consensus process comprised of volunteer and contract subject
matter experts. Consensus participants provide perspective from a diverse set of backgrounds
including consulting, software development, auditing and compliance, security research,
operations, government, and legal.
Configuration Levels
The action is unlikely to cause an interruption of service to the operating system or the
applications that run on it.
The actions can be automatically monitored, and the configuration verified, by Scoring Tools that
are available from the Center or by CIS-certified Scoring Tools.
Scoring Levels
This section defines the various scoring levels used within this document.
Scorable
This setting or recommendation is able to be assessed by scoring tools or command‐line
arguments.
5|Page
Not Scorable
This setting or recommendation requires complex checking that is not feasible with basic audit
methods.
Not Applicable
This setting is a “policy”‐style recommendation or general best practice that is not technical in
nature.
6|Page
1. Operating System and Network Specific Configuration
7|Page
Item Configuration Item Action / Recommended Parameters Comments Levels
#
1.9.3 Separate partitions Create separate partitions for OS/SQL program files, Separate partitions provide greater protections via 1S
SQL data files, and SQL transaction logs. host and file permissions at the volume level as
well as allowing greater control over data storage
usage and monitoring of the database.
1.9.4 Volume / partition type Format all volumes with NTFS 1S
1.10 Services Disable the following services on a SQL Server The disabling of services has to be balanced with
machine application requirements, since certain
applications require the use of certain services to
function correctly.
1.10.1 Alerter 1S
1.10.2 Clipbook Server 1S
1.10.3 Computer Browser 1S
1.10.4 DHCP Client 1S
1.10.5 Distributed File System 1S
1.10.6 Distributed Transaction Coordinator 2S
1.10.7 Fax Service 1S
1.10.8 Internet Connection Sharing 1S
1.10.9 IPSec policy agent Unless IPSec policies will be used 1S
1.10.10 License Logging 1S
1.10.11 Logical Disk Manager Administrative Service 1S
1.10.12 Messenger 1S
1.10.13 NetMeeting Remote Desktop Sharing 1S
1.10.14 Network DDE 1S
1.10.15 Network DDE DSDM 1S
1.10.16 Print Spooler 1S
1.10.17 Remote Access Connection Manager 1S
1.10.18 Remote Registry Unless network management software requiring 1S
remote registry access will be used
1.10.19 Removable Storage 1S
1.10.20 RunAs Service 1S
1.10.21 Smart Card 1S
1.10.22 Smart Card Helper 1S
1.10.23 Task Scheduler Unless batch jobs scheduled with the SQL Server 1S
Agent or scheduled tasks will be used
1.10.24 Telephony 1S
1.10.25 Telnet 1S
1.10.26 Windows Installer 1S
8|Page
Item Configuration Item Action / Recommended Parameters Comments Levels
#
1.11 MSSQL Server Service Use a low-privileged Local or Domain account for the The services account should only be a domain 2N
Account MSSQLServer service. account if the SQL Server requires remote
communications with other domain systems such
as those used for backup over the network.
Otherwise, a local user account should be used.
See items 1.13 – 1.17 for additional information
on the service account.
1.12 SQLServerAgent Use a low-privileged domain account for Replication and other inter-server 1N
Service Account SQLServerAgent if replication, DTS, or other inter- communications require the SQLServerAgent
server connection is required. service account to be a domain account.
1.13 Local users group Assign the local service account as a member of only The „Users‟ group is a local machine group. 1S
membership the Users group
1.14 Domain users group Make a domain service account a member of only 1N
membership the Domain Users group
1.15 SQL Server service Grant the SQL Server service account(s) the These rights are assigned by default.
account rights following rights:
Log on as a service 1S
Act as part of the operating system 1S
Log on as a batch job 1S
Replace a process-level token 1S
Bypass traverse checking 1S
Adjust memory quotas for a process 1S
Permission to start SQL Server Active Directory 1S
Helper
Permission to start SQL Writer 1S
1.16 SQL Server Agent Grant the SQL Server Agent service account(s) the These rights are assigned by default.
service account rights following rights:
Log on as a service 1S
Act as part of the operating system Only on Windows 2000 1S
Log on as a batch job 1S
Replace a process-level token 1S
Bypass traverse checking 1S
Adjust memory quotas for a process 1S
1.17 Integration Service Grant the Integration Service account(s) the following
account rights rights:
Log on as a service 1S
Permission to write to the application event log 1S
Bypass traverse checking 1S
Create global objects 1S
Impersonate a client after authentication 1S
9|Page
Item Configuration Item Action / Recommended Parameters Comments Levels
#
1.18 SQL Server services Deny the service account the “Log on locally” right. The service accounts do not have a need to log 1S
account rights on to the console. This will prevent a brute force
attack on the service account.
1.19 SQL Server services If a service account is a domain account, configure This, combined with the recommendation in item 1N
account rights the account to have the Windows permission “Log on 1.15-1.17, will prevent an attempt to logon to any
Locally” the database server only. domain computer using the services account.
1.20.1 SQLServer Proxy Create dedicated user accounts specifically for A SQL Server Agent proxy defines the security 1N
accounts proxies, and only use these proxy user accounts for context for a job step. A proxy provides SQL
running job steps. Server Agent with access to the security
credentials for a Microsoft Windows user. Each
proxy can be associated with one or more
subsystems. A job step that uses the proxy can
access the specified subsystems by using the
security context of the Windows user. Before SQL
Server Agent runs a job step that uses a proxy,
SQL Server Agent impersonates the credentials
defined in the proxy, and then runs the job step by
using that security context.
1.20.2 SQLServer Proxy Only grant the necessary permissions to proxy user 1N
accounts accounts. Grant only those permissions actually
required to run the job steps that are assigned to a
given proxy account.
1.20.3 SQLServer Proxy Do not run the SQL Server Agent service under a 1S
accounts Microsoft Windows account that is a member of the
Windows Administrators group.
10 | P a g e
2. SQL Server Installation and Patches
11 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
2.9 Sample databases Do not install the sample databases. Delete all e.g., AdventureWorks, AdventureWorksDW, 1S
sample databases if they already exist. Northwind and Pubs
12 | P a g e
3. SQL Server Settings
13 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
3.6 Other SQL Server Save a maximum of 14 SQL error logs. Truncate logs on a regular schedule, weekly, bi- 1S
Configuration Options weekly etc. to prevent oversize logs. This option is
found under Management-> SQL Server Logs
->Configure
3.7 Database Mail Disable Database Mail where messaging is not This option is found in the Advanced page of the 1S
required. SQL Server Properties window.
3.8 Trace Messages Error Log/Include execution trace messages = off General Page on SQL Server Agent properties 1S
3.9 User-defined stored Ensure that all user-defined stored procedures are 1S
procedures stored in encrypted format.
3.10 User-defined extended Avoid using user-defined extended stored This feature will be removed in a future version of 1S
stored procedures procedures. If extended functionality is required, use SQL Server
Common Language Runtime (CLR) assemblies
instead.
3.11 Extended stored Disable access to the following extended stored The disabling of access to stored procedures has
procedures procedures: to be balanced with application requirements,
since certain applications require the use of
external stored procedures to either export or
import data.
14 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
3.11.15 xp_readerrorlog 2S
3.11.16 xp_servicecontrol 2S
3.11.17 xp_sprintf 2S
3.11.18 xp_sscanf 2S
3.11.19 xp_subdirs 2S
3.12 SQLmail extended Disable access to the following SQLMail extended SQLMail is replaced by Database mail
stored procedures stored procedures: in MSS2005. It remains for backwards
compatibility. Both mail tools are
disabled by default.
15 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
3.15 Registry access Disable access to the following Registry access
extended stored extended stored procedures:
procedures
3.15.1 xp_regaddmultistring 2S
3.15.2 xp_regdeletekey 2S
3.15.3 xp_regdeletevalue 2S
3.15.4 xp_regenumvalues 2S
3.15.5 xp_regremovemultistring 2S
3.15.6 xp_regwrite 2S
3.16 Advanced Setting SQL Server Event forwarding/Forward events to a SQL Server Agent properties page. 1S
different server = off
16 | P a g e
4. Access Controls
17 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
4.9 SQL Server Database Remove the guest user from all databases except master and 1S
Users and Roles tempdb.
4.10 Statement Permissions Grant DDL statement permissions to only the database and DBO has all statement permissions for the 1S
schema owner, not individual users. database by default
4.11 Database Owners Ensure dbo owns all user-created database schemas Having dbo own all user-created database 1S
Permissions schemas prevents issues raised when users
need to be deleted
4.12 Low-privileged users Do not grant object permissions to PUBLIC or GUEST. Do not grant the REFERENCES object 1S
permission to an application user, application
administrator, or application role.
4.13 Stored Procedure Grant execute permissions on stored procedures to database 1S
Permissions roles (not users).
4.14 Using the GRANT option Do not assign the GRANT option of object permission to a user 1S
or role.
4.15 SQL Server Agent Restrict proxy access to required/approved subsystems Allowing access to CmdExec and ActiveX 1N
subsystem privileges subsystems allows direct OS access and
should be avoided unless business
justifications for doing so exist.
4.16 User-defined Database Create user-defined database roles to assign permissions to Not all organizations have a need for user- 1N
Roles objects in the database when a pre-defined database role does defined database roles. This may not apply to
not supply the appropriate permissions to a group of users. all organizations.
4.17 Database Roles Avoid nesting database roles. 1S
4.18 Users and Roles Ensure that the members of the roles (users/groups/other 1S
roles) in the target database actually exist.
4.19 Application Roles Use application roles to limit access to data to users of specific This provides a permission based rather than 1N
applications. Use encryption to protect the role name and password based mechanism to sandbox
password in the connection string. Use “EXECUTE AS WITH access.
NO REVERT” or “WITH COOKIE” to allow individuals to access
the application without knowing the password.
4.20 Use of Predefined Roles Avoid assigning predefined roles to PUBLIC or GUEST. 1S
4.21 Linked or Remote Servers Use linked servers rather than remote servers where required. Remote servers are available for backward 1S
Disable linked servers otherwise compatibility purposes only. Applications that
must execute stored procedures against
remote instances of SQL Server should use
linked servers instead.
4.22 Linked or Remote Servers Configure linked or remote servers to use Windows When linking SQL Server databases, the 1S
authentication where required. Disable linked servers user‟s current identity will be used to
otherwise. authenticate the connection.
18 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
4.23 Linked Server logins Allow linked server access only to those logins that need it. 1N
Disable linked servers otherwise.
4.24 Ad Hoc Data Access Disable ad hoc data access on all providers except SQL OLE Allow ad hoc data access only to trusted 1N
DB, for all users except members of the sysadmin fixed role. providers. Limit adhoc connections from MS
Use network segmentation to prevent or limit desktop clients Office applications (Excel, Access, Word, etc.).
from making direct adhoc connections.
19 | P a g e
5. Auditing and Logging
20 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
5.5.11 Audit Change Database Owner Occurs when you use the ALTER 1S
AUTHORIZATION statement to change the owner
of a database, and the permissions required to do
that are checked.
5.5.12 Audit DBCC Occurs whenever a DBCC command is issued 1S
5.5.13 Audit Database Management Occurs when a database is created, altered, or 1S
dropped.
5.5.14 Audit Database Object Access Occurs when database objects, such as schemas, 1S
are accessed.
5.5.15 Audit Database Object GDR Occurs when a GRANT, REVOKE, or DENY has 1S
been issued for database objects, such as
assemblies and schemas.
5.5.16 Audit Database Object Management Occurs when a CREATE, ALTER, or DROP 1S
statement is executed on database objects, such
as schemas.
5.5.17 Audit Database Object Take Ownership Occurs when a change of owner for objects within 1S
database scope occurs.
5.5.18 Audit Database Operation Occurs when operations in a database, such as 1S
checkpoint or subscribe query notification, occur.
5.5.19 Audit Database Principal Impersonation Occurs when an impersonation occurs within the 1S
database scope, such as EXECUTE AS <user> or
SETUSER.
5.5.20 Audit Database Principal Management Occurs when principals, such as users, are 1S
created, altered, or dropped from a database.
5.5.21 Audit Database Scope GDR Occurs whenever a GRANT, REVOKE, or DENY 1S
is issued for a statement permission by any user
in Microsoft SQL Server for database-only actions
such as granting permissions on a database.
5.5.22 Audit Login Change Password Occurs whenever a user changes their Microsoft 1S
SQL Server login password.
5.5.23 Audit Login Change Property Occurs when you use the sp_defaultdb stored 1S
procedure, the sp_defaultlanguage stored
procedure, or the ALTER LOGIN statement to
modify a property of a login.
5.5.24 Audit Login Occurs when a user has successfully logged in to 1S
SQL Server.
5.5.25 Audit Login Failed Indicates that a user tried to log in to Microsoft 1S
SQL Server and failed.
5.5.26 Audit Login GDR Event Occurs when a Microsoft Windows login right was 1S
added or removed.
21 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
5.5.27 Audit Logout Indicates that a user has logged out of (logged off) 1S
Microsoft SQL Server.
5.5.28 Audit Object Derived Permission Event Occurs when a CREATE, ALTER, or DROP was 1S
issued for an object.
5.5.29 Audit Schema Object Access Occurs when an object permission (such as 1S
SELECT) is used.
5.5.30 Audit Schema Object GDR Occurs whenever a GRANT, REVOKE, or DENY 1S
is issued for a schema object permission by any
user in Microsoft SQL Server.
5.5.31 Audit Schema Object Management Occurs when server objects are created, altered, 1S
or dropped.
5.5.32 Audit Schema Object Take Ownership Occurs when the permissions to change the 1S
owner of schema object (such as a table,
procedure, or function) is checked. This happens
when the ALTER AUTHORIZATION statement is
used to assign an owner to an object.
5.5.33 Audit Server Alter Trace Occurs for all statements that check for the 1S
ALTER TRACE permission. Statements that
check for ALTER TRACE include those used to
create or configure a trace, or to set a filter on a
trace.
5.5.34 Audit Server Object GDR Occurs whenever a GRANT, REVOKE, or DENY 1S
is issued for a server object permission by any
user in Microsoft SQL Server.
5.5.35 Audit Server Object Management Occurs in the case of CREATE, ALTER, or DROP 1S
for server objects.
5.5.36 Audit Server Object Take Ownership Occurs when the owner is changed for objects in 1S
server scope.
5.5.37 Audit Server Operation Occurs when Security Audit operations such as 1S
altering settings, resources, external access, or
authorization are used.
5.5.38 Audit Server Principal Impersonation Occurs when there is an impersonation within 1S
server scope, such as EXECUTE AS <login>.
5.5.39 Audit Server Principal Management Occurs when server principals are created, 1S
altered, or dropped.
5.5.40 Audit Server Scope GDR Occurs when a GRANT, REVOKE, or DENY is 1S
issued for permissions in the server scope, such
as creating a login.
5.5.41 Audit Server Starts and Stops Occurs when the Microsoft SQL Server service 1S
state is modified.
22 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
5.5.42 Audit Statement Permission Event Occurs when a statement permission has been 1S
used.
23 | P a g e
6. Backup and Disaster Recovery Procedures
24 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
6.8 Recommended periodic Run the Microsoft Baseline Security Analyzer 1N
administrative procedures weekly and follow the security recommendations
as closely as possible to secure the operating
system.
6.9 Recommended periodic Run the SQL Best Practices Analyzer regularly and 1N
administrative procedures note any changes to the environment.
6.10 Enable Password Policy When a password change mechanism is introduced 1S
Enforcement into clients and applications, enable password
expiration. Always specify MUST_CHANGE when
specifying a password on behalf of another principal.
6.11 Periodic scan of Role Periodically scan fixed server and database roles 1N
Members to ensure that only trusted individuals are
members.
6.12 Periodic scan of stored Verify stored procedures that have been set to 1N
procedures AutoStart are secure.
25 | P a g e
7. Replication
7.2 Replication administration Avoid modifying replication administration The permissions needed to support and 1N
roles permissions assigned to the roles by default. Only administer replication are assigned to sysadmin,
assign authorized application administrators and db_owner and replmonitor by default.
DBAs these roles.
7.3 Snapshot share folder Store the snapshot folder, which houses a snapshot 1S
of the replicated changes, on an explicit share and
not an administrative share.
7.4 Publication Access List The domain accounts used by the SQL Server Agent 1S
service and the Replication proxy account must be
entered in the Publication Access List so that all
replication agents will be able to participate in the
replication process.
7.5 Secure Communications Use secure connections, such as VPN or proxy 1N
servers, for all replication over the Internet.
7.6 Database connections Configure the database connections for replication 1S
agents to use Windows authenticated logons.
7.7 Filtering Employ replication filters to protect the data. 1S
7.8 Distribution databases All distribution databases and snapshot files must be 1S
located in protected and audited locations.
26 | P a g e
8. Application Development Best Practices
8.1 Ownership Chaining Use ownership chaining within a single database to Avoid using cross database ownership chaining. 1N
simplify permissions management.
8.2 Role Assignments Assign permissions to roles rather than users. The Ensure that roles, rather than users own objects 1N
principle of “Least Privilege” applies, thus users to avoid application changes when a user is
should not be given access to roles they do not need dropped.
for their job function.
8.3 Encrypted connections Enable encrypted connections between the user and Consider allowing only encrypted connections. 1N
the server. When allowing SQL Server authentication,
encrypt either the network layer with IPSec or the
session with SSL
8.4 Error Handling Do not propagate errors back to the user. Log errors or transmit them to the system 1N
administrator.
8.5 User Input Prevent SQL injection by validating all user input Only permit minimally privileged accounts to send 1N
before transmitting it to the server. user input to the server. Minimize the risk of SQL
injection attack by using parameterized
commands and stored procedures.
8.6 Developer awareness Increase awareness of issues such as cross-site 1N
scripting, buffer overflows, SQL injection and
dangerous APIs.
8.7 Developer awareness Identify categories of threats that apply to your 1N
application, such as denial of service, escalation of
privileges, spoofing, data tampering, information
disclosure and repudiation.
8.8 Security reviews Add security reviews to all stages of the application 1N
development lifecycle (from design to testing).
8.9 Distributing If you distribute SQLEXPRESS, install Never install a blank sa password. Use the 1N
SQLEXPRESS SQLEXPRESS using Windows security mode as the Microsoft Installer to install SQLEXPRESS.
default.
8.10 Net-Libraries If SQLEXPRESS will operate as a local data store, Remote access is disabled by default. 1N
disable any unnecessary client protocols.
27 | P a g e
Item Configuration Item Action / Recommended Parameters Comments Levels
#
8.11 Customer awareness Let your customers know that your product includes 1N
SQLEXPRESS so that they can be prepared to
install or accept SQLEXPRESS -specific software
updates.
8.12 SQL Server Agent Change the SQL Server Agent Startup Type to SQLEXPRESS installs SQL Server Agent by 1N
“Disabled”. default and the Service startup type is “Manual”.
28 | P a g e
9. Surface Area Configuration Tool
9.1 Ad Hoc Remote Queries Disable Ad Hoc Remote Queries where not required Disabled by default. 1S
9.2 CLR Integration Disable CLR Integration where not required Disabled by default. 1S
9.3 DAC Disable the Dedicated Administrator Connection Disabled by default. 1S
where not required
9.4 Database Mail Disable Database Mail where messaging is not Disabled by default. 1S
required
9.5 Native XML Web Do not configure XML Web Services endpoints Disabled by default. 1S
Services where not required
9.6 OLE Automation Disable OLE Automation where not required Disabled by default. 1S
9.7 Service Broker Do not configure Service Broker endpoints where not Disabled by default. 1S
required
9.8 SQL Mail Do not enable SQL Mail where not required or where Disabled by default. 1S
Database Mail could be used instead.
9.9 Web Assistant Disable Web Assistant where not required Disabled by default. 1S
9.10 xp_cmdshell Disable the xp_cmdshell stored procedure where not Disabled by default. 1S
required
9.11 Ad Hoc Data Mining Disable ad hoc data mining queries where not 1S
required
9.12 Anonymous Disable anonymous connections to the Analysis 1S
Connections Services where not required
9.13 Linked Objects ” Enable links To other instances” should be disabled 1S
where not required.
9.14 Linked Objects ” Enable links From other instances” should be 1S
disabled where not required.
9.15 User-Defined Functions Disable loading of user-defined COM functions 1S
where not required
9.16 Scheduled Events and Disable scheduled events and report delivery where 1S
Report Delivery not required
9.17 Web Service and HTTP Disable Web Service and HTTP access where not 1S
Access required
9.18 Windows Integrated Enable Windows integrated security for report data 1S
Security source connections
29 | P a g e
Change History
30 | P a g e
Acknowledgements
The following people were instrumental in the development of this guide:
References
10 Steps to Help Secure SQL Server 2000. Microsoft Corporation. Last accessed at:
http://www.microsoft.com/sql/techinfo/administration /2000/security/securingsqlserver.mspx
Database Security Technical Implementation Guide version 7, release1, October 2004. Developed by DISA
for the DOD.
Guide to the Secure Configuration and Administration of Microsoft SQL Server 2000. August 26, 2003.
National Security Agency.
SQL Server 2000 SP3 Security Features and Best Practices: Security Best Practices Checklist. May 2003.
Microsoft Corporation. Last accessed at:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sp3sec04.mspx
31 | P a g e