Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lock down access to Azure VM to specific IP

We're planning to sign up for the Azure VM trial as soon as it comes out of preview. In the meantime however, can someone please clarify the following?

Currently users can access an Azure VM instance using a Remote Desktop Connection (RDC). Is it possible however to 'lock down' the Azure VM instance so that only a specified IP address can connect via RDC?

This would provide us with some extra security knowing only our fixed office IP could connect to our live data server. Or is there a different approach?

like image 990
EvilDr Avatar asked Nov 05 '12 13:11

EvilDr


People also ask

How do I restrict access to a virtual machine?

Enter in "Manage Rules" menu, and click "Add Rule" icon on the upper right. Choose protocol and ports you want to secure, set "Direction" as "Ingress" and "Remote" as CIDR. Enter desired IP range or single number allowed to access your VM. Confirm your choice by clicking "Add" button.

How do I block an IP address on my Azure VM?

You can use the Network Security Groups(NSG) to block some IPs. You can add different rules in one NSG and config this NSG to your cloud service's VNet. Firstly, you need to have a NSG with rules that can block the target IPs. You can use portal to create the NSG and add rules in it.

How do I assign a Private IP to Azure VM?

In the network interface properties, select IP configurations in Settings. Select ipconfig1 in the IP configurations page. Select Static in Assignment. Change the private IP address if you want a different one, and then select Save.


1 Answers

The Windows Azure load balancer (through which all traffic is routed) doesn't have any type of IP-whitelist feature. You'd need to implement that in your VM's firewall. If this is a Cloud Service (PaaS), then the firewall rules would be applied to any new instance that's spun up. With IaaS, you'd either apply the rules to each VM or set the rules up initially in a VM that you subsequently use as an image for additional VMs.

EDIT 7/29/2013 This answer is a bit dated. Virtual Machines now have IP-based endpoint ACL allow/deny lists, currently accessible via PowerShell. You can set up separate IP filtering for each endpoint so, in your case, you could lock down the RDP port specifically. See this blog post for more information.

like image 117
David Makogon Avatar answered Sep 19 '22 17:09

David Makogon