Azure NSG Private IP Congfiguration (WhiteList)Vnet to Vnet communication - azure

I have situation where I want to open my Vnet(lets say Vnet1) for other Vnets (which has private IP range defined ) , I am thinking to use NSG rules and allow private IP ranges of other Vnets (lets say Vnet2 , Vnet3) to this entry point Subnet(in Vnet1) which host my API gateway .
I have two questions :
I assume it should be feasible using private IP addresses and allowing them using NSG (of Vnet 1/Subnet 1) ? I am not looking for peering/s2s vpn of Vnet as both belongs to separate teams and Vnet2/Vnet3 just wanted to access APis of Vnet1 using Api gateway.
Is there any security issues which we foresee , I assume it safe to expose since these are private IPs and can not be accesses from internet .
Please let me know opinion on feasibility and security .
Thanks
Xslguy

To help others who might find the same scenario, just extract the useful information in the comment and write my answer.
An Azure VNet is a logical isolation of Azure cloud dedication to your subscription. VNet peering allows traffic between two VNets is routed through Microsoft's private network only. If the VNETs haven't peered, vnet1 will not connect to resources in vnet2 by using private IP but using the public IP of the resources in vnet2. In this case, we need to restrict the source public IP for the inbound rules in the NSG attached to the subnet. With VNet peering, you also could restrict the access from one subnet to another subnet by using source private IP for the inbound rules in the NSG attached to the subnet.
From Security rules:
If you specify an address for an Azure resource, specify the private
IP address assigned to the resource. Network security groups are
processed after Azure translates a public IP address to a private IP
address for inbound traffic, and before Azure translates a private IP
address to a public IP address for outbound traffic.

Related

ExpressRoute - Private Peering - Storage Account Firewall

Have a storage account that I need to enable the firewall on. I've already put in place private endpoints and create the necessary Private DNS domains to allow privatelink.blob.core.windows.net to work correctly (on-premises requests resolve to the correct RFC1918 address). The issue I have is with locking down the storage account.
I am unable to specify the on-prem IP ranges since they are RFC1918 addresses. The only way I can see to allow access is via VNet/Subnet or via an explicit public IP address. I've read a bit about using the NAT address of the ExpressRoute but that seems to only pertain to Microsoft or public peering. There shouldn't be any NAT happening.
For reference. The ER is terminating into a hub and the VNet where the storage endpoint is located is peered with this hub.
Thanks,
Nathan
Network Security Group (NSG) support for private endpoints is in public preview. (Preview features do not have the same SLA's as generally available features and are not recommended for production.) Depending on your region, you may be able to use this feature: https://azure.microsoft.com/en-us/updates/public-preview-of-private-link-network-security-group-support/
An NSG could be associated with each subnet that contains a private endpoint to the storage account. An inbound rule could then be added to the NSG that allows traffic from the on-premises IP's to the private endpoint IP's.
Maybe it's too late for the answer, but you need a DNS conditional forward for the onprem workloads to work with private endpoints. If you don't use it, you will always resolve the query to the public endpoint instead of the private one.
https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-dns

Where can I found the configuration of my VNet with my Web-App on Azure?

The scenario in here is that I have created a WebApp which has Dynamic Outbound IPs, and we needed those IPs to get whitelisted on the DB side, Since there were too many IPs, we created a NAT Gateway, VNet and a single Public IP address through which we will communicate to the DB.
I need to know where lies the configuration for VNet with my Azure web app?
You need to whitelist the public IP address to your firewall of DB because NAT provides source network address translation (SNAT) for a subnet.
NAT gateway resources specify which static IP addresses virtual
machines use when creating outbound flows. Static IP addresses come
from public IP address resources, public IP prefix resources, or both.
If a public IP prefix resource is used, all IP addresses of the entire
public IP prefix resource are consumed by a NAT gateway resource. A
NAT gateway resource can use a total of up to 16 static IP addresses
from either.
If you have enabled web app with VNet Integration, By default, BGP routes affect only your RFC1918 destination traffic. If WEBSITE_VNET_ROUTE_ALL is set to 1, all outbound traffic can be affected by your BGP routes.

Azure VNET peering v/s NSG exception

I am new to azure and trying to understand the concept behind VNet peering
I Have two VM First in East US and another in East Asia
By the design of AZURE, i should not be able to access any data between these VM as AZURE does not allow communication between two different VNET and to allow the communication, one may use VNET Peering !!, Correct ?
But when i add a firewall exception from VM 1 to VM 2 i am able to access the data OR when i create a VNET Peering the same happens, Can someone please share me the difference of both and what is the requirement of VNET Peering when the same can be achieved by adding firewall exception
By default when you configure a peering it has full access between vnet's. You can use nsg (network security group) to block specific traffic.
A peering connection means that you are going to have connection between vnet's from private ip, for example vnet-a 10.0.0.0/16 can only access vnet-b 192.168.0.0/16 if it has a peering connection, because those ip's (address space) are privates. When you say firewall exception, you probably configured your private ip in your nsg, it is correct, you must specify your private ip to have access from internet, not your public ip, it is how Azure has designed nsg rules. For a example, your VM's public ip is 201.200.200.15, and private ip is 10.0.0.4, in order to allow this VM to be accesible from internet, you must put your private ip 10.0.0.4 in your nsg rules, not your public ip.
From Azure portal, go to both VM blades and check public and private IP, without a peering connection you won't be able to connect each other using private IP, but using public IP you can without peering.

azure - static outgoing ip for all VMs in a vnet

I have multiple VMs in a vnet. Vnet has a static ip attached to it's interface. The network interfaces attached to individual VMs do not have any public ip associated. My expectation is that all outgoing traffic would get routed through the vnet ip, but it isn't the case. Each VM has a different public going IP. I have tried using curl ipinfo.io to test.
I need to ensure that all of the internet traffic from any VM in the vnet would get routed through a static ip address.
All outgoing traffic from the vnet should go through the same IP. I
want to whitelist this ip in my external services.
If your VMs deploy in ASM module, all the VMs in the same cloud service use the same public IP.
If your VMs deploy in ARM module, and want all VMs in the Vnet outgoing traffic through the same public IP address, we can use internet load balancer.
Also we can deploy S2S VPN between them, so we can add the public IP address to whitelist.

getting a block of public IP subnet from microsoft

Does anyone know if its possible to have my corporate azure account to be assigned a block (e.g. subnet) of azure public IP within a region to make it easier to create firewall rules for my corporate firewall which blocks most outgoing ports.
Our customer does not want anyone sourced inside from the corporate .com account to have access to all 22 and 3389 ports out on the internet, but will limit them to a subnet if we can be assigned a subnet on which we will hang our bastion servers on.
I wouldn't know about blocks of IP's, but you can certainly create a virtual network in which you create all your resources in Azure, and hten configure a firewall in azure, which will have a permanent IP. This can then be used to set up a site-to-site VPN thing between your corporate network and the machines in Azure.
https://azure.microsoft.com/en-gb/services/virtual-network/
For public facing ports, you can add another virtual network card and rest assured that the traffic on one card cannot, in any way pass over to the other, network connected card.
This would also be a better strategy than to set up a range of VM's in Azure with public IP's.

Resources