Evenimente
29 apr., 14 - 30 apr., 19
Alăturați-vă evenimentului virtual Windows Server din 29-30 aprilie pentru sesiuni tehnice aprofundate și întrebări și răspunsuri live cu inginerii Microsoft.
Înregistrați-vă acumAcest browser nu mai este acceptat.
Faceți upgrade la Microsoft Edge pentru a profita de cele mai noi funcții, actualizări de securitate și asistență tehnică.
As a defense in depth measure, you can use segmentation and isolation techniques to secure SMB traffic and reduce threats between devices on your network.
SMB is used for file sharing, printing, and inter-process communication such as named pipes and RPC. It's also used as a network data fabric for technologies such as Storage Spaces Direct, Storage Replica, Hyper-V Live Migration, and Cluster Shared Volumes. Use the following sections to configure SMB traffic segmentation and endpoint isolation to help prevent outbound and lateral network communications.
Block TCP port 445 inbound from the internet at your corporate hardware firewalls. Blocking inbound SMB traffic protects devices inside your network by preventing access from the internet.
If you want users to access their files inbound at the edge of your network, you can use SMB over QUIC. This uses UDP port 443 by default and provides a TLS 1.3-encrypted security tunnel like a VPN for SMB traffic. The solution requires Windows 11 and Windows Server 2022 Datacenter: Azure Edition file servers running on Azure Local. For more information, see SMB over QUIC.
Block TCP port 445 outbound to the internet at your corporate firewall. Blocking outbound SMB traffic prevents devices inside your network from sending data using SMB to the internet.
It is unlikely you need to allow any outbound SMB using TCP port 445 to the internet unless you require it as part of a public cloud offering. The primary scenarios include Azure Files and Office 365.
If you are using Azure Files SMB, use a VPN for outbound VPN traffic. By using a VPN, you restrict the outbound traffic to the required service IP ranges. For more information about Azure Cloud and Office 365 IP address ranges, see:
Azure IP ranges and service tags:
The JSON files are updated weekly and include versioning both for the full file and each individual service tag. The AzureCloud tag provides the IP ranges for the cloud (Public, US government, Germany, or China) and is grouped by region within that cloud. Service tags in the file will increase as Azure services are added.
With Windows 11 and Windows Server 2022 Datacenter: Azure Edition, you can use SMB over QUIC to connect to file servers in Azure. This uses UDP port 443 by default and provides a TLS 1.3-encrypted security tunnel like a VPN for the SMB traffic. For more information, see SMB over QUIC.
By inventorying your network's SMB traffic, you get an understanding of traffic that is occurring and can determine if it's necessary. Use the following checklist of questions to help identify unnecessary SMB traffic.
For server endpoints:
For client endpoints:
For all endpoints, determine if you allow outbound SMB in the safest and most minimal fashion.
Review server built-in roles and features that require SMB inbound. For example, file servers and domain controllers require SMB inbound to do their role. For more information on built-in roles and feature network port requirements, see Service overview and network port requirements for Windows.
Review servers that need to be accessed from inside the network. For example, domain controllers and file servers likely need to be accessed anywhere in the network. However, application server access may be limited to a set of other application servers on the same subnet. You can use the following tools and features to help you inventory SMB access:
Get-FileShareInfo
command from the AZSBTools module set to examine shares on servers and clients.Security Settings\Advanced Audit Policy Configuration\Audit Policies\Object Access\File Share
. Since the number of events may be large, consider enabling for a specified amount of time or use Azure Monitor.Examining SMB logs lets you know which nodes are communicating with endpoints over SMB. You can decide if an endpoint's shares are in use and understand which to exist.
Use firewall rules to add extra connection security. Configure rules to block both inbound and outbound communications that include exceptions. An outbound firewall policy that prevents use of SMB connections both outside and inside your managed network while allowing access to the minimum set of servers and no other devices is a lateral defense-in-depth measure.
For information on the SMB firewall rules you need to set for inbound and outbound connections, see the support article Preventing SMB traffic from lateral connections and entering or leaving the network.
The support article includes templates for:
To use the null encapsulation IPSEC authentication, you must create a Security Connection rule on all computers in your network that are participating in the rules. Otherwise, the firewall exceptions won't work and you'll only be arbitrarily blocking.
Atenție
You should test the Security Connection rule before broad deployment. An incorrect rule could prevent users from accessing their data.
To create a Connection Security rule, use Windows Defender Firewall with Advanced Security control panel or snap-in:
Remember, the Connection Security rule must be created on all clients and servers participating in your inbound and outbound rules or they will be blocked from connecting SMB outbound. These rules may already be in place from other security efforts in your environment and like the firewall inbound/outbound rules, can be deployed via group policy.
When configuring rules based on the templates in the Preventing SMB traffic from lateral connections and entering or leaving the network support article, set the following to customize the Allow the connection if secure action:
The Allow the connection if it is secure option allows override of a global block rule. You can use the easy but least secure Allow the connection to use null encapsulation with *override block rules, which relies on Kerberos and domain membership for authentication. Windows Defender Firewall allows for more secure options like IPSEC.
For more information about configuring the firewall, see Windows Defender Firewall with Advanced Security deployment overview.
Beginning with Windows 11, version 24H2 and Windows Server 2025, the built-in firewall rules doesn't contain the SMB NetBIOS ports anymore. In earlier versions of Windows Server, when you created a share, the firewall automatically enabled certain rules in the File and Printer Sharing group. In particular, the built-in firewall automatically used inbound NetBIOS ports 137 through 139. Shares made with SMB2 or later don't use NetBIOS ports 137-139. If you need to use an SMB1 server for legacy compatibility reasons, you must manually reconfigure the firewall to open those ports
We made this change to improve network security. This change brings SMB firewall rules more in line with the standard behavior for the Windows Server File Server role. By default, the firewall rule only open the minimum number of ports required for sharing data. Administrators can reconfigure the rules to restore the legacy ports.
Windows clients and some of your Windows Servers on your network may not require the SMB Server service to be running. If the SMB Server service isn't required, you can disable the service. Before disabling SMB Server service, be sure no applications and processes on the computer require the service.
You can use Group Policy Preferences to disable the service on a large number of machines when you are ready to implement. For more information about configuring Group Policy Preferences, see Configure a Service Item.
Begin by testing using small-scale, hand-made deployments on select servers and clients. Use phased group policy rollouts to make these changes. For example, start with the heaviest user of SMB such as your own IT team. If your team's laptops and apps and file share access work well after deploying your inbound and outbound firewall rules, create test group policy within your broad test and QA environments. Based on results, start sampling some departmental machines, then expand out.
Watch Jessica Payne's Ignite conference session Demystifying the Windows Firewall
Evenimente
29 apr., 14 - 30 apr., 19
Alăturați-vă evenimentului virtual Windows Server din 29-30 aprilie pentru sesiuni tehnice aprofundate și întrebări și răspunsuri live cu inginerii Microsoft.
Înregistrați-vă acum