使用 PowerShell 创建 MABS 的应用控制补充策略

MABS的Application Control补充策略允许Azure Local在强制模式下运行而不阻挡备份。 当 Azure Local 部署以 Application Control 强制模式下运行时,MABS 及其所用的所有 DLL 必须正确签名。

本文介绍了如何通过使用 PowerShell 扩展基础策略并允许 MABS 运行来创建应用控制补充策略。

检查并切换 Azure Local 上的应用程序控制策略模式

应用控制策略可以以三种模式运行:审计、强制或禁用。

为MABS创建应用控制补充政策

要使用 PowerShell 创建 MABS 的应用控制补充策略,请按照以下步骤操作:

  1. 通过运行 New-CIPolicy cmdlet 命令,生成一个包含从 MABS 服务器创建 DPM 策略所需信息的 WDAC 策略文件。

    
     	New-CIPolicy `
     	-ScanPath "C:\Program Files\Microsoft Azure Backup Server V4\DPM\DPM\ProtectionAgents" `
     	-Level Publisher `
     	-Fallback Hash `
     	-UserPEs `
     	-FilePath "C:\WDAC\Broadcom-VMware-TBS-fingerprint.xml"
    
  2. 使用以下示例脚本创建一个新的 XML 文件,并将其保存到 Azure Local 虚拟机C:\WDAC\Broadcom_Supplemental-VMWareOnly.xml的路径中:

      <?xml version="1.0" encoding="utf-8"?>
      <SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy" PolicyType="Supplemental Policy">
     	 <VersionEx>10.0.0.0</VersionEx>
     	 <PlatformID>{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}</PlatformID>
     	 <Rules>
     		 <Rule>
     			 <Option>Enabled:Unsigned System Integrity Policy</Option>
     		 </Rule>
     		 <Rule>
     			 <Option>Enabled:Advanced Boot Options Menu</Option>
     		 </Rule>
     		 <Rule>
     			 <Option>Enabled:UMCI</Option>
     		 </Rule>
     	 </Rules>
     	 <!-- EKUs -->
     	 <EKUs />
     	 <!-- File Rules -->
     	 <FileRules />
     	 <!-- Signers -->
     	 <Signers>
     		 <!-- Broadcom SHA256/SHA384 signer -->
     		 <Signer ID="ID_SIGNER_BROADCOM_SHA256"
     			 Name="DigiCert Trusted G4 Code Signing RSA4096 SHA384 2021 CA1">
     			 <CertRoot Type="TBS"
     				 Value="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" />
     			 <CertPublisher Value="Broadcom Inc" />
     		 </Signer>
     		 <!-- VMware SHA256 signer -->
     		 <Signer ID="ID_SIGNER_VMWARE_SHA256" Name="Symantec Class 3 SHA256 Code Signing CA">
     			 <CertRoot Type="TBS"
     				 Value="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" />
     			 <CertPublisher Value="VMware, Inc." />
     		 </Signer>
     		 <!-- VMware SHA384 signer -->
     		 <Signer ID="ID_SIGNER_VMWARE_SHA384"
     			 Name="DigiCert Trusted G4 Code Signing RSA4096 SHA384 2021 CA1">
     			 <CertRoot Type="TBS"
     				 Value="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" />
     			 <CertPublisher Value="VMware, Inc." />
     		 </Signer>
     	 </Signers>
     	 <!-- Signing Scenarios -->
     	 <SigningScenarios>
     		 <!-- User-mode executables/DLLs -->
     		 <SigningScenario Value="12" ID="ID_SIGNINGSCENARIO_WINDOWS"
     			 FriendlyName="Broadcom+VMware+Microsoft Supplemental User-Mode Policy">
     			 <ProductSigners>
     				 <AllowedSigners>
     					 <AllowedSigner SignerId="ID_SIGNER_BROADCOM_SHA256" />
     					 <AllowedSigner SignerId="ID_SIGNER_VMWARE_SHA256" />
     					 <AllowedSigner SignerId="ID_SIGNER_VMWARE_SHA384" />
     				 </AllowedSigners>
     			 </ProductSigners>
     		 </SigningScenario>
     	 </SigningScenarios>
     	 <UpdatePolicySigners />
     	 <CiSigners>
     		 <CiSigner SignerId="ID_SIGNER_BROADCOM_SHA256" />
     		 <CiSigner SignerId="ID_SIGNER_VMWARE_SHA256" />
     		 <CiSigner SignerId="ID_SIGNER_VMWARE_SHA384" />
     	 </CiSigners>
     	 <HvciOptions>0</HvciOptions>
     	 <Settings />
     	 <BasePolicyID>{yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy}</BasePolicyID>
     	 <PolicyID>{zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz}</PolicyID>
      </SiPolicy>
    

    注释

    更新 PlatformIDBasePolicyIDPolicyID,并 Signer’s TBS value 视需要:

    • PlatformID:代表平台协会。 在文件 C:\WDAC\Broadcom-VMware-TBS-fingerprint.xml中查找此细节。
    • BasePolicyID:代表当前政策所依赖的基础政策。 你可以用 Get-ASLocalWDACPolicyInfo 来查找你的基础保单。
    • PolicyID: 代表当前政策的标识符。 在文件 C:\WDAC\Broadcom-VMware-TBS-fingerprint.xml中查找此细节。
    • Signer’s TBS values:从文件 C:\WDAC\Broadcom-VMware-TBS-fingerprint.xml中获取签名者的签名证书根/链标识符(TBS指纹)值。
  3. 要修改 Azure Local 虚拟机上补充政策的元数据,请执行以下 cmdlet:

      # Path of newly created XML
      $policyPath = "c:\wdac\Broadcom_Supplemental-VMWareOnly.xml"
    
      # Set Policy Version (VersionEx in the XML file)
      $policyVersion = "1.0.0.1"
      Set-CIPolicyVersion -FilePath $policyPath -Version $policyVersion
    
      # Set Policy Info (PolicyName, PolicyID in the XML file)
      Set-CIPolicyIdInfo -FilePath $policyPath -PolicyID "DPM-Policy_$policyVersion" -PolicyName "DPM-Policy"
    
  4. 要在 Azure Local 虚拟机上部署该策略,请执行以下 cmdlet:

      Add-ASWDACSupplementalPolicy -Path c:\wdac\Broadcom_Supplemental-VMWareOnly.xml
    
  5. 要在 Azure Local 虚拟机上检查新策略的状态,请运行以下 cmdlet:

      Get-ASLocalWDACPolicyInfo
    

示例输出

NodeName : Node1
PolicyMode : Enforced
PolicyGuid : {XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}
PolicyName : DPM-Policy
PolicyVersion : 1.0.0.1
Status : Active
PolicyScope : Kernel & User
MicrosoftProvided : False
IsSigned : False

后续步骤

用 Azure 备份 Server 备份 Azure Local 虚拟机