Elasticsearch Log4j漏洞快速修復步驟
原創2021-12-14 21:27·walkingcloud
一、Elasticsearch關于Log4j2漏洞的官方說明
可以參考如下鏈接
https://discuss.elastic.co/t/apache-log4j2-remote-code-execution-rce-vulnerability-cve-2021-44228-esa-2021-31/291476

摘要:2021年12月9日,Log4j的GitHub公開披露了一個影響Apache Log4j2多個版本的高嚴重性漏洞 (CVE-2021-44228) 該漏洞影響了Apache Log4j2的2.0到2.14.1版本,
Github地址:https://logging.apache.org/log4j/2.x/
本公告總結了對 Elastic 產品的任何潛在影響以及緩解問題的相關公告,Elastic 官方工程和安全團隊繼續積極開展分析和(探討)我們的用戶應執行的任何操作,同時識別可用于識別漏洞潛在利用的檢測簽名,
Elasticsearch 公告 (ESA-2021-31) Log4j 是包括 Elasticsearch在內的無數Java應用程式使用的標準日志記錄庫,由于我們使用了Java安全管理器,Elasticsearch不易受此漏洞的遠程代碼執行影響,但是很快我們將提供Elasticsearch 6.8.21和7.16.1,這將洗掉易受攻擊的Log4j組件并設定下面標識的JVM選項,
- 1、 Elasticsearch 受影響的版本
Elasticsearch 5.0.0+ 版本包含一個易受攻擊的 Log4j 版本,以及緩解攻擊的安全管理器(Security Manager),
- 2、 Elasticsearch 解決方案和緩解措施
方案一:用戶可在 Elasticsearch 6.8.22 或 7.16.1 發布后升級
方案二:設定 JVM 選項
-Dlog4j2.formatMsgNoLookups=true
二、ElasticSearch安全更新版本已發布
2021.12.14 ElasticSearch官方已經發布漏洞修復版本7.16.1 6.8.21版本

(圖片可點擊放大查看)
用戶可以升級到Elasticsearch 7.16.1 69或6.8.21 , 于2021年12月13日發布,
這些版本沒有升級 Log4j 包,而是通過設定JVM 選項來緩解漏洞 -Dlog4j2.formatMsgNoLookups=true 并從 Log4j 包中洗掉易受攻擊的 JndiLookup 類,
三、ElasticSearch安全版本升級步驟
1、確認當前ElasticSearch版本
rpm -aq | grep elasticsearch

2、下載最新elasticsearch安全版本7.16.1
騰訊云鏡像站
https://mirrors.cloud.tencent.com/elasticstack/7.x/yum/7.16.1/elasticsearch-7.16.1-x86_64.rpm

(圖片可點擊放大查看)
3、上傳并安裝
rpm -Uvh elasticsearch-7.16.1-x86_64.rpm

4、重啟elasticsearch服務
systemctl daemon-reload
systemctl restart elasticsearch.service

5、確認是否生效
ps -ef | grep log4j2.formatMsgNoLookups=true

四、Elasticsearch Log4j緩解措施
所使用Elasticsearch的版本6.X 5.X 7.X均有,不便于升級的話,可以使用緩解措施
以RPM安裝的Elasticsearch 6.8.8版本為例
1、切換到配置目錄下
cd /etc/elasticsearch

2、vim jvm.options 在組態檔中加入如下一行
vim jvm.options
#加入如下行
-Dlog4j2.formatMsgNoLookups=true

3、然后重啟elasticsearch服務生效
systemctl restart elasticsearch.service ;log4j2.formatMsgNoLookups=true 引數確認

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/384143.html
標籤:其他
上一篇:跑通代碼-ICCV2021-HiNet: Deep Image Hiding by Invertible Network
下一篇:Java CC1鏈分析
