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

How to check in AngularJS if a service was register or not

There are cases when you need to check in a service or a controller was register in AngularJS.
For example a valid use case is when you have the same implementation running on multiple application. In this case, you may want to intercept the HTTP provider and add a custom step there. This step don’t needs to run on all the application, only in the one where the service exist and register.
A solution for this case would be to have a flag in the configuration that specify this. In the core you would have an IF that would check the value of this flag.
Another solution is to check if a specific service was register in AngularJS or not. If the service was register that you would execute your own logic.
To check if a service was register or not in AngularJS container you need to call the ‘has’ method of ‘inhector’. It will return TRUE if the service was register.
if ($injector.has('httpInterceptorService')) { $httpProvider.interceptors.push('httpInterceptorService&#…

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine:
threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration:

TeamCity.NET 4.51EF 6.0.2VS2013
It seems that there …

Run native .NET application in Docker (.NET Framework 4.6.2)

Scope
The main scope of this post is to see how we can run a legacy application written in .NET Framework in Docker.

Context
First of all, let’s define what is a legacy application in our context. By a legacy application we understand an application that runs .NET Framework 3.5 or higher in a production environment where we don’t have any more the people or documentation that would help us to understand what is happening behind the scene.
In this scenarios, you might want to migrate the current solution from a standard environment to Docker. There are many advantages for such a migration, like:

Continuous DeploymentTestingIsolationSecurity at container levelVersioning ControlEnvironment Standardization
Until now, we didn’t had the possibility to run a .NET application in Docker. With .NET Core, there was support for .NET Core in Docker, but migration from a full .NET framework to .NET Core can be costly and even impossible. Not only because of lack of features, but also because once you…