Context
When you create the infrastructure of a system, it is common to have two separate network. One that has access to public internet where front-end system are hosted (web pages, web services). Another network is without internet access, more protected from intruders. In this kind of secure network backend services are hosted, databases and other private services.
In this post we will do the following references:
As we can see above, from Public Internet a requests goes to the front-end layer (Blue Network). Systems that runs in the Blue Network can make a direct call to the Red Network systems directly. But a request cannot goes from Public Internet directly to the Red Network. Red Network configuration (e.g. routers, firewalls) don't allow requests from Public Internet.
Can we have such a network topology on Azure?
You might say no, because the first expectation is that all services and system that run in Azure are public available from internet. Don't be surprise if the response is YES, you can have such a network topology in Azure.
We can have as many Red Networks as we want, isolated from public internet, with machines that talk only with other machines from the network. The number of network layers that we want to create is unlimited, we can have 2 as above, but we can have 3, 4 or even 100.
Is this possible? How you can configure it and make changes?
Even if it might sounds strange at the beginning, this is possible to do. Each Virtual Networks created in Azure has some basic characteristics that allows a network to be 100% isolated from the rest of the network, even if it is running over the same infrastructure.
Virtual Networks characteristics that enable us to have isolated networks
How can we create a Virtual Network without access from internet?
To have a more concrete example, we will go on the previous example where we had the Blue and Red Network, where Red Network didn't had direct access to internet. Red Networks allows traffic only from Red Network of from Blue Network.
To be able to isolate Red Network we can use Network Security Rules, by defining the following rules:
When you create the infrastructure of a system, it is common to have two separate network. One that has access to public internet where front-end system are hosted (web pages, web services). Another network is without internet access, more protected from intruders. In this kind of secure network backend services are hosted, databases and other private services.
In this post we will do the following references:
- Blue Network - The network that had direct access to internet
- Red Network - The network that doesn't have access to internet and can be accessed only from internal systems
As we can see above, from Public Internet a requests goes to the front-end layer (Blue Network). Systems that runs in the Blue Network can make a direct call to the Red Network systems directly. But a request cannot goes from Public Internet directly to the Red Network. Red Network configuration (e.g. routers, firewalls) don't allow requests from Public Internet.
Can we have such a network topology on Azure?
You might say no, because the first expectation is that all services and system that run in Azure are public available from internet. Don't be surprise if the response is YES, you can have such a network topology in Azure.
We can have as many Red Networks as we want, isolated from public internet, with machines that talk only with other machines from the network. The number of network layers that we want to create is unlimited, we can have 2 as above, but we can have 3, 4 or even 100.
Is this possible? How you can configure it and make changes?
Even if it might sounds strange at the beginning, this is possible to do. Each Virtual Networks created in Azure has some basic characteristics that allows a network to be 100% isolated from the rest of the network, even if it is running over the same infrastructure.
Virtual Networks characteristics that enable us to have isolated networks
- Traffic Isolation - By default two virtual networks cannot communicate between each other. Packages are visible only in the same virtual network. It means that by default only VMs from the same networks can exchange data
- IP Forwarding and User Defined Routes (UDR) - Support for different virtual appliances (e.g IDS/IPS, firewalls) that route traffic between virtual networks and to the internet.
- Network Security Groups (NGS) - Allows us to define ACLs rules that control the communication level at VMs, network interface and virtual subnets. In this way there is full control on who can communicate with what.
- Cross-premises connectivity - A virtual network can be configured in a such a way to be able to communicate with another virtual network or with an on-premises network using mechanism like Azure VPN, Express Router, S2S VPN and so on.
- Multi-tier topology - By allocated subnets and having separate address groups based on our system model we can define inside a virtual network different communication policies.
Using this mechanism, a virtual network can be protected from public internet. All traffic that comes from other virtual network or from public internet needs to go through firewalls, VPNs devices, NGS and UDR rules that will allow only allowed traffic to reach the virtual network systems.
The most important layer of virtual network is so called internet facing layer. This layer consist of:
- Public IP addresses
- Virtual IPs (VIPs)
- Service endpoints
- Subnet that has direct access to internet
- Inbound traffic to virtual network
- Outbound traffic that goes from virtual network to public internet
, where content is filtered by firewalls, UDR, NGS and other virtual appliances that can drop packages that are not allowed to go in/out of a virtual network or a subnet.
How can we create a Virtual Network without access from internet?
To have a more concrete example, we will go on the previous example where we had the Blue and Red Network, where Red Network didn't had direct access to internet. Red Networks allows traffic only from Red Network of from Blue Network.
To be able to isolate Red Network we can use Network Security Rules, by defining the following rules:
- Allow traffic on port 53 (DNS traffic canonical port)
- Allow traffic on port 3389 (RDP). If we don't want remote access on VMs from Red Network from internet we should not add this rule.
- All traffic from internet our Firewall is allowed.
- All traffic from specific Blue Network VMs to specific Red Network VMs is allowed.
- All traffic from internet to Blue and Red Network is denied (rule 3 will apply before and will redirect traffic to firewall).
- All traffic from any Blue Network to Red Network is denied.
- All traffic from Red Network to Blue Network is allowed.
- All traffic from Red Network is denied.
Remember that rules in NGS are checked based on their order. If rule 4 applies, then no check for rule 5-8 will be done for the same package and so on. If you want allow all traffic from Blue to Red Network to be allowed, then remove rule 6 and change rule 4 in "All traffic from Blue Network VMs to Red Network VMs is allowed"
More complex rules can be defined, where we can restrict ports ranges or even what VMs from specific networks can be accessed.
Remarks: If we want RDP access on in Red Network. but without open RDP ports to the public internet we can configure a Point to Site VPN or a Site to Site VPN. In this way only from our local machined RDPs connection would be allowed or from our S2S network.
Additional to NGS rules, we need to define firewall rules at Blue Network level to redirect traffic from port 80, 443 to our portal and web services. We might want to redirect portal from a specific CNAME to our portal and portal another CNAME to our web services endpoint. For this we need a firewall as network virtual appliance.
What are Virtual Appliance?
A virtual appliance is just another VM in your VNet that runs a software based appliance function, such as firewall, WAN optimization, or intrusion detection. You can create a route in Azure to route your VNet traffic through a virtual appliance to use its capabilities. For instance, NSGs can be used to provide security on your VNet. However, NSGs provide layer 4 Access Control List (ACL) to incoming and outgoing packets. If you want to use a layer 7 security model, you need to use a firewall appliance.
(Virtual) Network Appliance in Azure world is represented in general by VMs that allows us to to have virtual appliance like firewalls from 3rd parties vendors or as services like Azure VPN Gateway or Azure Application Gateway.
Most of the Network Appliance that are provided by Microsoft runs on top of custom hardware, in contrast with the one offered by 3rd parties that are running on VMs. From 3rd parties vendors, the most common are firewalls, when people prefer that all traffic that is coming from internet to go through a firewall (with custom rules and filters) before hitting internal endpoints.
Conclusion
As we seen above, Azure allows us to define virtual networks that are completely isolated from public internet.
Even if the job is easy I highly recommend to have a infrastructure guy to review the topology, architecture and rules that needs to be defined. For example rule 6 - "All traffic from any Blue Network to Red Network is denied." was defined for the cases when somebody get access to Blue Network but not the machines that can communicate from/to Blue/Red Network.
If you want to use features such as Azure backup, monitoring, etc, the Red Network VM's will need to access the Azure Public DC's, whether that is by proxy or firewall rule (SSL TCP 443 primarily, but some HTTP TCP 80 too). There are over 600 networks defined for these public DC's, so using a UDR is not realistically possible.
ReplyDeleteJust something to consider when architecting the infrastructure
This is correct. 100% valid.
DeleteWhen you start to use features of Azure like Azure Backup or other services clients need to take into account that they need to open/relay there rules because external access is required.