StamusNetworks/stamusctl-templates

GitHub: StamusNetworks/stamusctl-templates

Stamus Networks 的 Clear NDR 部署模板集合,通过 stamusctl 生成 Docker Compose 配置以快速搭建网络检测与响应平台。

Stars: 9 | Forks: 4

# Clear NDR 模板 ## 概述 本仓库提供了使用 `stamusctl` 部署 Stamus Networks 安全解决方案的公开模板。这些模板会被 CLI 工具使用,以生成 Docker Compose 配置和相关部署文件。 如需完整的文档,请访问 [https://docs.clearndr.io/](https://docs.clearndr.io/)。 ## 可用模板 ### Clear NDR `clearndr` 模板部署了包含以下组件的 Clear NDR Community: - **Suricata**:网络入侵检测系统 - **Scirius**:基于 Web 的规则管理和事件分析 - **OpenSearch**:搜索和分析引擎 - **OpenSearch Dashboards**:数据可视化界面 - **Arkime**:网络数据包捕获和分析 - **Evebox**:事件和告警管理 - **AI Chat (LibreChat)**:基于 AI 的聊天界面(可选) - **NGINX**:Web 代理和 SSL 终止 ## 模板结构 ``` data/ ├── clearndr/ # Clear NDR template │ ├── compose.yml # Main Docker Compose template │ ├── config.yaml # Template configuration │ └── [components]/ # Component-specific configs └── tests/ # Test configurations ``` ## 配置值 ### Clear NDR 模板 | Key | Default | Usage | | ----------------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | | aichat | false | 启用 AI Chat (LibreChat) 功能 | | aichat.openPort | true | 暴露 AI Chat 端口 | | aichat.port | 3000 | 在主机上暴露 AI Chat 的端口 | | aichat.anthropic_api_key | | Claude 模型的 Anthropic API 密钥 | | aichat.openai_api_key | | GPT-4/GPT-4o 模型的 OpenAI API 密钥 | | aichat.google_api_key | | Gemini 模型的 Google API 密钥 | | aichat.default_user_email | admin@clearndr.local | 默认用户邮箱(首次启动时自动创建) | | aichat.default_user_password | clearndr | 默认用户密码(最少 8 个字符) | | aichat.default_user_name | Admin | 默认用户显示名称 | | arkime.openport | false | 为 Arkime Viewer 打开端口? | | cron.logrotate.enabled | true | 为 Suricata 日志启用 logrotate | | cron.logrotate.period | daily | Logrotate 周期 (`1min`, `daily`, `weekly`, `monthly`) | | cron.updatesurirules.enabled | true | 启用 Suricata 规则的自动更新 | | cron.updatesurirules.period | daily | 更新周期 (`1min`, `daily`, `weekly`, `monthly`) | | evebox.version | master | 要安装的 Evebox 版本 | | globals.restartmode | unless-stopped | 所有服务的重启模式 | | globals.proxy.enabled | false | 为所有服务启用代理支持 | | globals.proxy.http | | HTTP 代理 URL (例如 http://proxy.company.com:3128) | | globals.proxy.https | | HTTPS 代理 URL (例如 http://proxy.company.com:3128) | | globals.proxy.no_proxy | localhost,127.0.0.1,opensearch,opensearch-dashboards,scirius,scout,nginx | 不应使用代理的主机逗号分隔列表 | | nginx.ssl.certname | scirius.crt | 证书文件的名称。仅在 ssl.enabled 为 true 时使用。 | | nginx.ssl.enabled | true | 为 NGINX 启用 SSL | | nginx.ssl.folder | | 主机上包含 SSL 证书的文件夹。如果设置,则禁用自动生成自签名证书。请使用绝对路径。 | | nginx.ssl.keyname | scirius.key | 私钥文件的名称。仅在 ssl.enabled 为 true 时使用。 | | opensearch.dashboards.openport | true | 暴露 OpenSearch Dashboards 端口 | | opensearch.datapath | opensearch-data | 主机上用于存储 OpenSearch 数据的数据路径 | | opensearch.ism.delete_min_index_age | 15d | 转换为删除状态前的最小索引期限 | | opensearch.ism.warm_min_index_age | 7d | 转换为 warm 状态前的最小索引期限 | | opensearch.memory | 2g | OpenSearch 的内存限制 | | opensearch.openport | false | 暴露 OpenSearch 端口 | | rabbitmq.openport | false | 暴露 RabbitMQ 端口 | | scirius.celery.beat.restart | unless-stopped | Celery beat 重启模式 | | scirius.celery.worker.restart | unless-stopped | Celery worker 重启模式 | | scirius.debug | false | 启用调试模式 | | scirius.registry | ghcr.io/stamusnetworks/scirius | 查找 scirius 镜像的镜像仓库 | | scirius.version | clear-ndr-rc3 | 要安装的 Scirius 版本 | | suricata.additionalconfig | | Suricata 的附加配置 | | suricata.homenet | 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12 | 家庭网络 CIDR 范围 | | suricata.interfaces | | 要监控的网卡接口列表 | | suricata.unixsocket.enabled | false | 为 Suricata Eve 日志启用 Unix Socket 输出? | | Key | Default | Usage | ## 模板变量 模板使用 Go 模板语法以及以下顶级变量: | Variable | Description | | ------------------ | ------------------------------------------------ | | .Values | 用户提供的配置值 | | .Release.name | Release 的名称 | | .Release.user | 创建 Release 的用户 | | .Release.group | 创建 Release 的用户组 | | .Release.location | Release 部署位置 | | .Release.isUpgrade | 本次 Release 是否为升级 | | .Release.isInstall | 本次 Release 是否为安装 | | .Release.service | 创建 Release 的服务 (stamusctl/stamusd) | | .Template.name | 当前模板的名称 | | .Release.version | 当前模板的版本 | ## 用法 模板会被 `stamusctl` 使用: ``` # 使用默认 template 初始化 (clearndr) stamusctl compose init # 使用自定义值初始化 stamusctl compose init suricata.interfaces=eth0 opensearch.memory=4g # 使用特定 template 版本 stamusctl compose init --version v1.2.0 # 查看可用的配置 keys stamusctl config keys --markdown ``` ## 开发 ### 模板开发 模板使用 Go 的 `text/template` 包以及 [Sprig](https://github.com/Masterminds/sprig) 函数。 **关键指南:** - 使用具有描述性的配置键 - 提供合理的默认值 - 包含详尽的文档 - 在各种配置场景下进行测试 ### 测试 在本地测试模板: ``` # 构建和测试 template make -C bin/tests # 测试特定配置 stamusctl compose init --template ./data/clearndr suricata.interfaces=eth0 ``` ### 问题 向本仓库报告与模板相关的问题: - 模板配置问题 - 缺失的模板功能 - 文档改进 - 新模板请求 ## 许可证 本项目采用 GNU General Public License v3.0 (GPL-3.0) 授权。有关详细信息,请参阅 [LICENSE](LICENSE) 文件。 ## 支持 - **文档**:[https://docs.clearndr.io/](https://docs.clearndr.io/) - **问题**:[GitHub Issues](https://github.com/StamusNetworks/stamusctl-public-templates/issues) - **主要 CLI 工具**:[stamusctl](https://github.com/StamusNetworks/stamusctl) - **专业支持**:[Stamus Networks](https://www.stamus-networks.com/)
标签:Docker Compose, Metaprompt, NDR, 版权保护, 网络安全, 网络流量分析, 负责任AI, 运维部署, 隐私保护