Windows Server Summit 2024
Mar 26 2024 08:00 AM - Mar 28 2024 04:30 PM (PDT)
Microsoft Tech Community
LIVE

Best Practice for secure HyperV configuration

Copper Contributor

Our design and deployment teams were having a debate on the most secure way to deploy HyperV, particularly with respect to Ransomware attacks and protecting from encryption.

 

There seems to be two camps, one to deploy standalone and one to join to Active Directory. I would like to know what the best practice is for securing the hypervisor.

 

Cheers,

 

Jason

11 Replies
Given that stupid users that click on attachments and browser cocktails should not be impacting the HyperV host, and the user should not have access to the container I have not seen reports of HyperV hosts nailed by user initiated ransomware. While I've seen some reports of utilization of pass the hash/privilege escalation, I have not seen reports of ransomware nailing the hyperV host even when domain joined. As long as the admin patches themselves and uses appropriate run as admin/log in with appropriate creds etc etc.

Here is a nice spreadsheet of current best practices for preventing ransomware

 

https://docs.google.com/spreadsheets/d/1TWS238xacAto-fLKh1n5uTsdijWdCEsGIM0Y0Hvmc5g/pubhtml

 

Consider application whitelisting if you really want to go uber protection.

I think it depends on your infrastructure scale and architecture. Smiley Happy Having domain joined Hyper-V Host allows centralized management with ease but it definitely cannot stop user that has admin privileges to make a silly mistake to take down the environment.

 

In a large environment, we can have an infrastructure.contoso.com forest and corporate.contoso.com forest with forest trust between forests, review and lock down the privileges but this can be complex arhitecture for small environment.

 

I suppose for small environment, it will be best to review the privileges and ensure that there is limited privileges for average user to access the Hyper-V Host storage through shared folders or UNC paths so that ransomware initiation cannot reach those files and encrypt them. If possible, get the Hyper-V host into Server Core mode and as for Windows Server 2016, deploy Nano Server with Hyper-V role because its the way to go.

If you have already an Active Directory infrastructure, deploying standalone would create additional headache. Security relies on multiple segments, such as user account security, strictly divide admin and non admin accounts, patch management, security software and policies, user training... The weakest point in the chain is usually the end user (remember, also each administrator is an end user). And this is not specific to HyperV. For which purpose and on which scale do you plan to use it, btw.? Without knowing this it is hard to tell, what would be "better". Best greetings from Germany Olaf

Hi Jason,

 

I will suggest to get the Operating System to comply to OS Hardening first.

 

After that not sure if you have already read these documentations, there are some resources on Hyper-V hardening below:

 

Hope it helps and pave way for you to have a good start. Smiley Happy

I agree with everyone so far and just to add a few more things to consider. Managing non domain joined machines, if not done correctly, can be less secure over all since you don't have a secure channel by default to work through. If you have not denied access to domain admins to everything in your enterprise except the domain controllers, you should start there. If you have not looked at LAPS, you should consider deploying and using that and removing all but a select few domain users and groups from local admin. No admins is preferred. Deploy your Hyper-V host configurations with PowerShell DSC and access them over PowerShell constrained endpoints using Just Enough Administration (JEA). If no one ever logs in interactively, admin or user, then the potential for malware execution is greatly reduced. In short how you configure and manage your servers is just as and sometime more important than the configuration itself.

For big hyper-v farm, I suggest to have separate network, with it's own AD Forest (without any trust), protected by a firewall. To manage the farm, admin use a TS connection on an admin server (each admin as is own login). No direct access from  office computer to Hyper-V servers. It's the best way to secure Hyper-V and other service (SOFS cluster, SCVM ...), but if you have less than 10 servers it is not the best solutions. 

Is this for protecting the host itself against ransomware or the VMs running on the hosts? We've seen instances of users who have access to SMB file shares manage to get the file shares encrypted even though they dont have admin access to the VM. Active Directory joined servers + proper group policy management would be the best approach (Policies to disable autorun, script execution....). Also, if you're talking about protecting the hosts themselves, there should be network policies in place to prevent users from accessing the hosts themselves. I can't think of a situation where an end user would need to be able to get to anything on a Hyper-V host. 

To keep it as short as possible, here my 2 cents:

 

  • Seperate infrastructure forest for fabric components (storage / compute)
  • Use bastion jump servers for fabric admins, do not allow administrative access from client networks / admin PCs
  • Dedicated management vlan for parent partition
  • Make intra-cluster communication vlans, dedicated and private (not routed)
  • Use server core or nano edition to keep layer-8 issues away as much as possible. A hyper-v host with GUI is not safe at all
  • Use host firewall
  • User PowerShell DSC / GPOs to prevent configuration drifts

 

Cheers,
Michael

In a properly designed infraestructure, you should have Hyper-V AD integrated and even if a VM get its files compromised by ransomware, it doesn't afect the Hosts.

@Jason Childs 

Hi Jason.

I know this is a old post - but just wanted to give you my advice here, from a lesson learned in 2020 :)

 

Anti-malware does not belong inside Host Management OS.

 

Someone, at our company - decided to install Bitdefender for protection, and my oh my - what a pain.

 

I regret it tenfold, that I wasn't able to avoid it from being installed on our Server 2019 Core with Hyper-V, even though I fought hard and long.

 

It caused a massive Cluster breakdown - and it took us long, before we were able to identify Bitdefender as the real reason for the breakdown.

 

So, there are plenty of other suggestions on how to protect your Hyper-V Servers - but Anti-Malware software is surely not one of the ways.