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(...

How to audit an Azure Cosmos DB

In this post, we will talk about how we can audit an Azure Cosmos DB database. Before jumping into the problem let us define the business requirement: As an Administrator I want to be able to audit all changes that were done to specific collection inside my Azure Cosmos DB. The requirement is simple, but can be a little tricky to implement fully. First of all when you are using Azure Cosmos DB or any other storage solution there are 99% odds that you’ll have more than one system that writes data to it. This means that you have or not have control on the systems that are doing any create/update/delete operations. Solution 1: Diagnostic Logs Cosmos DB allows us activate diagnostics logs and stream the output a storage account for achieving to other systems like Event Hub or Log Analytics. This would allow us to have information related to who, when, what, response code and how the access operation to our Cosmos DB was done. Beside this there is a field that specifies what was th...

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills)

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills) The idea that moving to the cloud reduces the costs is a common misconception. The cloud infrastructure provides flexibility, scalability, and better CAPEX, but it does not guarantee lower costs without proper optimisation and management of the cloud services and infrastructure. Idle and unused resources, overprovisioning, oversize databases, and unnecessary data transfer can increase running costs. The regional pricing mode, multi-cloud complexity, and cost variety add extra complexity to the cost function. Cloud adoption without a cost governance strategy can result in unexpected expenses. Improper usage, combined with a pay-as-you-go model, can result in a nightmare for business stakeholders who cannot track and manage the monthly costs. Cloud-native services such as AI services, managed databases, and analytics platforms are powerful, provide out-of-the-shelve capabilities, and increase business agility and innovation. H...