This time we’re looking at disk and file encryption!
The image above describes the boot process. We will get into some of the parts described in the diagram, but focusing mostly on the server side. For more on securing the Windows 10 boot process, check this out.
What does UEFI provide us with?
That’s a short summary, now let’s enable it, shall we?
Enabling UEFI is done by hitting a key-stroke (OEM dependant) on boot and enabling it. Newer hardware is UEFI by default.
Is an UEFI feature that protects a servers startup enviroment. UEFI firmware stores a database of trusted hardware, drivers, operating systems and option ROMs. This DB is structured by the server’s OEM. This way the server only starts if its OS boot loader files and device drivers are digitally signed and trusted by the Secure Boot database.
Secure Boot can be turned off with physical access. Also smart to have a UEFI admin password enabled.
Stands for Trusted Platform Module, which is a microchip that’s installed on current gen servers and desktop-class mobos. Main function is protecting security related data, particulary encryption and decryption keys. Server 2016 supports TPM v1.2 and 1.0.
Technically TPM can provide the same type of boot-time protection that UEFI Secure Boot can. However, the two systems are seperate and rely upon seperate trust stores.
To read up further on TPM, UEFI and Secure Boot in a security perspective check out this excellent article on infosecinstitute.
BitLocker is a full disk encryption feature included in Windows. It is designed to protect data by providing encryption for entire volumes.
Bitlocker Drive Encryption is Microsofts native disk encryption solution for operating systems and data drives. Boot Configuration Database (BCD) is a firmware-independent database that stores Windows startup configuration data. In Server 2016 this is a unlettered 500 MB System Reserved partition on your startup disk.
In order to prepare BitLocker to use Secure Boot for vplatform and BCD database integrity validation we need to enable the Allow Secure Boot for Integrity alidation policy found in the GPO path:
Computer Configuration\Policies\Administrative Templates\Windows Components\BitLocker Drive Encryption\Operating System Drives
The first step is to install the BitLocker Drive Encryption Feature, this can be done through powershell (administrative):
Install-WindowsFeature -Name BitLocker -IncludeAllSubFeature -IncludeManagementTools -Restart
We can also use Server Manager or, if you’d like, DISM through the EnableWindowsOptionalFeature-wrapper:
Enable-WindowsOptionalFeature -Online -FeatureName Bitlocker,BitLocker-Utilities -All
That should be all for BitLocker installation.
BitLocker Drive Encryption can be configured to use a number of authentication methods called protectors.
Protector configuration | Startup behavior |
---|---|
No TPM | Requires a BitLocker password or a startup key on a USB drive |
TPM + startup pin | Requires the presence of a TPM chip and a PIN |
TPM + startup key | Requires a TPM chip and USB drive based startup key |
TPM + startup PIN + startup key | Requires TPM, a pin and a startup key |
Configuring the BitLocker Drive Encryption policy is done through GPO and the policy named Required Additional Authentication At Startup. It’s located in the GPO path:
Computer Configuration\Policies\Administrative Templates\Windows Components\BitLocker Drive Encryption\Operating System Drives
You can use TPM without any other protector, I.E just TPM and no PIN/KEY, it’s better that nothing. You can also use BitLocker with no TPM (not advisable) by selecting the Allow BitLocker Without A Compatible TPM (Requires A Password Or A Startup Key On A USB Flash Drive) GPO setting.
After the GPO settings have taken effect, you need to actually encrypt your OS volume:
You can also use the BitLocker PowerShell cmdlets. Let’s encrypt the C:\ drive using TPM and PIN protectors:
PS> $SecureString = ConvertTo-SecureString '$trongPa$$w0rd1337' -AsPlainText -Force
PS> Enable-BitLocker -MountPoint 'C:' -EncryptionMethod Aes256 -UsedSpaceOnly -Pin $SecureString -TPMandPinProtector
You can also use manage-bde command line executable.
Hyper-V in WS16 allows both Secure Boot and virtualized TPM (vTPM) for VM guests. This is a part of each machine’s properties - meaning the setup for this is the same as a physical machine/server.
Was implemented in WS12, you can encrypt volumes before or after you add them to a cluster. Use either Windows Powershell or managezbde.exe to perform the task.
WS16 supports the BitLocker Network Unlock feature. It allows automatic access to BitLocker decryption keys, which means that you can start, restart or remotely manage your windows servers without having to manually input a PIN. The requirements, in addition to UEFI firmware and TPM chips are the following:
Computer Configuration\Policies\Windows Settings\Security Settings\Public Key Policies\BitLocker Drive Encryption Network Certificate
I rewrote my sequence (mine was 5 steps) to match that of the TechNet article detailing the Network Unlock feature (see link below.)
First, check that WDS is running:
Get-Service WDSServer
Then, install the Network Unlock feature
Install-WindowsFeature BitLocker-NetworkUnlock
Then we create a certificate, in this example a self signed one (please see the link furthest down in this part for more in-depth information here):
New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -Subject "CN=BitLocker Network Unlock certificate" -Provider "Microsoft Software Key Storage Provider" -KeyUsage KeyEncipherment -KeyUsageProperty Decrypt,Sign -KeyLength 2048 -HashAlgorithm sha512 -TextExtension @("1.3.6.1.4.1.311.21.10={text}OID=1.3.6.1.4.1.311.67.1.1","2.5.29.37={text}1.3.6.1.4.1.311.67.1.1")
After that we deploy the private key to our WDS server and configure Group Policy settings for Network Unlock.
For more in depth information, particularly creating the certificate template for network unlock, check out this article!
Easiest way is the recovery password that we generated and saved to a file/usb or printed out when we enabled bitlocker - a 48-digit unlock key. Saving this file to an offline, removable media that’s stored securely should be the one of the main ways to handle BitLocker recovery passwords.
We can also back up BitLocker recovery keys to AD. The configuration setting to this lies in the following GPO path:
Computer Configuration\Policies\Administrative Templates\Windows Components\BitLocker Drive Encryption\
This policy gives you the choice of storing only BitLocker recovery passwords in AD DS, or both the passwords as well as the underlying encryption keys. You’ll also need to enable the policy Choose How BitLocker-Protected Operating System Drives Can Be Recovered from the Operating System Drives subfolder in the GPO path. Specifically you need to make sure the option Save BitcLocker Recovery Information To AD DS is enabled for operating system drives.
Next, we need to run the Invoke-GPUpdate cmdlet against relevant servers (imagine I have a file of all relevant servers in a txt file):
Invoke-GPUpdate -Computer (Get-Content -Path .\servers.txt) -Force
From now on any server where you enable BitLocker stores its recovery password and also its encryption keys in Active Directory. This doesn’t affect servers where BitLocker is already enabled, however. On these machines, run the following command to obtain the systems numerical password ID:
Manage-bde -protectors -get c:
And then run this command to force the key/pass archival:
Manage-bde -protectors -adbackup c: -id {password-id}
Locate the target server in AD Users and Computers, open it’s properties sheet and navigate to the bitlocker recovery tab. You’ll see the recovery password here. Keep in mind that anyone with access to this object in AD will be able to see it, so this protection is only as good as your AD-security itself.
You can also use Microsoft BitLocker Administration and Monitoring toolset, or MBAM for short.
It has a pretty complex installation that we won’t get into, full-fledged multi-tier application that can be deployed stand-alone or through SCCM. Provides end-to-end automation for BitLocker, including self-service key retrieval, agent-based user guidance.
BitLocker functions at the volume level. You can use it to encrypt removable media, but for most production servers you’ll be encrypting entire fixed hard disk volumes. We can use BitLocker to create encrypted container files, but these too are treated by WS16 as VHD images. Encrypting File System (EFS) is a more granular solution that can be leveraged to protect individual folders and files.
EFS generates self-signed certs and stores them in each user or administrators profile folder by default. This is a bad idea in production, because the keys can stolen/damaged and there’s not trust chain with self-signing. If you plan to implement EFS, you should have a true blue PKI established, like with AD CS, so you can fully manage EFS certs. AD CS includes basic EFS and EFS recovery agent templates out of box.
The data recovery agent (DRA) is a privileged user account who can decrypt other domain users EFS certificates. By default the domain admin account is the de facto DRA, but we can include others.
Steps to define the current administrator a new EFS DRA in WS16 AD domain that has an online enterprise root cert auth:
Refresh GPO (Invoke-GPUpdate or gpupdate from cmd) and your new DRAs have privilege to decrypt all domain users EFS-encrypted files. Comes in handy during emergiencies, but if someone gain access to DA it will become a problem. For more, see this article from Microsoft.
TechNet-article on server hardening
The world of security is always changing and that’s also the case for Microsoft. To follow all their updates, new products, what’s retiring and namechanges please use the following link to stay updated on all their blogs and updates. Here they discuss updated baselines and so much more.