Service endpoints and personal endpoints hands-on: together with Azure Spine, storage account firewall, DNS, VNET and NSGs
Storage accounts play an important function in a medallion structure for establishing an enterprise information lake. They act as a centralized repository, enabling seamless information alternate between producers and shoppers. This setup empowers shoppers to carry out information science duties and construct machine studying (ML) fashions. Moreover, shoppers can use the information for Retrieval Augmented Era (RAG), facilitating interplay with firm information by means of Giant Language Fashions (LLMs) like ChatGPT.
Extremely delicate information is often saved within the storage account. Protection in depth measures should be in place earlier than information scientists and ML pipelines can entry the information. To do protection in depth, a number of measurement shall be in place comparable to 1) superior menace safety to detect malware, 2) authentication utilizing Microsoft Entra, 3) authorization to do tremendous grained entry management, 4) audit path to observe entry, 5) information exfiltration prevention, 6) encryption, and final however not least 7) community entry management utilizing service endpoint or non-public endpoints.
This text focuses on community entry management of the storage account. Within the subsequent chapter, the totally different ideas are defined (demystified) on storage account community entry. Following that, a hands-on comparability is finished between service endpoint and personal endpoints. Lastly, a conclusion is drawn.
A typical situation is {that a} digital machine must have community entry to a storage account. This digital machine typically acts as a Spark cluster to research information from the storage account. The picture under supplies an outline of the out there community entry controls.
The elements within the picture might be described as follows:
Azure world community — spine: Visitors at all times goes over Azure spine between two areas (until buyer forces to not do it), see additionally Microsoft world community — Azure | Microsoft Be taught. That is no matter what firewall rule is used within the storage account and regardless whether or not service endpoints or non-public endpoints are used.
Azure storage firewalls: Firewall guidelines can limit or disable public entry. Widespread guidelines embody whitelisting VNET/subnet, public IP addresses, system-assigned managed identities as useful resource situations, or permitting trusted companies. When a VNET/subnet is whitelisted, the Azure Storage account identifies the visitors’s origin and its non-public IP tackle. Nevertheless, the storage account itself shouldn’t be built-in into the VNET/subnet — non-public endpoints are wanted for that objective.
Public DNS storage account: Storage accounts will at all times have a public DNS that may be entry by way of community tooling, see additionally Azure Storage Account — Public Entry Disabled — however nonetheless some stage of connectivity — Microsoft Q&A. That’s, even when public entry is disabled within the storage account firewall, the general public DNS will stay.
Digital Community (VNET): Community through which digital machines are deployed. Whereas a storage account is rarely deployed inside a VNET, the VNET might be whitelisted within the Azure storage firewall. Alternatively, the VNET can create a non-public endpoint for safe, non-public connectivity.
Service endpoints: When whitelisting a VNET/subnet within the Storage account firewall, the service endpoint should be turned on for the VNET/subnet. The service endpoint ought to be Microsoft.Storage when the VNET and storage account are in the identical area or Microsoft.Storage.World when the VNET and storage are in numerous areas. Be aware that service endpoints can also be used as an overarching time period, encompassing each the whitelisting of a VNET/subnet on the Azure Storage Firewall and the enabling of the service endpoint on the VNET/subnet.
Personal endpoints: Integrating a Community Interface Card (NIC) of a Storage Account throughout the VNET the place the digital machine operates. This integration assigns the storage account a non-public IP tackle, making it a part of the VNET.
Personal DNS storage account: Inside a VNET, a non-public DNS zone might be created through which the storage account DNS resolves to the non-public endpoint. That is to guarantee that digital machine can nonetheless connect with the URL of the storage account and the URL of the storage account resolves to a non-public IP tackle quite than a public tackle.
Community Safety Group (NSG): Deploy an NSG to restrict inbound and outbound entry of the VNET the place the digital machine runs. This may forestall information exfiltration. Nevertheless, an NSG works solely with IP addresses or tags, not with URLs. For extra superior information exfiltration safety, use an Azure Firewall. For simplicity, the article omits this and makes use of NSG to dam outbound visitors.
Within the subsequent chapter, service endpoints and personal endpoints are mentioned.
The chapter begins by exploring the situation of unrestricted community entry. Then the main points of service endpoints and personal endpoints are mentioned with sensible examples.
3.1 Not limiting community entry — public entry enabled
Suppose the next situation through which a digital machine and a storage account is created. The firewall of the storage account has public entry enabled, see picture under.
Utilizing this configuration, a the digital machine can entry the storage account over the community. For the reason that digital machine can also be deployed in Azure, visitors will go over Azure Spine and will probably be accepted, see picture under.
Enterprises sometimes set up firewall guidelines to restrict community entry. This includes disabling public entry or permitting solely chosen networks and whitelisting particular ones. The picture under illustrates public entry being disabled and visitors being blocked by the firewall.
Within the subsequent paragraph, service endpoints and chosen community firewall guidelines are used to grant community entry to storage account once more.
3.2 Limiting community entry by way of Service endpoints
To allow digital machine VNET entry to the storage account, activate the service endpoint on the VNET. Use Microsoft.Storage for throughout the areas or Microsoft.Storage.World for cross area. Subsequent, whitelist the VNET/subnet within the storage account firewall. Visitors is then blocked once more, see additionally picture under.
Visitors is now accepted. When VNET/subnet is faraway from Azure storage account firewall or public entry is disabled, then visitors is blocked once more.
In case an NSG is used to dam public outbound IPs within the VNET of the digital machine, then visitors can also be blocked once more. It is because the general public DNS of the storage account is used, see additionally picture under.
In that case, non-public endpoints shall be used to guarantee that visitors doesn’t depart VNET. That is mentioned within the subsequent chapter.
3.3 Limiting entry by way of Personal endpoints
To reestablish community entry for the digital machine to the storage account, use a non-public endpoint. This motion creates a community interface card (NIC) for the storage account throughout the VNET of the digital machine, guaranteeing that visitors stays throughout the VNET. The picture under supplies additional illustration.
Once more, an NSG can be utilized once more to dam all visitors, see picture under.
That is nonetheless counterintuitive, since first a non-public endpoint is created within the VNET after which visitors is blocked by NSG in the identical VNET.
Enterprise at all times requires community guidelines in place to restrict community entry to their storage account. On this weblog submit, each service endpoints and personal endpoint are thought-about to restrict entry.
Each is true for service endpoints and personal endpoints:
For service endpoints, the next maintain:
- Requires to allow service endpoints on VNET/subnet and whitelisting of VNET/subnet in Azure storage account firewall.
- Requires that visitors leaves the VNET of the digital machine that’s connecting to the storage account. See above, the visitors stays on the Azure spine.
For personal endpoints, the next maintain:
- Public entry might be disabled within the Azure Storage firewall. See above, public DNS entry of storage account will stay.
- Visitors doesn’t depart the VNET through which the digital machine additionally runs.
There are a variety of different issues to contemplate whether or not to make use of service endpoints or non-public endpoints (prices, migration effort since service endpoints have been on the market longer than non-public endpoints, networking complexity when utilizing non-public endpoints, restricted service endpoint help of newer Azure companies, laborious restrict of quantity non-public endpoints in storage account of 200).
Nevertheless, in case it’s required (“should have”) that 1) visitors shall by no means depart VNET/subnet of digital machine or 2) it isn’t allowed to create firewall guidelines in Azure storage firewall and should be locked down, then service endpoint shouldn’t be possible.
In different situations, it’s doable to contemplate each options, and the most effective match ought to be decided primarily based on the particular necessities of every situation.