You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sql-server/install/security-considerations-for-a-sql-server-installation.md
+70-62Lines changed: 70 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,126 +32,134 @@ ms.author: chadam
32
32
33
33
Security is important for every product and every business. By following simple best practices, you can avoid many security vulnerabilities. This article discusses some security best practices that you should consider both before you install [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] and after you install [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Security guidance for specific features is included in the reference articles for those features.
34
34
35
-
## Before Installing [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]
35
+
## Before Installing [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]
36
+
36
37
Follow these best practices when you set up the server environment:
37
38
38
-
-[Enhance physical security](#physical_security)
39
-
40
-
-[Use firewalls](#firewalls)
41
-
42
-
-[Isolate services](#isolated_services)
43
-
44
-
-[Configure a secure file system](#sa_with_least_privileges)
45
-
46
-
-[Disable NetBIOS and server message block](#disabled_protocols)
47
-
48
-
-[Installing SQL Server on a domain controller](../../sql-server/install/security-considerations-for-a-sql-server-installation.md#Install_DC)
39
+
-[Enhance physical security](#physical_security)
40
+
-[Use firewalls](#firewalls)
41
+
-[Isolate services](#isolated_services)
42
+
-[Configure a secure file system](#sa_with_least_privileges)
43
+
-[Disable NetBIOS and server message block](#disabled_protocols)
44
+
-[Installing SQL Server on a domain controller](../../sql-server/install/security-considerations-for-a-sql-server-installation.md#Install_DC)
Physical and logical isolation make up the foundation of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] security. To enhance the physical security of the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] installation, do the following tasks:
52
48
53
-
-Place the server in a room accessible only to authorized persons.
54
-
55
-
-Place computers that host a database in a physically protected location, ideally a locked computer room with monitored flood detection and fire detection or suppression systems.
56
-
57
-
-Install databases in the secure zone of the corporate intranet and do not connect your SQL Servers directly to the Internet.
58
-
59
-
-Back up all data regularly and secure the backups in an off-site location.
49
+
- Place the server in a room accessible only to authorized persons.
50
+
51
+
- Place computers that host a database in a physically protected location, ideally a locked computer room with monitored flood detection and fire detection or suppression systems.
52
+
53
+
- Install databases in the secure zone of the corporate intranet and do not connect your SQL Servers directly to the Internet.
54
+
55
+
- Back up all data regularly and secure the backups in an off-site location.
60
56
61
57
### <aname="firewalls"></a> Use Firewalls
62
58
Firewalls are important to help secure the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] installation. Firewalls will be most effective if you follow these guidelines:
63
59
64
-
-Put a firewall between the server and the Internet. Enable your firewall. If your firewall is turned off, turn it on. If your firewall is turned on, do not turn it off.
65
-
66
-
-Divide the network into security zones separated by firewalls. Block all traffic, and then selectively admit only what is required.
67
-
68
-
-In a multi-tier environment, use multiple firewalls to create screened subnets.
69
-
70
-
-When you are installing the server inside a Windows domain, configure interior firewalls to allow Windows Authentication.
71
-
72
-
-If your application uses distributed transactions, you might have to configure the firewall to allow [!INCLUDE[msCoName](../../includes/msconame-md.md)] Distributed Transaction Coordinator (MS DTC) traffic to flow between separate MS DTC instances. You will also have to configure the firewall to allow traffic to flow between the MS DTC and resource managers such as [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
73
-
60
+
- Put a firewall between the server and the Internet. Enable your firewall. If your firewall is turned off, turn it on. If your firewall is turned on, do not turn it off.
61
+
62
+
- Divide the network into security zones separated by firewalls. Block all traffic, and then selectively admit only what is required.
63
+
64
+
- In a multi-tier environment, use multiple firewalls to create screened subnets.
65
+
66
+
- When you are installing the server inside a Windows domain, configure interior firewalls to allow Windows Authentication.
67
+
68
+
- If your application uses distributed transactions, you might have to configure the firewall to allow [!INCLUDE[msCoName](../../includes/msconame-md.md)] Distributed Transaction Coordinator (MS DTC) traffic to flow between separate MS DTC instances. You will also have to configure the firewall to allow traffic to flow between the MS DTC and resource managers such as [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
69
+
74
70
For more information about the default Windows firewall settings, and a description of the TCP ports that affect the [!INCLUDE[ssDE](../../includes/ssde-md.md)], [!INCLUDE[ssASnoversion](../../includes/ssasnoversion-md.md)], [!INCLUDE[ssRSnoversion](../../includes/ssrsnoversion-md.md)], and [!INCLUDE[ssISnoversion](../../includes/ssisnoversion-md.md)], see [Configure the Windows Firewall to Allow SQL Server Access](../../sql-server/install/configure-the-windows-firewall-to-allow-sql-server-access.md).
Isolating services reduces the risk that one compromised service could be used to compromise others. To isolate services, consider the following guidelines:
78
74
79
-
-Run separate [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] services under separate Windows accounts. Whenever possible, use separate, low-rights Windows or Local user accounts for each [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] service. For more information, see [Configure Windows Service Accounts and Permissions](../../database-engine/configure-windows/configure-windows-service-accounts-and-permissions.md).
75
+
- Run separate [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] services under separate Windows accounts. Whenever possible, use separate, low-rights Windows or Local user accounts for each [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] service. For more information, see [Configure Windows Service Accounts and Permissions](../../database-engine/configure-windows/configure-windows-service-accounts-and-permissions.md).
80
76
81
77
### <aname="sa_with_least_privileges"></a> Configure a Secure File System
82
78
Using the correct file system increases security. For [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] installations, you should do the following tasks:
83
79
84
80
Use the NT file system (NTFS) or Resilient File System (ReFS). NTFS and ReFS are the recommended file system for installations of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] because it is more stable and recoverable than FAT32 file systems. NTFS or ReFS also enable security options like file and directory access control lists (ACLs). NTFS also supports Encrypting File System (EFS) - file encryption. During installation, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] will set appropriate ACLs on registry keys and files if it detects NTFS. These permissions should not be changed. Future releases of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] might not support installation on computers with FAT file systems.
85
81
86
82
> [!NOTE]
87
-
> If you use EFS, database files will be encrypted under the identity of the account running [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Only this account will be able to decrypt the files. If you must change the account that runs [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you must first decrypt the files under the old account and then re-encrypt them under the new service account.
88
-
89
-
> [!WARNING]
90
-
> Using file encryption via EFS may lead to slower I/O performance because encryption causes asynchronous I/O to become synchronous. See [Asynchronous disk I/O appears as synchronous on Windows](/troubleshoot/windows/win32/asynchronous-disk-io-synchronous#ntfs-encryption). Instead, you can sonsider using SQL Server encryption technologies like [Transparent Data Encryption (TDE)](/sql/relational-databases/security/encryption/transparent-data-encryption), [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine), and column-level encryption [T-SQL functions](/sql/t-sql/functions/cryptographic-functions-transact-sql).
83
+
> If you use EFS, database files will be encrypted under the identity of the account running [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Only this account will be able to decrypt the files. If you must change the account that runs [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], you must first decrypt the files under the old account and then re-encrypt them under the new service account.
84
+
85
+
> [!WARNING]
86
+
> Using file encryption via EFS may lead to slower I/O performance because encryption causes asynchronous I/O to become synchronous. See [Asynchronous disk I/O appears as synchronous on Windows](/troubleshoot/windows/win32/asynchronous-disk-io-synchronous#ntfs-encryption). Instead, you can sonsider using SQL Server encryption technologies like [Transparent Data Encryption (TDE)](/sql/relational-databases/security/encryption/transparent-data-encryption), [Always Encrypted](/sql/relational-databases/security/encryption/always-encrypted-database-engine), and column-level encryption [T-SQL functions](/sql/t-sql/functions/cryptographic-functions-transact-sql).
87
+
88
+
### <aname="disabled_protocols"></a> Disable NetBIOS and Server Message Block
91
89
92
-
### <aname="disabled_protocols"></a> Disable NetBIOS and Server Message Block
93
90
Servers in the perimeter network should have all unnecessary protocols disabled, including NetBIOS and server message block (SMB).
94
91
95
92
NetBIOS uses the following ports:
96
93
97
-
-UDP/137 (NetBIOS name service)
94
+
- UDP/137 (NetBIOS name service)
98
95
99
-
-UDP/138 (NetBIOS datagram service)
96
+
- UDP/138 (NetBIOS datagram service)
100
97
101
-
-TCP/139 (NetBIOS session service)
98
+
- TCP/139 (NetBIOS session service)
102
99
103
100
SMB uses the following ports:
104
101
105
-
-TCP/139
102
+
- TCP/139
106
103
107
-
-TCP/445
104
+
- TCP/445
108
105
106
+
::: mermaid
107
+
graph LR;
108
+
A[NetBIOS] --> B[UDP/137];
109
+
A[NetBIOS] --> C[UDP/138];
110
+
A[NetBIOS] --> D[TCP/139];
111
+
E[SMB] --> D[TCP/193];
112
+
E[SMB] --> P[TCP/445];
113
+
:::
114
+
109
115
Web servers and Domain Name System (DNS) servers do not require NetBIOS or SMB. On these servers, disable both protocols to reduce the threat of user enumeration.
110
116
111
-
### <aname="Install_DC"></a> Installing [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] on a domain controller
117
+
### <aname="Install_DC"></a> Installing [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] on a domain controller
118
+
112
119
For security reasons, we recommend that you do not install [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] on a domain controller. [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Setup will not block installation on a computer that is a domain controller, but the following limitations apply:
113
120
114
-
-You cannot run [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] services on a domain controller under a local service account.
121
+
- You cannot run [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] services on a domain controller under a local service account.
115
122
116
-
-After [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is installed on a computer, you cannot change the computer from a domain member to a domain controller. You must uninstall [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] before you change the host computer to a domain controller.
123
+
- After [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is installed on a computer, you cannot change the computer from a domain member to a domain controller. You must uninstall [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] before you change the host computer to a domain controller.
117
124
118
-
-After [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is installed on a computer, you cannot change the computer from a domain controller to a domain member. You must uninstall [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] before you change the host computer to a domain member.
125
+
- After [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] is installed on a computer, you cannot change the computer from a domain controller to a domain member. You must uninstall [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] before you change the host computer to a domain member.
119
126
120
-
-[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] failover cluster instances are not supported where cluster nodes are domain controllers.
127
+
-[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] failover cluster instances are not supported where cluster nodes are domain controllers.
121
128
122
-
-[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Setup cannot create security groups or provision [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] service accounts on a read-only domain controller. In this scenario, Setup will fail.
129
+
-[!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Setup cannot create security groups or provision [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] service accounts on a read-only domain controller. In this scenario, Setup will fail.
123
130
124
-
## During or After Installation of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]
131
+
## During or After Installation of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]
132
+
125
133
After installation, you can enhance the security of the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] installation by following these best practices regarding accounts and authentication modes:
126
134
127
-
**Service accounts**
135
+
### Service accounts
128
136
129
-
-Run [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] services by using the lowest possible permissions.
137
+
- Run [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] services by using the lowest possible permissions.
130
138
131
-
-Associate [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] services with low privileged Windows local user accounts, or domain user accounts.
139
+
- Associate [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] services with low privileged Windows local user accounts, or domain user accounts.
132
140
133
-
-For more information, see [Configure Windows Service Accounts and Permissions](../../database-engine/configure-windows/configure-windows-service-accounts-and-permissions.md).
141
+
- For more information, see [Configure Windows Service Accounts and Permissions](../../database-engine/configure-windows/configure-windows-service-accounts-and-permissions.md).
134
142
135
-
**Authentication mode**
143
+
### Authentication mode
136
144
137
-
-Require Windows Authentication for connections to [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
145
+
- Require Windows Authentication for connections to [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
138
146
139
-
-Use Kerberos authentication. For more information, see [Register a Service Principal Name for Kerberos Connections](../../database-engine/configure-windows/register-a-service-principal-name-for-kerberos-connections.md).
147
+
- Use Kerberos authentication. For more information, see [Register a Service Principal Name for Kerberos Connections](../../database-engine/configure-windows/register-a-service-principal-name-for-kerberos-connections.md).
140
148
141
-
**Strong passwords**
149
+
### Strong passwords
142
150
143
-
-Always assign a strong password to the **sa** account.
151
+
- Always assign a strong password to the **sa** account.
144
152
145
-
-Always enable password policy checking for password strength and expiration.
153
+
- Always enable password policy checking for password strength and expiration.
146
154
147
-
-Always use strong passwords for all [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] logins.
155
+
- Always use strong passwords for all [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] logins.
148
156
149
157
> [!IMPORTANT]
150
-
> During setup of [!INCLUDE[ssExpress](../../includes/ssexpress-md.md)] a login is added for the BUILTIN\Users group. This allows all authenticated users of the computer to access the instance of [!INCLUDE[ssExpress](../../includes/ssexpress-md.md)] as a member of the public role. The BUILTIN\Users login can be safely removed to restrict [!INCLUDE[ssDE](../../includes/ssde-md.md)] access to computer users who have individual logins or are members of other Windows groups with logins.
158
+
> During setup of [!INCLUDE[ssExpress](../../includes/ssexpress-md.md)] a login is added for the BUILTIN\Users group. This allows all authenticated users of the computer to access the instance of [!INCLUDE[ssExpress](../../includes/ssexpress-md.md)] as a member of the public role. The BUILTIN\Users login can be safely removed to restrict [!INCLUDE[ssDE](../../includes/ssde-md.md)] access to computer users who have individual logins or are members of other Windows groups with logins.
151
159
152
-
## See Also
160
+
## See Also
161
+
153
162
[Hardware and Software Requirements for Installing SQL Server](../../sql-server/install/hardware-and-software-requirements-for-installing-sql-server.md)
154
163
[Network Protocols and Network Libraries](../../sql-server/install/network-protocols-and-network-libraries.md)
155
164
[Register a Service Principal Name for Kerberos Connections](../../database-engine/configure-windows/register-a-service-principal-name-for-kerberos-connections.md)
0 commit comments