20220803
名称:Elasticsearch未授权访问漏洞
修复建议:
1、限制IP访问,绑定固定IP
2、在config/elasticsearch.yml中为9200端口设置认证:
http.basic.enabled:true #开关,开启会接管全部HTTP连接
http.basic.user:“admin” #账号
http.basic.password:“admin_pw” #密码
http.basic.ipwhitelist:[“localhost”, “127.0.0.1”]
3. 评估Elasticsearch的业务使用情况,若非必须对公网开放,建议放置在内网环境中。
思路:一开始根据修复建议直接在末尾加入以上几行发现没启动成功,有报错。后来网上说此功能要下插件才能实现。但插件是1.X版本,15年就停更了,安装的是6.8.3版本。接着查阅网上自带一个叫 xpack 的安全功能,于是末尾加入以下几行:
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
重新扫描后漏洞已修复。
参考文档:https://www.shuzhiduo.com/A/WpdK8L4MzV/