Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

VxRail:VxRail Manager 補救 Apache Log4Shell 漏洞 (CVE-2021-44228、CVE-2021-45046 和 CVE-2021-4104) 的因應措施

Summary: 本文概述可在 VxRail Manager 上執行的指令檔,以補救 CVE-2021-44228、CVE-2021-45046 和 CVE-2021-4104 (Dell 文章 DSN-2021-007,VMware 文章 VMSA-2021-0028) 中所述的 Apache Log4Shell 漏洞。

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


Instructions

Apache 軟體基金會發佈關於嚴重 Apache Log4j 遠端代碼執行漏洞的相關資訊,之前在 GitHub Advisory Database 中稱為 Log4Shell (亦於 CVE-2021-44228CVE-2021-45046CVE-2021-4104 中說明)。VxRail Manager 暴露於漏洞中所描述的問題。

注意:另外報告了兩個 CVE (CVE-2021-45046 和 CVE-2021-4104),代表 CVE-2021-44228 (Log4j 2.x) 中說明的原始補救建議並非完整的修正方式。

如需更多關於這些 CVE 的資訊,請參閱下列文章:

注意:本文中的指令檔已更新為版本 1.1.2,其中包括針對 CVE-2021-44228、CVE-2021-45046 和 CVE-2021-4104 等三個 CVE 的補救措施。

在先前的指令檔中發現另一個問題,這可能會導致 VxRail Manager 從系統封存還原受影響的檔案。此問題亦已在此版本中解決。

如果您使用的指令檔版本較本文隨附的更舊,請下載最新的指令檔 (1.1.2),並在 VxRail Manager 上執行,以確保您有完整的修正程式。

 

要求和範圍

本文所述的補救措施涵蓋範圍如下:

  • 本文適用於 VxRail 4.5.x、4.7.x 和 7.0.x 版本中的 VxRail Manager,以及 VCF 3.x 和 4.x 版本中的 VxRail Manager。
  • 提供的指令檔和補救步驟僅能補救 VxRail Manager 裝置 VM 中的漏洞。
  • 針對 vCenter Server Appliance (vCSA) 和 NSX 等 VxRail Manager 以外的其他元件,必須個別進行緩解,且並未包含在本指令檔內。
  • 此外,此指令檔不會補救任何在 VM 內部執行的應用程式或服務,這些應用程式或服務可能會暴露於漏洞中。Dell EMC 建議所有客戶要求其應用程式或軟體廠商檢查在 VM 中執行的服務,以確保其不受影響。

下列 VMware VMSA 文章詳述受影響的 VMware 產品和潛在因應措施的連結:

VMware 在下列文章提供指令檔,可自動執行 vCenter Server Appliance 中的補救措施:

本文附加的檔案為 fixlog4j-CVE-2021-44228-CVE-2021-45046-v-1-1-2.zip,僅包含適用於 VxRail Manager 的指令檔。
 

已包含修正程式的 VxRail 版本

此問題已在下列 VxRail 軟體版本中解決:

  • VxRail 套件軟體 7.0.320
  • VxRail Appliance 軟體 4.7.541
  • VxRail Appliance 軟體 4.5.471

建議升級至包含修正程式的 VxRail 軟體版本。
對於無法立即升級的客戶,建議使用此指令檔。

注意:如果您的 VxRail 7.0.xxx 叢集是由客戶管理的 vCenter 管理,請參閱下列文章,以瞭解可能適用的其他考慮:

 

補救步驟

