使用 PowerShell 建立 MABS 的應用程式控制補充政策

MABS 的 Application Control 補充政策允許 Azure Local 以強制模式執行,且不會阻擋備份。 當 Azure Local 部署以 Application Control 強制模式執行時,MABS 及其所用的所有 DLL 必須正確簽署。

本文說明如何透過 PowerShell 擴充基礎政策並允許 MABS 執行,建立應用程式控制的補充政策。

檢查並切換 Azure Local 的 Application Control 政策模式

應用程式控制政策可以三種模式之一執行:審計、強制執行或停用。 學習如何 切換應用程式控制的政策模式。

為 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>
    

    Note

    視需要更新PlatformID、BasePolicyID、PolicyID和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 虛擬機。