Skip to main content

Blue and Red Network Topology in Azure (Virtual Network without internet access)

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:

  • 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

  1. 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
  2. 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. 
  3. 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.
  4. 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.
  5. 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:

  1. Allow traffic on port 53 (DNS traffic canonical port)
  2. 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.
  3. All traffic from internet our Firewall is allowed.
  4. All traffic from specific Blue Network VMs to specific Red Network VMs is allowed.
  5. All traffic from internet to Blue and Red Network is denied (rule 3 will apply before and will redirect traffic to firewall).
  6. All traffic from any Blue Network to Red Network is denied.
  7. All traffic from Red Network to Blue Network is allowed.
  8. 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. 

Comments

  1. 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.
    Just something to consider when architecting the infrastructure

    ReplyDelete
    Replies
    1. This is correct. 100% valid.
      When 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.

      Delete

Post a Comment

Popular posts from this blog

Windows Docker Containers can make WIN32 API calls, use COM and ASP.NET WebForms

After the last post , I received two interesting questions related to Docker and Windows. People were interested if we do Win32 API calls from a Docker container and if there is support for COM. WIN32 Support To test calls to WIN32 API, let’s try to populate SYSTEM_INFO class. [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } ... [DllImport("kernel32")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); ... SYSTEM_INFO pSI = new SYSTEM_INFO(

Azure AD and AWS Cognito side-by-side

In the last few weeks, I was involved in multiple opportunities on Microsoft Azure and Amazon, where we had to analyse AWS Cognito, Azure AD and other solutions that are available on the market. I decided to consolidate in one post all features and differences that I identified for both of them that we should need to take into account. Take into account that Azure AD is an identity and access management services well integrated with Microsoft stack. In comparison, AWS Cognito is just a user sign-up, sign-in and access control and nothing more. The focus is not on the main features, is more on small things that can make a difference when you want to decide where we want to store and manage our users.  This information might be useful in the future when we need to decide where we want to keep and manage our users.  Feature Azure AD (B2C, B2C) AWS Cognito Access token lifetime Default 1h – the value is configurable 1h – cannot be modified

What to do when you hit the throughput limits of Azure Storage (Blobs)

In this post we will talk about how we can detect when we hit a throughput limit of Azure Storage and what we can do in that moment. Context If we take a look on Scalability Targets of Azure Storage ( https://azure.microsoft.com/en-us/documentation/articles/storage-scalability-targets/ ) we will observe that the limits are prety high. But, based on our business logic we can end up at this limits. If you create a system that is hitted by a high number of device, you can hit easily the total number of requests rate that can be done on a Storage Account. This limits on Azure is 20.000 IOPS (entities or messages per second) where (and this is very important) the size of the request is 1KB. Normally, if you make a load tests where 20.000 clients will hit different blobs storages from the same Azure Storage Account, this limits can be reached. How we can detect this problem? From client, we can detect that this limits was reached based on the HTTP error code that is returned by HTTP