CIS Microsoft SQL Server 2012 Database Engine Benchmark v1.1.0 PDF
CIS Microsoft SQL Server 2012 Database Engine Benchmark v1.1.0 PDF
v1.1.0 - 09-07-2014
Engine
Benchmark
http://benchmarks.cisecurity.org
The CIS Security Benchmarks division provides consensus-oriented information security products, services, tools, metrics, suggestions, and
recommendations (the SB Products) as a public service to Internet users worldwide. Downloading or using SB Products in any way signifies
and confirms your acceptance of and your binding agreement to these CIS Security Benchmarks Terms of Use.
Download, install, and use each of the SB Products on a single computer, and/or
Print one or more copies of any SB Product that is in a .txt, .pdf, .doc, .mcw, or .rtf format, but only if each such copy is printed in
its entirety and is kept intact, including without limitation the text of these CIS Security Benchmarks Terms of Use.
SB Products Provided As Is. CIS is providing the SB Products as is and as available without: (1) any representations,
warranties, or covenants of any kind whatsoever (including the absence of any warranty regarding: (a) the effect or lack of effect
of any SB Product on the operation or the security of any network, system, software, hardware, or any component of any of them,
and (b) the accuracy, utility, reliability, timeliness, or completeness of any SB Product); or (2) the responsibility to make or notify
you of any corrections, updates, upgrades, or fixes.
Intellectual Property and Rights Reserved. You are not acquiring any title or ownership rights in or to any SB Product, and full
title and all ownership rights to the SB Products remain the exclusive property of CIS. All rights to the SB Products not expressly
granted in these Terms of Use are hereby reserved.
Restrictions. You acknowledge and agree that you may not: (1) decompile, dis-assemble, alter, reverse engineer, or otherwise
attempt to derive the source code for any software SB Product that is not already in the form of source code; (2) distribute,
redistribute, sell, rent, lease, sublicense or otherwise transfer or exploit any rights to any SB Product in any way or for any
purpose; (3) post any SB Product on any website, bulletin board, ftp server, newsgroup, or other similar mechanism or device;
(4) remove from or alter these CIS Security Benchmarks Terms of Use on any SB Product; (5) remove or alter any proprietary
notices on any SB Product; (6) use any SB Product or any component of an SB Product with any derivative works based directly
on an SB Product or any component of an SB Product; (7) use any SB Product or any component of an SB Product with other
products or applications that are directly and specifically dependent on such SB Product or any component for any part of their
functionality; (8) represent or claim a particular level of compliance or consistency with any SB Product; or (9) facilitate or
otherwise aid other individuals or entities in violating these CIS Security Benchmarks Terms of Use.
Your Responsibility to Evaluate Risks. You acknowledge and agree that: (1) no network, system, device, hardware, software,
or component can be made fully secure; (2) you have the sole responsibility to evaluate the risks and benefits of the SB Products
to your particular circumstances and requirements; and (3) CIS is not assuming any of the liabilities associated with your use of
any or all of the SB Products.
CIS Liability. You acknowledge and agree that neither CIS nor any of its employees, officers, directors, agents or other service
providers has or will have any liability to you whatsoever (whether based in contract, tort, strict liability or otherwise) for any
direct, indirect, incidental, consequential, or special damages that arise out of or are connected in any way with your use of any
SB Product.
Indemnification. You agree to indemnify, defend, and hold CIS and all of CIS's employees, officers, directors, agents and other
service providers harmless from and against any liabilities, costs and expenses incurred by any of them in connection with your
violation of these CIS Security Benchmarks Terms of Use.
Jurisdiction. You acknowledge and agree that: (1) these CIS Security Benchmarks Terms of Use will be governed by and
construed in accordance with the laws of the State of Maryland; (2) any action at law or in equity arising out of or relating to
these CIS Security Benchmarks Terms of Use shall be filed only in the courts located in the State of Maryland; and (3) you hereby
consent and submit to the personal jurisdiction of such courts for the purposes of litigating any such action.
U.S. Export Control and Sanctions laws. Regarding your use of the SB Products with any non-U.S. entity or country, you
acknowledge that it is your responsibility to understand and abide by all U.S. sanctions and export control laws as set from time
to time by the U.S. Bureau of Industry and Security (BIS) and the U.S. Office of Foreign Assets Control (OFAC).
SPECIAL RULES FOR CIS MEMBER ORGANIZATIONS: CIS reserves the right to create special rules for: (1) CIS Members; and (2) NonMember organizations and individuals with which CIS has a written contractual relationship. CIS hereby grants to each CIS Member
Organization in good standing the right to distribute the SB Products within such Member's own organization, whether by manual or
electronic means. Each such Member Organization acknowledges and agrees that the foregoing grants in this paragraph are subject to the
terms of such Member's membership arrangement with CIS and may, therefore, be modified or terminated by CIS at any time.
1|Page
Table of Contents
Table of Contents .................................................................................................................................................. 2
Overview .................................................................................................................................................................. 3
Intended Audience ........................................................................................................................................... 3
Consensus Guidance........................................................................................................................................ 3
Typographical Conventions ......................................................................................................................... 4
Scoring Information ........................................................................................................................................ 4
Profile Definitions ............................................................................................................................................ 5
Acknowledgements ......................................................................................................................................... 6
Recommendations ................................................................................................................................................ 7
1 Installation, Updates and Patches .......................................................................................................... 7
2 Surface Area Reduction .............................................................................................................................. 9
3 Authentication and Authorization ...................................................................................................... 25
4 Password Policies ...................................................................................................................................... 28
5 Auditing and Logging ............................................................................................................................... 31
6 Application Development ....................................................................................................................... 34
Appendix: Change History .............................................................................................................................. 37
2|Page
Overview
This document, Security Configuration Benchmark for Microsoft SQL Server 2012, provides
prescriptive guidance for establishing a secure configuration posture for Microsoft SQL
Server 2012 versions. This guide was tested against Microsoft SQL Server 2012. To obtain
the latest version of this guide, please visit http://benchmarks.cisecurity.org. If you have
questions, comments, or have identified ways to improve this guide, please write us at
[email protected].
Intended Audience
This benchmark is intended for system and application administrators, security specialists,
auditors, help desk, and platform deployment personnel who plan to develop, deploy,
assess, or secure solutions that incorporate Microsoft SQL Server 2012 on a Microsoft
Windows platform.
Consensus Guidance
This benchmark was created using a consensus review process comprised subject matter
experts. Consensus participants provide perspective from a diverse set of backgrounds
including consulting, software development, audit and compliance, security research,
operations, government, and legal.
Each CIS benchmark undergoes two phases of consensus review. The first phase occurs
during initial benchmark development. During this phase, subject matter experts convene
to discuss, create, and test working drafts of the benchmark. This discussion occurs until
consensus has been reached on benchmark recommendations. The second phase begins
after the benchmark has been published. During this phase, all feedback provided by the
Internet community is reviewed by the consensus team for incorporation in the
benchmark. If you are interested in participating in the consensus process, please visit
https://community.cisecurity.org.
3|Page
Typographical Conventions
The following typographical conventions are used throughout this guide:
Convention
Meaning
Monospace font
Italic font
Note
Scoring Information
A scoring status indicates whether compliance with the given recommendation impacts the
assessed target's benchmark score. The following scoring statuses are used in this
benchmark:
Scored
Failure to comply with "Scored" recommendations will decrease the final benchmark score.
Compliance with "Scored" recommendations will increase the final benchmark score.
Not Scored
Failure to comply with "Not Scored" recommendations will not decrease the final
benchmark score. Compliance with "Not Scored" recommendations will not increase the
final benchmark score.
4|Page
Profile Definitions
The following configuration profiles are defined by this Benchmark:
5|Page
Acknowledgements
This benchmark exemplifies the great things a community of users, vendors, and subject matter
experts can accomplish through consensus collaboration. The CIS community thanks the entire
consensus team with special recognition to the following individuals who contributed greatly to
the creation of this guide:
Editor
Nancy Hidy Wilson
Brian Kelley MCSE, CISA, Security+, Microsoft MVP - SQL Server
Contributor
Tran Thanh Chien
Masoud Sultan
Dorothy Feistner
Kevvie Fowler GCFA Gold, CISSP, MCTS, Ringzero, Inc.
6|Page
Recommendations
1 Installation, Updates and Patches
[This space intentionally left blank]
1.1 Install the Latest SQL Server Service Packs and Hotfixes (Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
SQL Server patches contain program updates that fix security and product functionality
issues found in the software. These patches can be installed with a hotfix which is a single
patch, a cumulative update which is a small group of patches or a service pack which is a
large collection of patches.
The SQL Server version and patch levels should be the most recent compatible with the
organizations' operational needs
Rationale:
Using the most recent SQL Server software, along with all applicable patches can help limit
the possibilities for vulnerabilities in the software, the installation version and/or patches
applied during setup should be established according to the needs of the organization.
Audit:
To determine your SQL Server service pack level, run the following code snippet.
SELECT SERVERPROPERTY('ProductLevel') as SP_installed,
SERVERPROPERTY('ProductVersion') as Version;
First column returns the installed Service Pack level, the second is the exact build number.
Remediation:
Identify the current version and patch level of your SQL Server instances and ensure they
contain the latest security fixes. Make sure to test these fixes in your test environments
before updating production instances.
The most recent SQL Server patches can be found here:
Hotfixes and Cumulative updates: http://blogs.msdn.com/b/sqlreleaseservices/
7|Page
8|Page
Impact:
It is difficult to see any reasonably adverse impact to making this architectural change,
once the costs of making the change have been paid. Custom applications may need to be
modified to accommodate database connections over the wire rather than on the host (i.e.
using TCP/IP instead of Named Pipes). Additional hardware and operating system licenses
may be required to make these architectural changes.
2.1 Set the 'Ad Hoc Distributed Queries' Server Configuration Option to 0
(Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
Ad Hoc Distributed Queries Allow users to query data and execute statements on external
data sources. This functionality should be disabled.
Rationale:
This feature can be used to remotely access and exploit vulnerabilities on remote SQL
Server instances and to run unsafe Visual Basic for Application functions.
Audit:
Run the following T-SQL command:
SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as
value_in_use
FROM sys.configurations
WHERE name = 'ad hoc distributed queries';
Default Value:
0 (disabled)
References:
1. http://msdn.microsoft.com/en-us/library/ms187569(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms187569(v=sql.100).aspx
10 | P a g e
Default Value:
By default, this option is disabled.
11 | P a g e
Default Value:
0 (disabled)
References:
1. http://msdn.microsoft.com/en-us/library/ms188694(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms188694(v=sql.100).aspx
2.4 Set the 'Database Mail XPs' Server Configuration Option to 0 (Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
This option controls the generation and transmission of email messages from SQL Server.
Rationale:
Disabling Database Mail reduces the SQL Server surface, eliminates a DOS attack vector and
channel to exfiltrate data from the database server to a remote host.
Audit:
Run the following T-SQL command:
SELECT name,
CAST(value as int) as value_configured,
CAST(value_in_use as int) as value_in_use
FROM sys.configurations
WHERE name = 'Database Mail XPs';
12 | P a g e
Default Value:
By default, this option is disabled.
Remediation:
Run the following T-SQL command:
EXECUTE sp_configure 'show advanced options', 1;
RECONFIGURE;
EXECUTE sp_configure 'Ole Automation Procedures', 0;
RECONFIGURE;
GO
EXECUTE sp_configure 'show advanced options', 0;
RECONFIGURE;
Default Value:
0 (disabled)
13 | P a g e
References:
1. http://msdn.microsoft.com/en-us/library/ms191188(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms191188(v=sql.100).aspx
Default Value:
1 (enabled)
References:
14 | P a g e
1. http://msdn.microsoft.com/en-us/library/ms187660(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms187660(v=sql.100).aspx
Default Value:
0 (disabled)
References:
1. http://msdn.microsoft.com/en-us/library/ms190468(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms190468(v=sql.100).aspx
2.8 Set the 'Scan For Startup Procs' Server Configuration Option to 0
(Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
This option causes SQL Server to scan for and automatically run all stored procedures that
are set to execute upon service startup.
Rationale:
Enforcing this control reduces the threat of an entity leveraging these facilities for
malicious purposes.
Audit:
Run the following T-SQL command:
SELECT name,
CAST(value as int) as value_configured,
CAST(value_in_use as int) as value_in_use
FROM sys.configurations
WHERE name = 'Scan for startup procs';
16 | P a g e
RECONFIGURE;
GO
EXECUTE sp_configure 'show advanced options', 0;
RECONFIGURE;
Impact:
Setting Scan for Startup Procedures to 0 will prevent certain audit traces and other
commonly used monitoring SPs from re-starting on start up. Additionally, replication
requires this setting to be enabled (1) and will automatically change this setting if needed.
Default Value:
0 (disabled)
References:
1. http://msdn.microsoft.com/en-us/library/ms179460(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms179460(v=sql.100).aspx
17 | P a g e
Remediation:
Execute the following statement against the database:
ALTER DATABASE <dbname>
SET TRUSTWORTHY OFF;
Default Value:
OFF
References:
1. http://msdn.microsoft.com/en-us/library/ms187861(v=sql.100).aspx
2. http://msdn.microsoft.com/en-us/library/ms187861(v=sql.105).aspx
The Database Engine must be stopped and restarted for the change to take effect.
Default Value:
By default, TCP/IP and Shared Memory protocols are enabled on all commerical SQL Server
2008 instances.
References:
1. http://msdn.microsoft.com/en-us/library/ms191294(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms191294(v=sql.100).aspx
This should return no lines. If any lines returned, check the process id in the last column if
it's a SQL Server instance.
Remediation:
1. In SQL Server Configuration Manager, in the console pane, expand SQL Server
Network Configuration, expand Protocols for , and then double-click the TCP/IP or
VIA protocol
2. In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses
appear in the format IP1, IP2, up to IPAll. One of these is for the IP address of the
19 | P a g e
2.12 Set the 'Hide Instance' option to 'Yes' for Production SQL Server
instances (Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
Non-clustered SQL Server instances within production environments should be designated
as hidden to prevent advertisement by the SQL Server Browser service.
Rationale:
Designating production SQL Server instances as hidden leads to a more secure installation
because they cannot be enumerated. However, clustered instances may break if this option
is selected.
20 | P a g e
Audit:
1. In SQL Server Configuration Manager, expand SQL Server Network Configuration,
right-click Protocols for <server instance>, and then select Properties.
2. On the Flags tab, in the Hide Instance box, select Yes, and then click OK to close the
dialog box. The change takes effect immediately for new connections.
Remediation:
1. In SQL Server Configuration Manager, expand SQL Server Network Configuration,
right-click Protocols for <server instance>, and then select Properties.
2. On the Flags tab, in the Hide Instance box, select Yes, and then click OK to close the
dialog box. The change takes effect immediately for new connections.
Default Value:
By default, SQL Server instances are not hidden.
References:
1. http://msdn.microsoft.com/en-us/library/ms179327(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms179327(v=sql.100).aspx
21 | P a g e
Impact:
It is not a good security practice to code applications or scripts to use the sa account.
However, if this has been done disabling the sa account will prevent scripts and
applications for authenticating to the database server and executing required tasks or
functions.
Default Value:
By default the 'sa' login account is enabled.
References:
1.
2.
3.
4.
http://msdn.microsoft.com/en-us/library/ms188786(v=sql.100).aspx
http://msdn.microsoft.com/en-us/library/ms188786(v=sql.105).aspx
http://msdn.microsoft.com/en-us/library/ms189828(v=sql.100).aspx
http://msdn.microsoft.com/en-us/library/ms189828(v=sql.105).aspx
22 | P a g e
Impact:
It is not a good security practice to code applications or scripts to use the sa account.
However, if this has been done renaming the sa account will prevent scripts and
applications for authenticating to the database server and executing required tasks or
functions.
Default Value:
By default the 'sa'account name is 'sa'
References:
1. http://msdn.microsoft.com/en-us/library/ms144284.aspx
Audit:
Run the following code snippet to determine if the xp_cmdshell system stored procedure is
enabled:
EXECUTE sp_configure 'show advanced options',1;
RECONFIGURE WITH OVERRIDE;
EXECUTE sp_configure 'xp_cmdshell';
A run value of 0 indicates that the xp_cmdshell option is disabled. If the option is enabled,
run the following code snippet to disable this option:
EXECUTE sp_configure 'show advanced options',1;
RECONFIGURE WITH OVERRIDE;
EXECUTE sp_configure 'xp_cmdshell',0;
RECONFIGURE WITH OVERRIDE;
Remediation:
Run the following T-SQL command:
EXECUTE sp_configure 'show advanced options', 1;
RECONFIGURE;
EXECUTE sp_configure 'Xp_cmdshell', 0;
RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0;
RECONFIGURE;
Default Value:
0 (disabled)
References:
1.
2.
3.
4.
http://msdn.microsoft.com/en-us/library/ms175046(v=sql.105).aspx
http://msdn.microsoft.com/en-us/library/ms175046(v=sql.100).aspx
http://msdn.microsoft.com/en-us/library/ms190693(v=sql.105).aspx
http://msdn.microsoft.com/en-us/library/ms190693(v=sql.100).aspx
24 | P a g e
Default Value:
Windows Authentication Mode
References:
1. http://msdn.microsoft.com/en-us/library/ms188470(v=sql.100).aspx
2. http://msdn.microsoft.com/en-us/library/ms188470(v=sql.105).aspx
25 | P a g e
3.2 Revoke CONNECT permissions on the 'guest user' within all SQL
Server databases excluding the master, msdb and tempdb (Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
Removes the right of guest users to connect to SQL Server user databases.
Rationale:
A login assumes the identity of the guest user when a login has access to SQL Server but
does not have access to a database through its own account and the database has a guest
user account. Revoking the connect permission for the guest user will ensure that a login is
not able to access database information without explicit access to do so.
Audit:
Run the following code snippet in each database in the instance to determine if the guest
user has CONNECT permission.
USE [database_name];
GO
SELECT DB_NAME() AS DBName, dpr.name, dpe.permission_name
FROM sys.database_permissions dpe
JOIN sys.database_principals dpr
ON dpe.grantee_principal_id=dpr.principal_id
WHERE dpr.name='guest'
AND dpe.permission_name='CONNECT';
Remediation:
The following code snippet revokes CONNECT permissions from the guest user in a
database:
USE [database_name];
GO
REVOKE CONNECT FROM guest;
Impact:
When CONNECT permission to the guest user is revoked, a SQL Server instance login must
be mapped to a database user explicitly in order to have access to the database.
Default Value:
26 | P a g e
The guest user account is added to each new database but without CONNECT permission
by default.
References:
1. http://msdn.microsoft.com/en-us/library/bb402861(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/bb402861(v=sql.100).aspx
Remediation:
Run the following T-SQL query to remove an orphan user:
DROP USER <username>;
References:
1. http://msdn.microsoft.com/en-us/library/ms175475(v=sql.100).aspx
2. http://msdn.microsoft.com/en-us/library/ms175475(v=sql.105).aspx
27 | P a g e
4 Password Policies
4.1 Set the 'MUST_CHANGE' Option to ON for All SQL Authenticated
Logins (Not Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
SQL Server will prompt for an updated password the first time the altered login is used.
Rationale:
Enforcing password change will prevent the account administrators or anyone accessing
the initial password to misuse the SQL login created without being noticed.
Audit:
1. Open SQL Server Management Studio.
2. Open Object Explorer and connect to the target instance.
3. Navigate to the Logins tab in Object Explorer and expand. Right click on the desired
login and select Properties.
4. Verify the User must change password at next login checkbox is checked
Remediation:
Set the MUST_CHANGE option for SQL Authenticated logins
ALTER LOGIN login_name WITH PASSWORD = password_value MUST_CHANGE;
Impact:
CHECK_EXPIRATION and CHECK_POLICY options must both be ON
Default Value:
ON
References:
1. http://msdn.microsoft.com/en-us/library/ms189828(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms189828(v=sql.100).aspx
28 | P a g e
Remediation:
ALTER LOGIN [login_name] WITH CHECK_EXPIRATION = ON;
Default Value:
'CHECK_EXPIRATION' is ON
References:
1. http://msdn.microsoft.com/en-us/library/ms161959(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms161959(v=sql.100).aspx
Profile Applicability:
Level 1 - Database Engine
Description:
Applies the same password complexity policy used in Windows to passwords used inside
SQL Server.
Rationale:
Ensuring SQL logins comply with the secure password policy applied by the Windows
Server Benchmark will ensure SQL logins are not blank and cannot be easily compromised
via brute force attack.
Audit:
Use the following code snippet to determine the SQL Logins and if their password
complexity is enforced.
SELECT SQLLoginName = sp.name,
PasswordPolicyEnforced = CAST(sl.is_policy_checked AS BIT)
FROM sys.server_principals sp
JOIN sys.sql_logins AS sl ON sl.principal_id = sp.principal_id
WHERE sp.type_desc = 'SQL_LOGIN';
Default Value:
'CHECK_POLICY' is ON
References:
1. http://msdn.microsoft.com/en-us/library/ms161959(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms161959(v=sql.100).aspx
30 | P a g e
5.1 Set the 'Maximum number of error log files' setting to greater than
or equal to 12 (Not Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
SQL Server errorlog files must be protected from loss. The log files must be backed up
before they are overwritten.
Rationale:
The SQL Server errorlog contains important information about major server events and
login attempt information as well.
Audit:
1. Open SQL Server Management Studio.
2. Open Object Explorer and connect to the target instance.
3. Navigate to the Management tab in Object Explorer and expand. Right click on the
SQL Server Logs file and select Configure.
4. Verify the Limit the number of error log files before they are recycled checkbox is
checked
5. Verify the Maximum number of error log files is greater than or equal to 12
Remediation:
Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient
for a production environment.
1. Open SQL Server Management Studio.
2. Open Object Explorer and connect to the target instance.
3. Navigate to the Management tab in Object Explorer and expand. Right click on the
SQL Server Logs file and select Configure
4. Check the Limit the number of error log files before they are recycled
5. Set the Maximum number of error log files to greater than or equal to 12
31 | P a g e
Default Value:
6 SQL Server error logs are retained by default.
References:
1. http://msdn.microsoft.com/en-us/library/ms177285(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms177285(v=sql.100).aspx
32 | P a g e
Default Value:
1 (on)
References:
1. http://msdn.microsoft.com/en-us/library/ms175513(v=sql.105).aspx
2. http://msdn.microsoft.com/en-us/library/ms175513(v=sql.100).aspx
5.3 Set 'Login Auditing' to Both failed and successful logins (Not Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
Setting logs both successful and failed login SQL Server authentication attempts.
Rationale:
Logging successful and failed logins provides key information that can be used to
detect\confirm password guessing attacks. Further, logging successful login attempts can
be used to confirm server access during forensic investigations.
Audit:
XP_loginconfig 'audit level';
A config_value of 'all' indicates a server login auditing setting of 'Both failed and successful
logins'.
Remediation:
Perform the following steps to set the level of auditing:
1. Open SQL Server Management Studio.
2. Right click the target instance and select Properties and navigate to the Security tab.
3. Select the option Both failed and successful logins under the "Login Auditing"
section and click OK.
4. Restart the SQL Server instance.
Default Value:
33 | P a g e
6 Application Development
6.1 Sanitize Database and Application User Input (Not Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
Always validate user input received from a database client or application by testing type,
length, format, and range prior to transmitting it to the database server.
Rationale:
Sanitizing user input drastically minimizes risk of SQL injection.
Audit:
Check with the application teams to ensure any database interaction is through the use of
stored procedures and not dynamic SQL. Revoke any INSERT, UPDATE, or DELETE
privileges to users so that modifications to data must be done through stored procedures.
Verify that there's no SQL query in the application code produced by string concatenation.
Remediation:
The following steps can be taken to remediate SQL injection vulnerabilities:
Impact:
34 | P a g e
Sanitize user input may require changes to application code or database object syntax.
These changes can require applications or databases to be taken temporarily off-line. Any
change to TSQL or application code should be thoroughly tested in testing environment
before production implementation.
References:
1. https://www.owasp.org/index.php/SQL_Injection
2. http://msdn.microsoft.com/en-us/library/ms161953(v=sql.100).aspx
3. http://msdn.microsoft.com/en-us/library/ms161953(v=sql.105).aspx
6.2 Set the 'CLR Assembly Permission Set' to SAFE_ACCESS for All CLR
Assemblies (Scored)
Profile Applicability:
Level 1 - Database Engine
Description:
Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies
from accessing external system resources such as files, the network, environment
variables, or the registry.
Rationale:
Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access
sensitive areas of the operating system, steal and/or transmit data and alter the state and
other protection measures of the underlying Windows Operating System.
Audit:
Execute the following SQL statement:
SELECT name,
permission_set_desc
FROM sys.assemblies
where is_user_defined = 1;
All the returned assemblies should show SAFE_ACCESS in the permission_set_desc column.
Remediation:
ALTER ASSEMBLY assembly_name WITH PERMISSION_SET = SAFE;
35 | P a g e
Impact:
The remediation measure should first be tested within a test environment prior to
production to ensure the assembly still functions as designed with SAFE permission setting.
Default Value:
SAFE permission set
References:
1.
2.
3.
4.
5.
6.
http://msdn.microsoft.com/en-us/library/ms345101(v=sql.105).aspx
http://msdn.microsoft.com/en-us/library/ms189790(v=sql.100).aspx
http://msdn.microsoft.com/en-us/library/ms189790(v=sql.105).aspx
http://msdn.microsoft.com/en-us/library/ms345101(v=sql.100).aspx
http://msdn.microsoft.com/en-us/library/ms186711(v=sql.100).aspx
http://msdn.microsoft.com/en-us/library/ms186711(v=sql.105).aspx
36 | P a g e
Version
09-07-2014
1.1.0
09-07-2014
1.1.0
09-07-2014
1.1.0
09-07-2014
1.1.0
09-07-2014
1.1.0
09-07-2014
1.1.0
09-07-2014
1.1.0
09-07-2014
1.1.0
37 | P a g e