Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
reactor — 在 Elasticsearch 上运行自定义过滤器,并在匹配时发出警报。 | Kitploit
工具/GitHubGitHub/nccgroup/reactor
防御工具入侵检测事件响应异常检测日志分析
GitHubnccgroup/reactor

reactor

在 Elasticsearch 上运行自定义过滤器,并在匹配时发出警报。

查看仓库
343年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Reactor

Reactor 最初是开源项目 ElastAlert 的一个分支。本项目维护者应密切关注 ElastAlert 的变更(不包括其额外的告警器),并确保任何相关的错误修复被合入、任何有用的功能被移植进来。

Reactor 是一个告警引擎,它接收一组带有自定义过滤器的规则,并在匹配时发出告警。Reactor 会自动用重复告警信息更新已静默的告警。

来自 ElastAlert 的补丁历史

访问日期Commit备注
2019-10-16325f1dfe7a45f3ca2a2cc00127ab71fcd4f9cead回溯到 Reactor 首次创建之前。
2020-01-09ec5d03b95708ea0aa3d29c065f9794fdd95a82a1我们不使用覆盖率。

支持的版本

目前 Reactor 支持 ElasticSearch 5.x.x、6.x.x 和 7.x.x。随着 elasticsearch 新版本的发布,Reactor 将更新以提供支持。目前不打算为更旧版本的 ElasticSearch 添加支持。目前,尚未确定移除对旧版 ElasticSearch 支持的日期。如果 ElasticSearch 的 Python 库移除支持,我们很可能会跟进。

兼容性

根据 ElasticSearch 的 Python 库指南,建议安装与集群主版本相同的库版本。

对于 Elasticsearch 7.0 及更高版本,请使用主版本 7 (elasticsearch<8.0.0,>=7.0.0)。

对于 Elasticsearch 6.0 及更高版本,请使用主版本 6 (elasticsearch<7.0.0,>=6.0.0)。

对于 Elasticsearch 5.0 及更高版本,请使用主版本 5 (elasticsearch<6.0.0,>=5.0.0)。

请注意,ElasticSearch 库的 6.4.0 版本引入了一个 已知错误,该错误已在 7.0.4 中修复,但在主版本 6 中未修复。该错误会将 scroll_id 放入查询参数中,这可能导致 Elasticsearch 对有效的滚动 ID 返回 400 状态码。

开发

你可以使用以下命令在 docker 中启动一个 elasticsearch 实例以进行本地开发:

root@kitploit:~
$ docker run -d -p 9200:9200/tcp --name elasticsearch docker.elastic.co/elasticsearch/elasticsearch:<version>

并在 config.yaml 中进行如下配置:

root@kitploit:~
writeback_index: reactor
alert_alias: reactor_alerts

elasticsearch: &elasticsearch
  host: localhost
  port: 9200

# Global settings to be applied to every run
rule:
  elasticsearch: *elasticsearch

Git 钩子

本项目提供 git 钩子以防止用户出错。请运行以下命令:

root@kitploit:~
$ cp .git-hooks-pre-push .git/hooks/pre-push

运行测试

Reactor 涵盖两种类型的测试:单元测试和集成测试。单元测试用于确保各个函数和逻辑流程正常工作;集成测试用于确保整个系统协同工作。

单元测试

单元测试使用 PyTest 编写。要运行所有测试,请运行以下命令:

root@kitploit:~
$ py.test

集成测试

集成测试在 docker 中执行,并且需要项目根目录下的 .env 文件。测试需要在 .env 文件中包含以下内容:

root@kitploit:~
# The ElasticSearch version to be tested, reactor supports >= 5.x.x
ES_VERSION=6.3.2
# Basic configuration information so that reactor can query ElasticSearch
ES_HOST=elasticsearch
ES_USER=elastic
ES_PASSWORD=changeme

集成 Docker Compose 文件 test.docker-compose.yml 包含 3 个环境变量,这些变量是 >= v7.x.x 所必需的,但会破坏旧版本:

root@kitploit:~
node.name=elasticsearch
discovery.seed_hosts=elasticsearch
cluster.initial_master_nodes=elasticsearch

要执行集成测试,请运行以下命令:

root@kitploit:~
$ docker-compose -f docker-compose-test.yml up --abort-on-container-exit --build  reactor elasticsearch

为 RAFT 领导选举创建 SSL 证书

以下一组命令(在 ./certs/ 目录中执行)将创建一套 CA 和设备证书,用于在 localhost 上运行模拟集群:

root@kitploit:~
# Only do once: generate the root CA key:
$ openssl genrsa -out transport-ca.key 4096

# Generate the root CA certificate:
## Country Name (2 letter code) []:GB
## State or Province Name (full name) []:.
## Locality Name (eg, city) []:.
## Organization Name (eg, company) []:.
## Organizational Unit Name (eg, section) []:.
## Common Name (eg, fully qualified host name) []:PyRaftLog
## Email Address []:.
$ openssl req -x509 -new -nodes -key transport-ca.key -sha256 -days 1024 -out transport-ca.pem

# Generate device certificates
# Only do once: generate device key:
$ openssl genrsa -out transport-consensus.key 4096

# Generate device certificate signing request:
## Country Name (2 letter code) []:GB
## State or Province Name (full name) []:.
## Locality Name (eg, city) []:.
## Organization Name (eg, company) []:.
## Organizational Unit Name (eg, section) []:.
## Common Name (eg, fully qualified host name) []:localhost
## Email Address []:.
$ openssl req -new -key transport-consensus.key -out transport-consensus.csr

# Generate a signed device certificate:
$ openssl x509 -req -in transport-consensus.csr -CA transport-ca.pem -CAkey transport-ca.key -CAcreateserial -out transport-consensus.crt -days 500 -sha256

构建文档

要构建文档,请运行以下命令:

root@kitploit:~
$ pip install -r requirements-docs.txt
$ cd docs
$ sphinx-build -b html -d build/doctrees -W source build/html

发布到 PyPi

  1. pip install --upgrade setuptools wheel
  2. pip install --upgrade twine
  3. python3 setup.py sdist bdist_wheel
  4. twine check dist/*
  5. twine upload --skip-existing dist/* --verbose
下载工具