New Azure Standard LB doesn't allow inbound connection - azure

I have setup a LB with a backend pool (only one host for test). I setup network security group on test host with following rule:
Source: AzureLoadBalancer Destination: Any Action: Allow
Source: VirtualNetwork Destination: VirtualNetwork Action: Allow
Source: Any Destination: Any Action: Deny
I can't connect to host through LB (from host in the same VNET).
It's a public LB and I try to connect through ip public.
If I setup a rule Source: Any Destination: Any Action: Allow
All work fine.
Of course, I don't want this rule.
What's wrong with my setup ?
Thanks.

You need to add an inbound port rule to allow connections from remote location to virtual machines. Find the network security group associated with the host Vnet. Add the inbound port (rdp 3389, ssh 22 or other port your self-defining ) which you allow to connect the host. Additionally, you will give every rule a priority. Low number of priority means high priority.
For more information about create a public Basic load balancer by using the Azure portal.

Related

How to prevent mywebapplication to specific network/Ip?

I have a web application in Azure and it's accessible over the Internet.
I want to restrict the access to public and allow the specific Network/IP.
I have configured Inbound rule and Outbound rule in NSG for blocking access to specific network, but still my webapplication is accessible over the Internet(AnyNetwork).
Outbound Rule:
Source IP: Vnet
Port:Any
Destination: Web application
Port: Any
Assuming you are talking about Azure App Service, follow these instructions to set up access restrictions.

Azure Front Door with Azure Application gateway

I am trying to setup an architecture where I have a static website stored on Azure storage and an App Container that serves the API. I would like to serve both from the same domain, but with a different path. The static site will be on the root path and the API will be on the /api path. I am writing an extension for an existing website and this URL setup is a requirement from it.
To achieve this result, I have an application gateway that can direct the requests based on the path (this already works), but so far it only has a public IP address.
I also have a Front Door with a custom origin to the application gateway. The Front Door received a domain name from azure and it is fine for now.
My issues is that when I access the Front Door on https, it tries to access the App GW with https, but obviously it doesn't support it, since it only has an IP address and I didn't create an SSL certificate for it.
Now, I am stuck, because I cannot configure the Front Door for SSL offloading, but I also cannot configure APP GW to accept https connections.
Does anybody knows the right setup for this case?
• You want to configure the application gateway to accept HTTPS connections when you are accessing the front door on HTTPS and it doesn’t support the SSL offloading and you are not able to redirect the same requests over HTTPS to the application gateway. Thus, in this scenario, to achieve this, you will have to add a NSG (Network Security Group) and link the Application Gateway subnet configured to it.
This will ensure that though the HTTPS connection requests are incoming through the Front door, they will be routed correctly to the application gateway’s public IP address via the NSG rules in place as shown below: -
Ensure that all the other rules are not present in your NSG that is associated with the application gateway and only the highlighted ones are created and mentioned so that when the requests are received on the Azure front door over HTTPS, the request is routed through the NSG via above created inbound rules and forwarded as SSL HTTPS request over the said associated private IP address created in the virtual network.
Please find the rules as below: -
Source: Service Tag
Source service tag: AzureFrontDoor.Backend
Source Port ranges: *
Destination: Any
Destination port ranges: *
Protocol: Any
Action: Allow
Priority: 200
Source: Service Tag
Source service tag: GatewayManager
Source Port ranges: *
Destination: Any
Destination port ranges: 65200-65535
Protocol: Any
Action: Allow
Priority: 300
Source: Service Tag
Source service tag: VirtualNetwork
Source Port ranges: *
Destination: Any
Destination port ranges: *
Protocol: Any
Action: Allow
Priority: 400
Source: Service Tag
Source service tag: AzureLoadBalancer
Source Port ranges: *
Destination: Any
Destination port ranges: *
Protocol: Any
Action: Allow
Priority: 500
Source: Any
Source Port ranges: *
Destination: Any
Destination port ranges: *
Protocol: Any
Action: Deny
Priority: 600
Once done, the application gateway accepts HTTPS requests from the Azure front door over Port 443 after configuring the custom domain on it.
For more information, kindly refer to the below links: -
Azure Front Door in the front of Application Gateway
https://learn.microsoft.com/en-us/azure/frontdoor/front-door-faq#when-should-we-deploy-an-application-gateway-behind-front-door-

Cannot isolate Azure subnets in same virtual network

