JumpServer 堡垒机对接 Elasticsearch 集群存储命令

官网地址:JumpServer - 开源堡垒机 - 官网

在线电话:400-052-0755

技术支持:JumpServer 技术咨询


1. 为什么对接 Elasticsearch

JumpServer 堡垒机默认配置把命令存储在数据库的「terminal_command」表,在管理大规模资产数量场景中相应的也会记录更多的命令条目,在这种场景下直接查询数据库获取数据会导致页面有卡顿现象,同时在也不利于归档整理和分类。为了解决上述问题 JumpServer 堡垒机支持将命令存储记录到 Elasticsearch 集群,命令存储在 Elasticsearch 也支持按天创建索引方便整理和归档。

2. JumpServer 堡垒机对接 Elasticsearch 步骤

2.1 环境说明

用途

IP地址

软件版本

JumpServer

10.1.11.31

7.17.7

Elasticsearch

10.1.11.32

v2.8.1

备注:测试环境中 Elasticsearch 为单机环境。

2.2 Elasticsearch 安装配置

​
#安装 java
[root@es-node1 ~]# yum -y install java

#添加 Elasticsearch 源
[root@es-node1 ~]# rpm --import ​​​https://artifacts.elastic.co/GPG-KEY-elasticsearch​​​[root@es-node1 ~]# cat >> /etc/yum.repos.d/elk.repo << EOF
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
EOF

#安装 Elasticsearch
[root@es-node1 ~]# yum -y install elasticsearch --enablerepo=elasticsearch

#配置 Elasticsearch
[root@es-node1 ~]# grep -Ev “#|$” /etc/elasticsearch/elasticsearch.yml
cluster.name: jms-cluster
node.name: es-node01
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 10.1.11.32
http.port: 9200
discovery.seed_hosts: [“10.1.11.32”]
cluster.initial_master_nodes: [“10.1.11.32”]

#启动 Elasticsearch 服务
[root@es-node1 ~]# systemctl enable elasticsearch
[root@es-node1 ~]# systemctl start elasticsearch

#访问 Elasticsearch 服务
[root@es-node1 ~]# curl ​​​http://10.1.11.32:9200​​​{
“name” : “es-node01”,
“cluster_name” : “jms-cluster”,
“cluster_uuid” : “w_wbn7GHQWybqg40Swff7w”,
“version” : {
“number” : “7.17.7”,
“build_flavor” : “default”,
“build_type” : “rpm”,
“build_hash” : “78dcaaa8cee33438b91eca7f5c7f56a70fec9e80”,
“build_date” : “2022-10-17T15:29:54.167373105Z”,
“build_snapshot” : false,
“lucene_version” : “8.11.1”,
“minimum_wire_compatibility_version” : “6.8.0”,
“minimum_index_compatibility_version” : “6.0.0-beta1”
},
“tagline” : “You Know, for Search”
}

​

2.3 JumpServer 堡垒机对接 Elasticsearch

在系统设置 -> 终端设置模块下进行配置和管理 Elasticsearch 集群连接信息。

2.3.1 JumpServer 堡垒机对接 Elasticsearch

在终端设置 -> 命令存储子模块中创建一个 Elasticsearch 集群连接项用来连接 Elasticsearch 集群环境。

在 Elasticsearch 连接项中填写名称、主机和索引等信息。

成功创建连接项后测试 JumpServer 堡垒机与 Elasticsearch 集群连通性。

页面显示测试成功后表示 JumpServer 堡垒机与 Elasticsearch 集群通信正常。

2.3.2 JumpServer 组件使用 Elasticsearch

确认 JumpServer 堡垒机与 Elasticsearch 集群通信正常后在终端管理子模块中配置 JumpServer 堡垒机组件将命令存储至 Elasticsearch 集群环境。

2.3.3 JumpServer 对接 Elasticsearch 验证

在 JumpServer 堡垒机成功对接 Elasticseach 集群环境后可以连接任意资产测试是否能正常将命令记录到 Elasticseach 集群。

在 JumpServer 堡垒机审计台页面 -> 会话审计模块 -> 命令记录子模块中查看结果。

通过上述配置 JumpServer 堡垒机成功将命令记录存储至 Elasticsearch集群。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值