若要補救此問題,請執行下列步驟:
  1. 下載本文附加的 fixlog4j-CVE-2021-44228-CVE-2021-45046-v-1-1-2.zip 檔案。
  2. 使用 mystic 使用者,透過 SCP (例如 WinSCP 等 SCP 用戶端) 將 .zip 檔案上傳至 VxRail Manager。
  3. 登入 VxRail Manager VM 主控台,或以 mystic 使用者使用 SSH。 
  4. 將目錄變更為您上傳 .zip 檔案的位置,並使用「unzip」命令解壓縮:
    mystic@vxrm:~> unzip fixlog4j-CVE-2021-44228-CVE-2021-45046-v-1-1-2.zip
    Archive:  fixlog4j-CVE-2021-44228-CVE-2021-45046-v-1-1-2.zip
      inflating: fixlog4j-CVE-2021-44228-CVE-2021-45046.sh
  5. 使用 chmod 命令使腳本可執行:
    mystic@vxrm:~> chmod +x fixlog4j-CVE-2021-44228-CVE-2021-45046.sh
  6. 使用 su 命令,以 VxRail Manager 的 root 使用者身分登入:
    mystic@vxrm:~> su -
    Password:
  7. 請確定您位於解壓縮指令檔套件的相同目錄中:
    vxrm:~ # cd /home/mystic
    vxrm:/home/mystic #
  8. 執行指令檔:
    vxrm:/home/mystic # ./fixlog4j-CVE-2021-44228-CVE-2021-45046.sh

    指令檔輸出範例:
    Stop MARVIN and runjars service before patching the system

    /mystic/connectors/eservice/lib/log4j-core-2.13.0.jar is affected by CVE-2021-44228 and CVE-2021-45046, need to apply patch
    patching /mystic/connectors/eservice/lib/log4j-core-2.13.0.jar
    Successfully patched /mystic/connectors/eservice/lib/log4j-core-2.13.0.jar

    /mystic/connectors/cluster/lib/log4j-core-2.13.0.jar is affected by CVE-2021-44228 and CVE-2021-45046, need to apply patch
    patching /mystic/connectors/cluster/lib/log4j-core-2.13.0.jar
    Successfully patched /mystic/connectors/cluster/lib/log4j-core-2.13.0.jar

    To ensure there is no reload behavior, we need to pack the .war file as well.
    looks like /usr/lib/vmware-marvin/marvind/webapps/ROOT.war contains the bad log4j-core library WEB-INF/lib/log4j-core-2.13.0.jar
    Archive:  /usr/lib/vmware-marvin/marvind/webapps/ROOT.war
      inflating: WEB-INF/lib/log4j-core-2.13.0.jar
    Patching WEB-INF/lib/log4j-core-2.13.0.jar in /usr/lib/vmware-marvin/marvind/webapps/ROOT.war
    Repack /usr/lib/vmware-marvin/marvind/webapps/ROOT.war
    updating: WEB-INF/lib/log4j-core-2.13.0.jar (deflated 11%)
    Clean up the ROOT folder...

    Always apply a reboot of MARVIN and runjars services
    restart MARVIN
    MARVIN restart successfully
    restart runjars
    runjars restart successfully

注意:補救所有檔案和重新啟動 VxRail Manager 服務可能需要 5 至 10 分鐘。

如果您打算執行下列任何手動驗證步驟,請等待至少 10 分鐘。

lib4j-core 程式庫有幾種不同版本,根據 VxRail Manager 的版本而定。

此指令檔的設計可正確補救 VxRail Manager,無論該版本的 VxRail Manager 包含的 lib4j-core 版本為何。

根據隨附的 lib4j-core 版本而定,以上的指令檔執行輸出結果可能會顯示為更新不同檔案。

注意:如果您執行 VxRail 升級至另一個未包含修正程式的 VxRail 組建,則必須再次執行此指令檔,以重新套用補救措施。
 

 :若要實作 VxRail 的完整緩解措施,需要 VMware 的 vCenter Server Appliance (vCSA) 因應措施,以及由此指令檔執行的 VxRail Manager 補救措施。


以下文章連結到 VMware 文章,其中涵蓋其產品的因應措施和修正程序,VxRail:Log4Shell (CVE-2021-44228) 和 VxRail 環境的相關資訊
 

驗證步驟

為了補救此問題,指令檔會從 lib4j-core-* jar 檔案中移除 JndiLookup.class 檔案。

jar 檔案是 JAVA 的包裝格式,用於在單一檔案中包含多個類別、中繼資料和其他 JAVA 程式。其概念類似於 .zip 檔案,並以 .zip 格式為基礎。執行指令檔會驗證每個 jar 檔案是否成功更新。

若要手動驗證腳本是否已運作,您可以檢查 VxRail Manager 上的 log4j-core-* jar 檔案是否仍包含受影響的 JndiLookup.class 檔案。如果已成功,您在執行下列確認受影響的 JndiLookup.class 檔案不在 jar 檔案中的命令時,應該不會看到有輸出內容。
 

使用自動化命令進行驗證

