elastic7.16 install 0 - Configure security for the Elastic Stack

本文介绍了Elastic Stack在不同场景下的安全配置方案,包括最小安全配置、基本安全配置及高级安全配置等,确保从开发到生产环境的数据安全性。

文章目录

Security needs vary depending on whether you’re developing locally on your laptop or securing all communications in a production environment. Because security needs vary, the following scenarios provide options for configuring the Elastic Stack.

Each subsequent scenario builds on the previous one so that you can add additional security by building on the existing layer.

These scenarios don’t cover every situation, but provide a framework for securing Elasticsearch and the Elastic Stack based on typical use cases.
在这里插入图片描述

Elastic Security layers
Minimal security (Elasticsearch Development)edit
If you want to set up Elasticsearch on your laptop and start developing, this scenario is for you. This configuration prevents unauthorized access to your local cluster by setting up passwords for the built-in users. You also configure password authentication for Kibana.

The minimal security scenario is not sufficient for production mode clusters. If your cluster has multiple nodes, you must enable minimal security and then configure Transport Layer Security (TLS) between nodes.

Set up minimal security

Basic security (Elasticsearch Production)edit
This scenario builds on the minimal security requirements by adding transport Layer Security (TLS) for communication between nodes. This additional layer requires that nodes verify security certificates, which prevents unauthorized nodes from joining your Elasticsearch cluster.

Your external HTTP traffic between Elasticsearch and Kibana won’t be encrypted, but internode communication will be secured.

Set up basic security

Basic security plus secured HTTPS traffic (Elastic Stack)edit
This scenario builds on the one for basic security and secures all HTTP traffic with TLS. In addition to configuring TLS on the transport interface of your Elasticsearch cluster, you configure TLS on the HTTP interface for both Elasticsearch and Kibana.

If you need mutual (bidirectional) TLS on the HTTP layer, then you’ll need to configure mutual authenticated encryption.

You then configure Kibana and Beats to communicate with Elasticsearch using TLS so that all communications are encrypted. This level of security is strong, and ensures that any communications in and out of your cluster are secure.

Set up basic security plus HTTPS traffic

### Elasticsearch 7.16.3 配置 IK 分词器 对于希望在 Docker 中运行带有 IK 分词器插件的 Elasticsearch 7.16.3 版本,官方并没有提供预装有该插件的镜像。因此,通常的做法是在启动容器之后通过命令行来安装所需的插件。 然而,为了简化部署流程并减少每次启动新实例时重复操作的工作量,可以创建自定义 Dockerfile 来构建一个包含所需配置和插件的定制化镜像。下面是一个简单的例子展示如何实现这一点: #### 创建自定义 Dockerfile 构建带IK分词器的Elasticsearch镜像 ```dockerfile FROM elasticsearch:7.16.3 # 设置环境变量以避免交互提示 ENV ELASTICSEARCH_PLUGIN_URL=https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.16.2/elasticsearch-analysis-ik-7.16.2.zip RUN bin/elasticsearch-plugin install --batch fileb:///tmp/analysis-ik.zip && \ rm -rf /var/lib/apt/lists/* /tmp/* COPY ${ELASTICSEARCH_PLUGIN_URL} /tmp/analysis-ik.zip ``` 上述脚本会基于 `elasticsearch:7.16.3` 进行扩展,在其中加入来自 GitHub 发布页面提供的对应版本的 IK 分析插件文件[^3]。注意这里假设你已经下载好了 `.zip` 文件或将 URL 替换成实际可访问的位置。 完成此 Dockerfile 的编写后,可以通过如下命令来进行构建: ```bash docker build -t my-elasticsearch-with-ik . ``` 这将会生成一个新的名为 `my-elasticsearch-with-ik` 的镜像,它包含了预先安装好的 IK 插件。 一旦有了这个新的镜像,就可以按照常规方式去启动相应的服务了: ```bash docker run -d --name es-instance -p 9200:9200 -p 9300:9300 my-elasticsearch-with-ik ``` 这样就能够在不额外手动干预的情况下获得具备中文分词能力的 Elasticsearch 实例了。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值