I may be way off base here because I am not a networking expert, and new to Azure. I am having problems isolating two subnets in an Azure virtual network.
Scenario:
One virtual network (vn) with address space 10.0.0.0/16.
Two subnets (subnet1 and subnet2)
subnet1: 10.0.0.0/24
subnet2: 10.0.1.0/24
Two virtual machines (vm1 and vm2). Each virtual machine is Windows Server 2012 R2 with Windows Firewall disabled.
vm1 lives in subnet1,
vm2 lives in subnet2
vm2 has web service bound to port 5550. vm1 has client (browser) hitting web service on vm2. I can successfully access the web server action on vm2 via client (browser) on vm1.
Two network security groups (nsg1 and nsg2).
nsg1 is associated with subnet1,
nsg2 is associated with subnet2
The default inbound rules, particularly for nsg2, allows access from vnet via default rule:
PRIORITY: 65000,
NAME: AllowVnetInbound,
SOURCE: VirtualNetwork,
DESTINATION: VirtualNetwork,
SERVICE: Custom(Any/Any),
ACTION: Allow
I am trying to configure nsg2 to DENY traffic from vm1 to vm2 i.e. subnet1 to subnet2. I can't seem to make this work; not matter what deny rule I put in place the client on vm1 is always able to access the web server on vm2.
I added a new rule with higher priority:
PRIORITY: 200,
NAME: DenyVnetInbound,
SOURCE: VirtualNetwork,
DESTINATION: VirtualNetwork,
SERVICE: Custom(Any/Any),
ACTION: Deny
Does not work, client on vm1 is still able to access web server on vm2.
Also tried variations..
PRIORITY: 200,
NAME: DenyVnetInbound,
SOURCE: 10.0.0.0/24,
DESTINATION: 10.0.1.0/24,
SERVICE: Custom(Any/Any),
ACTION: Deny
This doesn't work either. Is it possible to isolate subnets in the same virtual network in Azure?
I can now block other subnets in a repeatable fashion. I am using rule:
PRIORITY: 4000
NAME: DenyVNet
SOURCE: VirtualNetwork
DESTINATION: All
SERVICE: Custom (Any/Any)
ACTION: Deny
I believe the root cause is that I had a faulty test(s). I suspect the issue has to do with HTTP persistent connections from the browser (and other test applications using HTTP). HTTP Keep-Alive?
When I change the NSG rules (inbound on target subnet):
ACTION RESULT
Kill both client and service New rule always works
Kill either client or service New rule works...most of time
Don't kill either client or service New rule never works, old rule behaviour remains
This pattern seems repeatable for Azure NSGs. I also believe this to be the case for AWS VPC security groups / network ACLs.

Azure VM - Creating TCP inbound rules

Please, I am trying to do some that should be simple... but it is not working.
I have 03 VMs in the same subnet.
The Subnet has a security group that I created HTTP/80 inbound OK.
Now, I need to open SQL to my second VM in the same subnet.
I already try to change the security group of my VM running SQL to the same of the IIS server.
I did do my Windows firewall inbound rule too. No way.
I tried to created another rule to test if my security group was forwarding correctly, without success.
This is my SQLIN rule:
Priority: 2100 / Source: Any / Protocol: TCP / Source port: 1433 / Target: CIDR Block: x.x.x.x/32 (server vm azure ip (internal) / Target port: 1433 / Action: ALLOW.
I can access my SQL through my VPN, but I need to open to the Internet.
The another test to check if my security group is doing what I create in the rules... is... I try to open RDP through port 3390... and redirect to 3389 (because in this security group I already have 3389 published to another server...)
The rule
Priority: 2120 / Source: Any / Protocol: TCP / Source port: 3390 / Target: CIDR block: x.x.x.x/32 (server vm azure ip interrna) / Target port: 3389 / Action: ALLOW.
I did not have sucess in both rules.
Again: Subnet is associated to this security group, and BOTH VMs are associated to this sec group.
If the 2 VMs are on the same subnet then you don't need to open up the NSG for the machines to talk to each other - you should just be able to use the windows firewall rules. Make the SQL VM private by making sure it doesn't have a public IP, or use the NSG here. I suspect the problem is with windows firewall from the IIS box or into the SQL box.

Connection timeout port 80 on new Azure VM with NSG rules configured

I just created a new Ubuntu 14.04 virtual machine in Microsoft Azure using the (recommended) resource manager deployment model. The following screenshots show the deployment configuration and the resulting resources:
Once it was deployed, I accessed the VM using SSH through the public IP, logged in and installed nginx. I left it with the default configuration and did a 'curl localhost' to ensure the webserver was running.
Then I went to the Network Security Group resource and added an Allow rule for port 80 to the Inbound rules:
I then opened a browser and tried to request the public IP associated with the NIC and got a connection timeout.
Edit: I can get access by disassociating the NSG from the NIC, but if I re-associate it, I will get blocked again within a few minutes.
I have tried using the same process to set up a Windows Server VM, with IIS, but I'm getting the same result.
What am I missing here?
I get no errors when doing the same setup using the classic deployment model, this only occurs when trying the recommended resource manager model.
For the ones that still struggle with the inbound rules on the new Portal Azure, you need to set up the Network Security Group (NSG) to:
allow connections from (source):
any sources
and
* - for the source port range (extremely important as it may seem normal to set 80 or 443 - which is not correct)
destination:
any
and
80 - as the destination port range (or the port that your webserver is listening to - it could be also 8080 or other)
The same goes for other ports like the 443 for the https connections.
What is your source port on your NSG? Did you leave it Any/*? If not you are limiting yourself to traffic coming only from that one port.

Resources