The DataCore Swarm Engineering Team has made Swarm 14 product updates (2021-12-16) for the log4j vulnerability CVE-2021-44228 and has verified workarounds that resolve the issue in all current and previous versions. The Gateway and Elasticsearch software are affected (CLOUD-3482, SWAR-9322).

The guidance per Gateway version is:

The Gateway workaround involves two parts:

  1. You will need to upgrade your JRE on the Gateway servers. Under CentOS 7 you can upgrade to the latest JRE by issuing yum upgrade java-1.8.0-openjdk (which as of this writing should upgrade to 1.8.0_312). You can run java -version to confirm.

  2. Once your JRE is on the latest version, you will need to make the following change to the /etc/sysconfig/cloudgateway file:

    JAVA_EXTRA_OPTS="-Dlog4j2.formatMsgNoLookups=true"

Once the above two changes are made on each of your Gateway servers, you must then restart the Gateway service with systemctl restart cloudgateway. After that, you can run some simple tests to make sure Gateway is functioning properly.

Confirmation of the options taking hold can be performed by looking at the Java process running in the process table (example):

# ps auxwwf | grep java

root     22258  109  1.4 4345096 231080 ?      Sl   09:57   0:14  _ /usr/bin/java -Xms1024m -Xmx1024m -Dpid.file=/var/run/cloudgateway.pid -Dnodaemon=true -Dgateway.config=/etc/caringo/cloudgateway/gateway.cfg -Dlogging.config=/etc/caringo/cloudgateway/logging.yaml -Dgateway.error=/var/log/caringo/cloudgateway_server.error -Djava.util.concurrent.ForkJoinPool.common.parallelism=200 -Dlog4j2.formatMsgNoLookups=true -cp /opt/caringo/cloudgateway/lib/* com.caringo.gateway.Main

Additional Notes:

The guidance per Elasticsearch version is:

Elasticsearch by default protects against remote code execution and information leakage. Also, it should never be exposed directly to users in Swarm deployments. But it is good to apply the property workaround Elastic mentions here. Do not upgrade elasticsearch, remain on 6.8.6 or 7.5.2.

https://discuss.elastic.co/t/apache-log4j2-remote-code-execution-rce-vulnerability-cve-2021-44228-esa-2021-31/291476

Simply add the property below to /etc/elasticsearch/jvm.options where the heap size is set. Do this on each of your elasticsearch nodes and systemctl restart elasticsearch. You can do a rolling restart (https://www.elastic.co/guide/en/elasticsearch/reference/7.5/restart-cluster.html#restart-cluster-rolling ) to avoid downtime.

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

-Xms31g
-Xmx31g

# Workaround CVE-2021-44228
-Dlog4j2.formatMsgNoLookups=true

Additional Notes:

If you are still using the unsupported Elasticsearch 2.3.3 or 5.6.12 please file a support ticket and plan to upgrade in 2022. In-place upgrades of those old elasticsearch versions are not supported:

How to Upgrade Swarm