Jump to content
  • entries
    142
  • comments
    0
  • views
    87496

Bulletproof manage your Azure VMs


proximagr

776 views

 Share

Bulletproof manage your Azure VMs
Continuing the Azure Security Center posts, today we will see a new feature of the Security Center, called Just in Time VM Access.
As best security practice, all the management ports of a Virtual Machine should be closed using Network Security Groups. Only the ports required for any published services should be opened, if any.
However there are many occasions that we are requested to open a management port for administration or a service port for some tests for short time. This action has two major problems, first it requires a lot of administration time, because the administrator must go to the Azure Portal and add a rule at the VM’s NSG. The second problem is that many time the port is forgotten open and this is a major vulnerability since the majority of the Brute Force attacks are performed to the management ports, 22 and 3389.
Here comes the Azure Security Center, with the Just in Time VM Access feature. With this feature we can use the RBAC of the azure Portal and allow specific users to Request a predefined port to be opened for a short time frame.JIT Configuration
Lets see how we configure the JIT. First we need to go to the Azure Security Center. Scroll down to the ADVANCED CLOUD DEFENSE and click the “Just in time VM Access”. Since it is at a Preview you need to press the “Try Just in time VM access”
img_5a22d02bf29ff.png
After we enable JIT, the window displays tree tabs, the Configured, the Recommended and the No recommendation. The Configured tab displays the Virtual Machines that we have already enabled JIT. The recommended are VMs that have NSGs and are recommended to be enabled for JIT. The No recommendation are Classic VMs or VMs that don’t have attached NSG.
img_5a22d13a89971.png
To enable JIT for a VM, go to the Recommended tab, select one or more VMs and press “Enable JIT on x VMs”
img_5a22d32dbfeff.png
At the “JIT VM access configuration” the Security Center proposes rule with the default management ports. We can add other ports that we need and also remove any of them that are unnecessary.
At each rule we can configure the Port, the Protocol, the Source IP and the Maximum request time.
If we leave the “Allowed source IPs” to “Per request” then we allow the requester to decide. One very interesting setting here is that when a user requests access it has the option to allow only the Public IP that he is using at that time automatically.
With the last option, the “Max request time” we narrow down the maximum time that we will allow a port to be opened.
img_5a22d3a9c3a99.png
After we configure all the parameters we click Save and the VM moves to the Configured tab. At any time we can change the configuration by selecting the VM, press the three dots at the end of the line (…) and click Edit.
img_5a22d5d58dd41.png
The Propertied button opens the VM’s blade, the Activity log shows all the users that requested access and the Remove of course disabled the JIT.Behind the scene
What really happens to the VM? if you browse to the NSG that is attached to the VM you will see that all the port rules configured at the JIT are added as NSG Rules with lower priority than all the other rules. All other rules automatically changed priority to higher.
img_5a2468239428d.png
Lets see how we request access and what happens in the background. To request access go to the Security Center / JIT , select the VM and press “Request Access”
img_5a2468e29150a.png
At the “Request access” blade switch on the desired port, select “My IP” or “IP Range” and the Timerange, all according to the JIT configuration of the VM. Finally press “Open Ports”
img_5a24691bc03c0.png
At the above example I select “My IP” so if you go to the VM’s NSG you will see that the 3389 port rule changed to “Allow” and for Source has my current Public IP. Also it moved at first priority.
img_5a2469d530f30.png
After the expiration of the time rage the port will change to “Deny” and move back to its prior priority.

 

[/url]share_save_171_16.png
The post Bulletproof manage your Azure VMs appeared first on Apostolidis IT Corner.



Source

 Share

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...