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(戴尔文章 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 Software Foundation 发布了有关严重的 Apache Log4j 库远程代码执行漏洞问题的信息,根据 GitHub 咨询数据库,此漏洞问题被称为 Log4Shell(CVE-2021-44228CVE-2021-45046 和 CVE-2021-4104 中也有详细说明)。VxRail Manager 也面临漏洞信息中概述的问题。

提醒:另外两个 CVE(CVE-2021-45046 和 CVE-2021-4104)已被报告,它们表明 CVE-2021-44228 (Log4j 2.x) 中描述的用于修复该问题的原始建议不是完整的修复方法。

有关这些 CVE 的更多信息,请参阅以下文章:

提醒:本文中的脚本已更新至版本 1.1.2,其中包括推荐用于所有三个 CVE(CVE-2021-44228、CVE-2021-45046 和 CVE-2021-4104)的修复方法。

在之前的脚本中发现了另一个问题,它可能会导致受影响的文件在 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 设备虚拟机中的漏洞。
  • VxRail Manager 之外的其他组件,例如 vCenter Server Appliance (vCSA)、NSX 等,必须分开修复,并且不在此脚本中。
  • 此外,此脚本不会修复在虚拟机中运行的任何可能受到漏洞影响的应用程序或服务。Dell EMC 建议所有客户与其应用程序或软件供应商联系,了解在虚拟机中运行的服务,以确保它们不受影响。

下列链接的 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 一体机软件 4.7.541
  • VxRail 一体机软件 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 将该 .zip 文件上传到 VxRail Manager(WinSCP就是一个可以使用的 SCP 客户端软件的例子)。
  3. 以 mystic 用户的身份登录到 VxRail Manager 虚拟机控制台或 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 根用户身份登录:
    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 上执行的修复。


您可在 VxRail:有关 Log4Shell (CVE-2021-44228) 和 VxRail 环境的信息(英文版)中找到那些介绍产品的解决方法和修复的 VMware 文章的链接。
 

验证步骤

为了修复问题,该脚本从 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


在上面的示例中,JndiLookup.class 文件不存在于 jar 中,因此脚本已正常工作,并且验证成功。

以下是必须更新的受影响系统的输出示例:
/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 文件中。

当系统已经包含了这个修复或者log4j-core库文件已经被升级,看到以下是系统输出实例中的JndiLookup.class是可以被忽略的
/usr/lib/vmware-marvin/marvind/webapps/ROOT/WEB-INF/lib/log4j-core-2.17.1.jar
     3158  2021-12-27 17:30   org/apache/logging/log4j/core/lookup/JndiLookup.class
/mystic/connectors/eservice/lib/log4j-core-2.17.1.jar
     3158  2021-12-27 17:30   org/apache/logging/log4j/core/lookup/JndiLookup.class
/mystic/connectors/cluster/lib/log4j-core-2.17.1.jar
     3158  2021-12-27 17:30   org/apache/logging/log4j/core/lookup/JndiLookup.class
在以上的例子中你可以看到JndiLookup.calss的版本但是修复是在log4j-core-2.17.1.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 #


在上面的示例中,jar 中不再存在 JndiLookup.class 文件,因此脚本已工作,并且验证成功。

提醒:上述输出示例中的 jar 文件名可能因您的 VxRail Manager 版本而异。使用从上述 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