您可以在 VxRail Manager 上執行下列命令,以掃描 VxRail Manager 上存在的所有 log4j-core-xxxx.jar 檔案,檢查是否包含受影響的 JndiLookup.class 檔案:

vxrm:/home/mystic # for myfile in `find / -name log4j-core*jar -print |grep -v log4jbak`; do echo $myfile; unzip -l $myfile | grep JndiLookup.class; done

範例輸出 (已更新的系統):
/mystic/connectors/eservice/lib/log4j-core-2.13.0.jar
/mystic/connectors/cluster/lib/log4j-core-2.13.0.jar
/usr/lib/vmware-marvin/marvind/webapps/ROOT/WEB-INF/lib/log4j-core-2.13.0.jar


在以上範例中,jar 中沒有 JndiLookup.class 檔案,因此指令檔已成功執行,且驗證成功。

以下為需要更新之受影響系統的範例輸出:
/mystic/connectors/eservice/lib/log4j-core-2.13.3.jar
     2892  2020-05-10 12:08   org/apache/logging/log4j/core/lookup/
JndiLookup.class
/mystic/connectors/cluster/lib/log4j-core-2.13.3.jar
     2892  2020-05-10 12:08   org/apache/logging/log4j/core/lookup/
JndiLookup.class
/usr/lib/vmware-marvin/marvind/webapps/ROOT/WEB-INF/lib/log4j-core-2.13.3.jar
     2892  2020-05-10 12:08   org/apache/logging/log4j/core/lookup/
JndiLookup.class

在以上範例中,受影響的 JndiLookup.class 檔案仍存在於 log4j-core-2.13.3.jar jar 檔案內。
 

透過手動檢查每個檔案進行驗證

若要快速識別 VxRail Manager 上是否有任何 log4j-core-xxxx.jar 檔案,請執行下列命令 (這也會將輸出結果變更為可用的命令格式):
vxrm:/home/mystic # find / -name log4j-core*jar -print |grep -v log4jbak | awk '{print("unzip -l " $1 "|grep JndiLookup.class")}'

範例輸出:
unzip -l /mystic/connectors/eservice/lib/log4j-core-2.13.0.jar|grep JndiLookup.class
unzip -l /mystic/connectors/cluster/lib/log4j-core-2.13.0.jar|grep JndiLookup.class
unzip -l /usr/lib/vmware-marvin/marvind/webapps/ROOT/WEB-INF/lib/log4j-core-2.13.0.jar|grep JndiLookup.class


在上述的範例輸出中,手動執行每個命令,以查看是否偵測到受影響的 JndiLookup.class 檔案:
vxrm:/home/mystic # unzip -l /mystic/connectors/eservice/lib/log4j-core-2.13.0.jar|grep JndiLookup.class
vxrm:/home/mystic #

vxrm:/home/mystic # unzip -l /mystic/connectors/cluster/lib/log4j-core-2.13.0.jar|grep JndiLookup.class
vxrm:/home/mystic #

vxrm:/home/mystic # unzip -l /usr/lib/vmware-marvin/marvind/webapps/ROOT/WEB-INF/lib/log4j-core-2.13.0.jar|grep JndiLookup.class
vxrm:/home/mystic #


在上述範例中,JndiLookup.class 檔案並未出現在 jar 中,因此指令檔已成功執行,且驗證成功。

注意:根據您的 VxRail Manager 版本而定,上述範例輸出內的 jar 檔案名稱可能會有所不同。使用您從以上 find 命令所收到的範例輸出。

仍受影響且包含受影響 JndiLookup.class 檔案的 jar 檔案範例輸出:

vxrm:/home/mystic # unzip -l /mystic/connectors/cluster/lib/log4j-core-2.4.1.jar |grep JndiLookup.class
2576 2015-10-08 17:50 org/apache/logging/log4j/core/lookup/
JndiLookup.class

在以上範例中,受影響的 JndiLookup.class 檔案仍存在於 log4j-core-2.4.1.jar jar 檔案內。

 

 :另外也提醒您,實作 VxRail 的完整緩解措施,需要 VMware 的 vCenter Server Appliance (vCSA) 因應措施,以及由此指令檔執行的 VxRail Manager 補救措施。

Article Properties


Affected Product

VxRail, VxRail Appliance Family, VxRail Appliance Series, VxRail Software

Last Published Date

30 Aug 2022

Version

18

Article Type

How To