mirror of
https://github.com/MicrosoftDocs/windows-itpro-docs.git
synced 2025-06-20 21:03:42 +00:00
Merge pull request #9543 from jgeurten/wdac-policy-deployment-updates
Wdac policy deployment updates
This commit is contained in:
@ -52,6 +52,20 @@ This topic describes how to deploy Windows Defender Application Control (WDAC) p
|
|||||||
& $RefreshPolicyTool
|
& $RefreshPolicyTool
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Deploying signed policies
|
||||||
|
|
||||||
|
In addition to the steps outlined above, the binary policy file must also be copied to the device's EFI partition. Deploying your policy via [MEM](deploy-windows-defender-application-control-policies-using-intune.md) or the [Application Control CSP](#Deploying-multiple-policies-via-ApplicationControl-CSP) will handle this step automatically.
|
||||||
|
|
||||||
|
1. Mount the EFI volume and make the directory, if it does not exist, in an elevated PowerShell prompt:
|
||||||
|
```powershell
|
||||||
|
mountvol J: /S
|
||||||
|
J:
|
||||||
|
mkdir J:\EFI\Microsoft\Boot\CiPolicies\Active
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Copy the signed policy binary as `{PolicyGUID}.cip` to J:\EFI\Microsoft\Boot\CiPolicies\Active
|
||||||
|
3. Reboot the system.
|
||||||
|
|
||||||
## Script-based deployment process for Windows 10 versions earlier than 1903
|
## Script-based deployment process for Windows 10 versions earlier than 1903
|
||||||
|
|
||||||
1. Initialize the variables to be used by the script.
|
1. Initialize the variables to be used by the script.
|
||||||
|
@ -52,8 +52,6 @@ Alice previously created and deployed a policy for the organization's [fully man
|
|||||||
$EnforcedPolicyID = $EnforcedPolicyID.Substring(11)
|
$EnforcedPolicyID = $EnforcedPolicyID.Substring(11)
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> If Set-CIPolicyIdInfo does not output the new PolicyID value on your Windows 10 version, you will need to obtain the *PolicyId* value from the XML directly.
|
|
||||||
|
|
||||||
3. *[Optionally]* Use [Set-RuleOption](/powershell/module/configci/set-ruleoption) to enable rule options 9 (“Advanced Boot Options Menu”) and 10 (“Boot Audit on Failure”). Option 9 allows users to disable WDAC enforcement for a single boot session from a pre-boot menu. Option 10 instructs Windows to switch the policy from enforcement to audit only if a boot critical kernel-mode driver is blocked. We strongly recommend these options when deploying a new enforced policy to your first deployment ring. Then, if no issues are found, you can remove the options and restart your deployment.
|
3. *[Optionally]* Use [Set-RuleOption](/powershell/module/configci/set-ruleoption) to enable rule options 9 (“Advanced Boot Options Menu”) and 10 (“Boot Audit on Failure”). Option 9 allows users to disable WDAC enforcement for a single boot session from a pre-boot menu. Option 10 instructs Windows to switch the policy from enforcement to audit only if a boot critical kernel-mode driver is blocked. We strongly recommend these options when deploying a new enforced policy to your first deployment ring. Then, if no issues are found, you can remove the options and restart your deployment.
|
||||||
|
|
||||||
@ -74,7 +72,7 @@ Alice previously created and deployed a policy for the organization's [fully man
|
|||||||
> If you did not use -ResetPolicyID in Step 2 above, then you must replace $EnforcedPolicyID in the following command with the *PolicyID* attribute found in your base policy XML.
|
> If you did not use -ResetPolicyID in Step 2 above, then you must replace $EnforcedPolicyID in the following command with the *PolicyID* attribute found in your base policy XML.
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
$EnforcedPolicyBinary = $env:USERPROFILE+"\Desktop\"+$EnforcedPolicyName+"_"+$EnforcedPolicyID+".xml"
|
$EnforcedPolicyBinary = $env:USERPROFILE+"\Desktop\"+$EnforcedPolicyID+".cip"
|
||||||
ConvertFrom-CIPolicy $EnforcedPolicyXML $EnforcedPolicyBinary
|
ConvertFrom-CIPolicy $EnforcedPolicyXML $EnforcedPolicyBinary
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ Before signing WDAC policies for the first time, be sure to enable rule options
|
|||||||
|
|
||||||
To sign a WDAC policy with SignTool.exe, you need the following components:
|
To sign a WDAC policy with SignTool.exe, you need the following components:
|
||||||
|
|
||||||
- SignTool.exe, found in the Windows SDK (Windows 7 or later)
|
- SignTool.exe, found in the [Windows SDK](https://developer.microsoft.com/windows/downloads/windows-10-sdk/) (Windows 7 or later)
|
||||||
|
|
||||||
- The binary format of the WDAC policy that you generated in [Create a Windows Defender Application Control policy from a reference computer](create-initial-default-policy.md) or another WDAC policy that you have created
|
- The binary format of the WDAC policy that you generated in [Create a Windows Defender Application Control policy from a reference computer](create-initial-default-policy.md) or another WDAC policy that you have created
|
||||||
|
|
||||||
@ -47,26 +47,29 @@ If you do not have a code signing certificate, see [Optional: Create a code sign
|
|||||||
|
|
||||||
1. Initialize the variables that will be used:
|
1. Initialize the variables that will be used:
|
||||||
|
|
||||||
`$CIPolicyPath=$env:userprofile+"\Desktop\"`
|
```powershell
|
||||||
|
$CIPolicyPath=$env:userprofile+"\Desktop\"
|
||||||
`$InitialCIPolicy=$CIPolicyPath+"InitialScan.xml"`
|
$InitialCIPolicy=$CIPolicyPath+"InitialScan.xml"
|
||||||
|
```
|
||||||
`$CIPolicyBin=$CIPolicyPath+"DeviceGuardPolicy.bin"`
|
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> This example uses the WDAC policy that you created in the [Create a Windows Defender Application Control policy from a reference computer](create-initial-default-policy.md) section. If you are signing another policy, be sure to update the **$CIPolicyPath** and **$CIPolicyBin** variables with the correct information.
|
> This example uses the WDAC policy that you created in the [Create a Windows Defender Application Control policy from a reference computer](create-initial-default-policy.md) section. If you are signing another policy, be sure to update the **$CIPolicyPath** variable with the correct information.
|
||||||
|
|
||||||
2. Import the .pfx code signing certificate. Import the code signing certificate that you will use to sign the WDAC policy into the signing user’s personal store on the computer that will be doing the signing. In this example, you use the certificate that was created in [Optional: Create a code signing certificate for Windows Defender Application Control](create-code-signing-cert-for-windows-defender-application-control.md).
|
2. Import the .pfx code signing certificate. Import the code signing certificate that you will use to sign the WDAC policy into the signing user’s personal store on the computer that will be doing the signing. In this example, you use the certificate that was created in [Optional: Create a code signing certificate for Windows Defender Application Control](create-code-signing-cert-for-windows-defender-application-control.md).
|
||||||
|
|
||||||
3. Export the .cer code signing certificate. After the code signing certificate has been imported, export the .cer version to your desktop. This version will be added to the policy so that it can be updated later.
|
3. Export the .cer code signing certificate. After the code signing certificate has been imported, export the .cer version to your desktop. This version will be added to the policy so that it can be updated later.
|
||||||
|
|
||||||
4. Navigate to your desktop as the working directory:
|
4. Navigate to your desktop as the working directory:
|
||||||
|
|
||||||
`cd $env:USERPROFILE\Desktop`
|
```powershell
|
||||||
|
cd $env:USERPROFILE\Desktop
|
||||||
|
```
|
||||||
|
|
||||||
5. Use [Add-SignerRule](/powershell/module/configci/add-signerrule) to add an update signer certificate to the WDAC policy:
|
5. Use [Add-SignerRule](/powershell/module/configci/add-signerrule) to add an update signer certificate to the WDAC policy:
|
||||||
|
|
||||||
`Add-SignerRule -FilePath $InitialCIPolicy -CertificatePath <Path to exported .cer certificate> -Kernel -User –Update`
|
```powershell
|
||||||
|
Add-SignerRule -FilePath $InitialCIPolicy -CertificatePath <Path to exported .cer certificate> -Kernel -User –Update
|
||||||
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> *<Path to exported .cer certificate>* should be the full path to the certificate that you exported in step 3.
|
> *<Path to exported .cer certificate>* should be the full path to the certificate that you exported in step 3.
|
||||||
@ -74,17 +77,30 @@ If you do not have a code signing certificate, see [Optional: Create a code sign
|
|||||||
|
|
||||||
6. Use [Set-RuleOption](/powershell/module/configci/set-ruleoption) to remove the unsigned policy rule option:
|
6. Use [Set-RuleOption](/powershell/module/configci/set-ruleoption) to remove the unsigned policy rule option:
|
||||||
|
|
||||||
`Set-RuleOption -FilePath $InitialCIPolicy -Option 6 -Delete`
|
```powershell
|
||||||
|
Set-RuleOption -FilePath $InitialCIPolicy -Option 6 -Delete
|
||||||
|
```
|
||||||
|
|
||||||
7. Use [ConvertFrom-CIPolicy](/powershell/module/configci/convertfrom-cipolicy) to convert the policy to binary format:
|
7. Reset the policy ID and use [ConvertFrom-CIPolicy](/powershell/module/configci/convertfrom-cipolicy) to convert the policy to binary format:
|
||||||
|
|
||||||
`ConvertFrom-CIPolicy $InitialCIPolicy $CIPolicyBin`
|
```powershell
|
||||||
|
$PolicyID= Set-CIPolicyIdInfo -FilePath $InitialCIPolicy -ResetPolicyID
|
||||||
|
$PolicyID = $PolicyID.Substring(11)
|
||||||
|
$CIPolicyBin = $env:userprofile + "\Desktop\" + $PolicyID + ".cip"
|
||||||
|
ConvertFrom-CIPolicy $InitialCIPolicy $CIPolicyBin
|
||||||
|
```
|
||||||
|
|
||||||
8. Sign the WDAC policy by using SignTool.exe:
|
8. Sign the WDAC policy by using SignTool.exe:
|
||||||
|
|
||||||
`<Path to signtool.exe> sign -v /n "ContosoDGSigningCert" -p7 . -p7co 1.3.6.1.4.1.311.79.1 -fd sha256 $CIPolicyBin`
|
```powershell
|
||||||
|
<Path to signtool.exe> sign -v /n "ContosoDGSigningCert" -p7 . -p7co 1.3.6.1.4.1.311.79.1 -fd sha256 $CIPolicyBin
|
||||||
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The *<Path to signtool.exe>* variable should be the full path to the SignTool.exe utility. **ContosoDGSigningCert** is the subject name of the certificate that will be used to sign the WDAC policy. You should import this certificate to your personal certificate store on the computer you use to sign the policy.
|
> The *<Path to signtool.exe>* variable should be the full path to the SignTool.exe utility. **ContosoDGSigningCert** is the subject name of the certificate that will be used to sign the WDAC policy. You should import this certificate to your personal certificate store on the computer you use to sign the policy.
|
||||||
|
|
||||||
9. Validate the signed file. When complete, the commands should output a signed policy file called DeviceGuardPolicy.bin.p7 to your desktop. You can deploy this file the same way you deploy an enforced or non-enforced policy. For information about how to deploy WDAC policies, see [Deploy and manage Windows Defender Application Control with Group Policy](deploy-windows-defender-application-control-policies-using-group-policy.md).
|
9. Validate the signed file. When complete, the commands should output a signed policy file called {PolicyID}.cip to your desktop. You can deploy this file the same way you deploy an enforced or non-enforced policy. For information about how to deploy WDAC policies, see [Deploy and manage Windows Defender Application Control with Group Policy](deploy-windows-defender-application-control-policies-using-group-policy.md).
|
||||||
|
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> The device with the signed policy must be rebooted one time with Secure Boot enabled for the UEFI lock to be set.
|
||||||
|
Reference in New Issue
Block a user