Secure VM in Azure

azure infrastructure as code vnb consulting

Major corporations across the world have been hit by a wave of ransomware attacks that encrypt computers and then demand that users pay $300 to a bitcoin address to restore access due to poor Azure VM security or poor cybersecurity development and network standards.

While countries across Europe — the United Kingdom, Ukraine, Spain and France, to name a few — were hit hardest by the outbreak, the virus has now spread to the United States.

Recently a hospital, based in Greenfield, Ind., revealed that a successful ransomware attack on Thursday held the hospital’s IT systems hostage, demanding a ransom payment in Bitcoin (BTC) in return for a decryption key.

To take care of the recent security concerns, we will be publishing series of blog pots on how to secure your Azure IAAS and improve your Azure VM security. This would help to implement a secure environment.

In this blog we will talk about monitoring and securing any Virtual Machine(VM) on Azure VM cloud end to end.

Machine preparation and Preventive Actions:

Important steps or actions which needs to be executed after creation of nay VM on Azure Portal. This helps to better secure and monitor the VM.

1. Create VM by choosing the appropriate OS version and other Hardware details. Please make a note of username and password supplied while creating a VM.

2. Once the VM provisioning is completed. Browse to the IP address of the VM and Make it static. this prevents IP change every time the machine is restarted.

azure vm security

3. Browse to the Blade of the Virtual machine, Go to Setting->Extensions and add Microsoft Antimalware extension. This would help to setup windows Defender on the VM.

azure vm security

4. Encrypt the Virtual Machine. Please follow the below steps to encrypt the VM.

a. Login to VM and Open Windows PowerShell command Prompt as “Run as Administrator”.

b. Run: Install-Module -Name AzureRM -AllowClobber

c. Run: Import-Module -Name AzureRM

d. Run: Connect-AzureRmAccount. It will prompt to supply Azure Credentials.

e. Run: Select-AzureRmSubscription –SubscriptionId

f. Run the script ADEPrereqScript.ps1. you can download the script from

Please store the generated Info.

g. Run: Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $resourceGroupName -VMName $vmName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $keyVaultResourceId -VolumeType All

5. Browse to the Blade of the Virtual machine, Go to Setting->Security and enable Monitoring and configure Alerts on security Center.

azure vm security

6. Browse to the Blade of the Virtual machine, Go to Setting -> Networking and enable IP Restriction on Inbound Port and Outbound Port Rules.

azure vm security

7. Browse to the Blade of the Virtual machine, Go to Operations->Backup and enable Default backup of VM’s.

azure vm security

8. In case the VM is added to a Virtual Network or On-premise Network, perform the following steps to better troubleshoot connectivity. It will assist in validating issues and overall connections.

              a. Allow ICMP (copy and paste to command prompt with admin level):

              netsh advfirewall firewall add rule name=”ICMP Allow incoming V4 echo request” dir=in                     action=allow enable=yes protocol=icmpv4:8,any

              b. Install Telnet (copy and paste to command prompt with admin level):

              pkgmgr /iu:”TelnetClient”

              c. PS PING (download, extract to systems32 folder):

The above tools in any combination will allow us to provide faster resolution with communication issues. For example, Telnet can be used to identify if an actual port is available and passing traffic.

Related Posts

VNB Consulting RPA AI Builder UI Flow

June 6, 2020

Power Automate Robotic Process Automation & AI builder – Part I

Power Automate a cloud-based service offered by Microsoft has been helping many organizations to create automated workflows between their favorite apps and services. Expanding the capabilities of Power Automate, Microsoft has come up with a new feature called UI Flow which helps to create a Robotic process Automation (RPA). With this new addition, Power Automate now also


May 4, 2020

ArcGIS Maps With Power BI

ArcGIS by Esri is now a built-in feature in Power BI to provide enhanced mapping capabilities taking it beyond the presentation of points on a map to a whole new level. It enables to attach layers of demographic data to a map with ease. The combination of this location-based data layers on a map with