[ElasticSearch]修改开源安全组件Search Guard-6 用户密码
ES有很多的安全组件可用,例如: X-pack,Sarch Guard。但目前开源免费的,仅Search Guard。
1 前置条件
- Elastic Search 6 服务安装成功,且成功运行。
- ES的开源安全组件Search Guard-6安装成功,且成功运行。
本操作目前仅在search guard-6插件中实测成功。
更高或更低版本的search guard插件,可能在本小节的”Step3”步骤(使新密码在ES集群中生效)中个别参数有差异,可参照下述文件进行修改。
[ElasticSearch]#Search Guard#sgadmin参数说明
- ES的开源安全组件Search Guard-6启用【官网演示的认证模式】,且启用成功。
2 操作步骤
下述操作建议在ES集群的master节点中执行即可。
为方便理解下述操作,假定master节点IP为172.15.3.17。
- Step1 获取新密码的Search Guard的加密字符串
[root@es1 ~]#sh /usr/share/elasticsearch/plugins/search-guard-6/tools/hash.sh -p newPasswd
WARNING: JAVA_HOME not set, will use /usr/bin/java
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(hash加密串)
- Step2 配置master节点(node17)所有用户的新密码
(配置时,需使用到Step1中的hash加密串)
[root@es1~]#vi /usr/share/elasticsearch/plugins/search-guard-6/sgconfig/sg_internal_users.yml
- Step3 使新密码在ES集群的当前节点和其它所有节点中生效
[root@es1 ~]#cd /usr/share/elasticsearch/plugins/search-guard-6/tools/
[root@es1 ~]#./sgadmin.sh \
-h 172.15.3.17 \
-cd ../sgconfig/ \
-icl -nhnv -cacert /etc/elasticsearch/root-ca.pem \
-cert /etc/elasticsearch/kirk.pem \
-key /etc/elasticsearch/kirk-key.pem \
--accept-red-cluster
- Step4 验证
关闭并重新打开浏览器;输入集群内任一节点的url;输入用户的新密码。
若能登录,则修改成功。
[浏览器] https://172.15.3.17:9200/_cluster/health?pretty
- Step5 更新ES客户端/程序端的配置
3 相关补充
ElasticSearch 插件管理
- 查看已安装的插件
root# cd /usr/share/elasticsearch/
root# bin/elasticsearch-plugin list
search-guard-6
或 (查看集群内各节点的插件安装情况)
[浏览器] https://172.15.3.xx:9200/_cat/plugins?v
- ElasticSearch 安装新插件
root# cd /usr/share/elasticsearch/
root# bin/elasticsearch-plugin install {插件名称 | 指定插件版本具体位置}
Eg: bin/elasticsearch-plugin install x-pack
Eg: bin/elasticsearch-plugin install file:///D:\work\ElasticSearch\x-pack-5.5.2.zip
root# bin/elasticsearch-plugin install
- ElasticSearch 卸载插件
root# cd /usr/share/elasticsearch/
root# bin/elasticsearch-plugin remove [pluginname]
Search guard 健康状态检查
要检查Search Guard是否已安装并已启动并正在运行,请访问运行状况检查端点,例如:
https://<hostname>:9200/_searchguard/health
{
message: null,
mode: "strict",
status: "UP"
}
补充: X-pack用户与安全管理方式
- 使用X-pack安全特性前,需更改配置开启xpack
xpack.security.enabled: true
- 查看所有用户
root# cd /usr/share/elasticsearch/
root# ./bin/elasticsearch-users list
No users found
- 添加用户
root# cd /usr/share/elasticsearch/
root# ./bin/elasticsearch-users useradd newUser -p newUserPasswd -r superuser
- 查看X-pack的License生效情况
license申请地址: https://license.elastic.co/registration
[POST方式]
root# curl -XPOST --insecure -u admin:admin 'https://172.15.3.xx:9200/_xpack/license/start_trial?acknowledge=true&pretty
{
"acknowledged" : true,
"trial_was_started" : false,
"error_message" : "Operation failed: Trial was already activated."
}
[GET方式]
https://172.15.3.xx:9200/_xpack/license/
{
"license" : {
"status" : "active", //Current Status
"uid" : "45e8402a-461b-4d00-b737-c778b718dede",
"type" : "basic",
"issue_date" : "2019-11-14T15:54:48.364Z", // issue_date
"issue_date_in_millis" : 1573746888364,
"expiry_date" : "2020-09-27T03:33:11.423Z",// expiry_date
"expiry_date_in_millis" : 1601177591423,
"max_nodes" : 1000,
"issued_to" : "xxx_elastic", //Cluster Name: xxx_elastic
"issuer" : "elasticsearch", //OS User: elasticsearch
"start_date_in_millis" : -1
}
}
X 文献
- Elasticsearch安全认证的几种方法 - 高屋建瓴(ling)/CSDN
- [ElasticSearch]#Search Guard#sgadmin参数说明 - 强烈推荐/博客园
- [ElasticSearch] ES集群状态由非正常状态(red)恢复为正常状态(green)的思路与实践 - 强烈推荐/博客园
- [ElasticSearch]#解决问题#修改Search Guard密码时 报错:ERR: Seems there is no Elasticsearch running on localhost:9300 - Will exit - 博客园
- search-guard-7 官网 : 配置密码
- search-guard-6 官网 : 安装SearchGuard
- search-guard-6 官网 : 添加用户
- search-guard-6 官网 : 使用sgadmin与pem证书
- elastic 官网 : x-pack设置用户密码
- elasticsearch.yml 配置项详解 - 推荐/官网
- 申请elasticsearch中x-pack插件许可证 - 博客园
- 重置elasticsearch的超级管理员密码 - 亲测无效/简书
- Elasticsearch(七) - X-Pack 用户管理 - CSDN
[ElasticSearch]修改开源安全组件Search Guard-6 用户密码的更多相关文章
- elasticsearch 6.x 安装search guard
前言 es之前版本一直无用户验证功能,不过官方有提供一x-pack,但是问题是付费.在es的6.3.2版本中,已经集成了x-pack,虽然es团队已经对x-pack开源,但是在该版本中如果需要使用到安 ...
- Elasticsearch 5.0 安装 Search Guard 5 插件 (五)
一.Search Guard 简介 Search Guard 是 Elasticsearch 的安全插件.它为后端系统(如LDAP或Kerberos)提供身份验证和授权,并向Elasticsearc ...
- Elasticsearch 5.0 安装 Search Guard 5 插件
一.Search Guard 简介 Search Guard 是 Elasticsearch 的安全插件.它为后端系统(如LDAP或Kerberos)提供身份验证和授权,并向Elasticsearc ...
- elasticsearch安装与使用(5)-- search guard安装与配置
一.安装search guard插件必须要安装两部分: ①search-guard-xx ②search-guard-ssl (XX指的是与elasticsearch引擎对应的版本) github地址 ...
- (转) Elasticsearch 5.0 安装 Search Guard 5 插件
一.Search Guard 简介 Search Guard 是 Elasticsearch 的安全插件.它为后端系统(如LDAP或Kerberos)提供身份验证和授权,并向Elasticsearc ...
- Net Core开源通讯组件 SmartRoute
Net Core开源通讯组件 SmartRoute(服务即集群) SmartRoute是基于Dotnet Core设计的可运行在linux和windows下的服务通讯组件,其设计理念是去中心化和零配置 ...
- 开源通讯组件ec
跨平台开源通讯组件elastic communication elastic communication是基于c#开发支持.net和mono的通讯组件(简称EC),EC的主要目的简化mono和.net ...
- ELK之安装了search guard认证后安装elasticsearch-head
安装searc guard参考https://www.cnblogs.com/minseo/p/10576126.html 安装elasticsearch-head参考 https://www.cnb ...
- ELK之elasticsearch6安装认证模块search guard
参考:https://www.cnblogs.com/marility/p/9392645.html 1,安装环境及软件版本 程序 版本 安装方式 elasticsearch 6.3.1 rpm ...
- 开源数据采集组件比较: scribe、chukwa、kafka、flume
针对每天TB级的数据采集,一般而言,这些系统需要具有以下特征: 构建应用系统和分析系统的桥梁,并将它们之间的关联解耦: 支持近实时的在线分析系统和类似于Hadoop之类的离线分析系统: 具有高可扩展性 ...
随机推荐
- PVE设置屏幕休眠和笔记本合盖不休眠
注意源文件中的命令前的#号要删除. 二.屏幕休眠
- springboot配置类@ConfigurationProperties报错Not registered via @EnableConfigurationProperties or marked as Spring component
添加一个@Component可以解决此问题,只有这个组件是容器中的组件,才能使用容器提供的@ConfigurationProperties功能.
- 小梅哥课程学习——串口发送应用之发送数据(适用于板级验证,时间间隔位100ms)
//此代码的注意事项,首先这个代码不能仿真成功会出现一定的时间延迟, //因为在做板级验证的时候把时间改成了100ms发送一次,要想仿真成功,把时间改成499999 //使用上一节课设计的发送模块,设 ...
- HarmonyOS_Text_Image
Text组件 ohos:属性 id="$+id:text_helloworld" #在程序中控制,需要id="$+id:name",转回MainAbilityS ...
- 精通Spring 4.x 企业应用开发实战- 1.6 新特性
- SAP B1如何找回被误删的许可证号
SAP B1的许可证分配记录,保存在安装目录下的B1Upf.xml文件下,如果你发现许可证用户不小心误删了, 但又不知道是哪个用户名了,打开此文件,便可发现该用户名.接下来,你只要再建立一个和误删除的 ...
- new Date()在IOS中的坑(转)
原文地址:https://www.cnblogs.com/zjjDaily/p/8963327.html 第一次遇到,记录一下 要创建一个指定时间的new Date对象时,通常的做法是: new Da ...
- Apache Ranger系列七:Hive 和 Spark 执行过程中的文件路径配置
背景:在使用Ranger鉴权的过程中,要求必须开启impersonation功能(即执行用户与提交用户保持一致,而不是统一代理的hive/spark).但是在执行的过程中,会需要在hdfs存储临时的文 ...
- dotNetCore创建Windows服务程序并安装服务
一.创建控制台程序 二.在项目中添加新建项,选择Windows服务类型. 此时会出现一个错误提示,这是因为尚未添加windows服务控制引用造成的. 三.添加Nuget包,System.Service ...
- WPF中转换与关键帧动画及报错:WPF动画找不到依赖属性:属性未指向路径“(0).(1)[3].(2)”中的 DependencyObject
WPF中的转换有: // 在二维 x-y 坐标系内围绕指定点按顺时针方向旋转对象. <RotateTransform /> // 在二维 x-y 坐标系中平移(移动)对象. <Tra ...