title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | helpviewer_keywords | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Security Considerations |
This article discusses some security best practices that you should consider both before and after you install SQL Server. |
MikeRayMSFT |
mikeray |
11/22/2021 |
sql |
security |
conceptual |
|
[!INCLUDE SQL Server -Windows Only]
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 [!INCLUDEssNoVersion] and after you install [!INCLUDEssNoVersion]. Security guidance for specific features is included in the reference articles for those features.
Before Installing [!INCLUDEssNoVersion]
Follow these best practices when you set up the server environment:
- Enhance physical security
- Use firewalls
- Isolate services
- Configure a secure file system
- Disable NetBIOS and server message block
- Installing SQL Server on a domain controller
Physical and logical isolation make up the foundation of [!INCLUDEssNoVersion] security. To enhance the physical security of the [!INCLUDEssNoVersion] installation, do the following tasks:
-
Place the server in a room accessible only to authorized persons.
-
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.
-
Install databases in the secure zone of the corporate intranet and do not connect your SQL Server instances directly to the Internet.
-
Back up all data regularly and secure the backups in an off-site location.
Firewalls are important to help secure the [!INCLUDEssNoVersion] installation. Firewalls will be most effective if you follow these guidelines:
-
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.
-
Divide the network into security zones separated by firewalls. Block all traffic, and then selectively admit only what is required.
-
In a multi-tier environment, use multiple firewalls to create screened subnets.
-
When you are installing the server inside a Windows domain, configure interior firewalls to allow Windows Authentication.
-
If your application uses distributed transactions, you might have to configure the firewall to allow [!INCLUDEmsCoName] 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 [!INCLUDEssNoVersion].
For more information about the default Windows firewall settings, and a description of the TCP ports that affect the [!INCLUDEssDE], [!INCLUDEssASnoversion], [!INCLUDEssRSnoversion], and [!INCLUDEssISnoversion], see Configure the Windows Firewall to Allow SQL Server Access.
Isolating services reduces the risk that one compromised service could be used to compromise others. To isolate services, consider the following guidelines:
- Run separate [!INCLUDEssNoVersion] services under separate Windows accounts. Whenever possible, use separate, low-rights Windows or Local user accounts for each [!INCLUDEssNoVersion] service. For more information, see Configure Windows Service Accounts and Permissions.
Using the correct file system increases security. For [!INCLUDEssNoVersion] installations, you should do the following tasks:
Use the NT file system (NTFS) or Resilient File System (ReFS). NTFS and ReFS are the recommended file system for installations of [!INCLUDEssNoVersion] 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, [!INCLUDEssNoVersion] will set appropriate ACLs on registry keys and files if it detects NTFS. These permissions should not be changed. Future releases of [!INCLUDEssNoVersion] might not support installation on computers with FAT file systems.
Note
If you use EFS, database files will be encrypted under the identity of the account running [!INCLUDEssNoVersion]. Only this account will be able to decrypt the files. If you must change the account that runs [!INCLUDEssNoVersion], you must first decrypt the files under the old account and then re-encrypt them under the new service account.
Warning
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. Instead, you can consider using SQL Server encryption technologies like Transparent Data Encryption (TDE), Always Encrypted, and column-level encryption T-SQL functions.
Servers in the perimeter network should have all unnecessary protocols disabled, including NetBIOS and server message block (SMB).
NetBIOS uses the following ports:
-
UDP/137 (NetBIOS name service)
-
UDP/138 (NetBIOS datagram service)
-
TCP/139 (NetBIOS session service)
SMB uses the following ports:
-
TCP/139
-
TCP/445
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.
Installing [!INCLUDEssNoVersion] on a domain controller
For security reasons, we recommend that you do not install [!INCLUDEssNoVersion] on a domain controller. [!INCLUDEssNoVersion] Setup will not block installation on a computer that is a domain controller, but the following limitations apply:
-
You cannot run [!INCLUDEssNoVersion] services on a domain controller under a local service account.
-
After [!INCLUDEssNoVersion] is installed on a computer, you cannot change the computer from a domain member to a domain controller. You must uninstall [!INCLUDEssNoVersion] before you change the host computer to a domain controller.
-
After [!INCLUDEssNoVersion] is installed on a computer, you cannot change the computer from a domain controller to a domain member. You must uninstall [!INCLUDEssNoVersion] before you change the host computer to a domain member.
-
[!INCLUDEssNoVersion] failover cluster instances are not supported where cluster nodes are domain controllers.
-
[!INCLUDEssNoVersion] Setup cannot create security groups or provision [!INCLUDEssNoVersion] service accounts on a read-only domain controller. In this scenario, Setup will fail.
During or After Installation of [!INCLUDEssNoVersion]
After installation, you can enhance the security of the [!INCLUDEssNoVersion] installation by following these best practices regarding accounts and authentication modes:
-
Run [!INCLUDEssNoVersion] services by using the lowest possible permissions.
-
Associate [!INCLUDEssNoVersion] services with low privileged Windows local user accounts, or domain user accounts.
-
For more information, see Configure Windows Service Accounts and Permissions.
-
Require Windows Authentication for connections to [!INCLUDEssNoVersion].
-
Use Kerberos authentication. For more information, see Register a Service Principal Name for Kerberos Connections.
-
Always assign a strong password to the sa account.
-
Always enable password policy checking for password strength and expiration.
-
Always use strong passwords for all [!INCLUDEssNoVersion] logins.
Important
During setup of [!INCLUDEssExpress] a login is added for the BUILTIN\Users group. This allows all authenticated users of the computer to access the instance of [!INCLUDEssExpress] as a member of the public role. The BUILTIN\Users login can be safely removed to restrict [!INCLUDEssDE] access to computer users who have individual logins or are members of other Windows groups with logins.
Hardware and Software Requirements for Installing SQL Server
Network Protocols and Network Libraries
Register a Service Principal Name for Kerberos Connections