SureshXavier/SOC-Lab

GitHub: SureshXavier/SOC-Lab

基于Splunk的SOC实验室,实现日志集中管理和分析。

Stars: 0 | Forks: 0

# 🛡️ 搭建 Splunk SOC 实验环境 ### Windows Universal Forwarder · Deployment Server · Syslog · 防火墙监控 [![Splunk](https://img.shields.io/badge/Splunk-Enterprise-FF6600?style=for-the-badge&logo=splunk&logoColor=white)](https://www.splunk.com) [![Platform](https://img.shields.io/badge/Platform-Kali_Linux_+_Windows-557C94?style=for-the-badge&logo=linux&logoColor=white)](https://www.kali.org) [![SIEM](https://img.shields.io/badge/Category-SIEM_|_SOC_|_Log_Management-00b4d8?style=for-the-badge)](#) [![Status](https://img.shields.io/badge/Status-Operational-00f5c4?style=for-the-badge)](#) **作者:** Suresh Xavier — Security Operations Engineer **联系方式:** [xavierreivax15@gmail.com](mailto:xavierreivax15@gmail.com)
## 📌 概述 为了强化实战中的 SIEM 和 SOC 技能,我设计并部署了一个完整的基于 Splunk 的日志聚合环境,使用了 **Windows 端点**和 **Kali Linux 虚拟机**。目标是复现企业安全运营中心(SOC)中的日志收集与转发 pipeline —— 从 forwarder 部署到集中化搜索与分析,手动配置每一个组件。 ## 🏗️ 实验架构 ``` ┌──────────────────────────────────────┐ ┌─────────────────────────────────────────┐ │ MACHINE 01 │ │ MACHINE 02 │ │ Windows Endpoint │ │ Kali Linux VM │ │ │ │ │ │ ┌───────────────────────────────┐ │ │ ┌───────────────────────────────────┐ │ │ │ Splunk Universal Forwarder │───┼──9997──┼─▶│ Heavy Forwarder (:9997) │ │ │ │ inputs.conf / outputs.conf │◀──┼──8089──┼──│ Deployment Server (:8089) │ │ │ └───────────────────────────────┘ │ │ │ Search Head (:8000) │ │ │ │ │ │ rsyslog (:514) │ │ │ Log Sources: │ │ └───────────────────────────────────┘ │ │ ├── WinEventLog:Application │ │ │ │ ├── WinEventLog:Security │ │ Custom Indexes: │ │ ├── WinEventLog:System │ │ ├── windows_logs (961 events) │ │ └── pfirewall.log (Firewall) │ │ └── linux_logs (9,759 events) │ └──────────────────────────────────────┘ └─────────────────────────────────────────┘ Kali Linux rsyslog (UDP/TCP :514) — ready for syslog sources ``` ## 🧰 使用的技术 | 组件 | 角色 | |---|---| | Splunk Enterprise | Search Head, Heavy Forwarder, Deployment Server | | Splunk Universal Forwarder | Windows 上的日志收集 agent | | Deployment Server | 集中化 forwarder 配置管理 | | Heavy Forwarder | 日志接收与路由(端口 9997) | | rsyslog | 在 Kali Linux 上配置的 Syslog 监听器(UDP/TCP 514) | | Windows Defender 防火墙 | 防火墙日志源(pfirewall.log) | | Windows 事件查看器 | Windows 日志源(Application, Security, System) | | VMware Workstation | 虚拟化平台 | | Kali Linux | Splunk 服务器主机操作系统 | ## ⚙️ 配置 ### Universal Forwarder — 转发目标 ``` # outputs.conf [tcpout] defaultGroup = splunk-server [tcpout:splunk-server] server = 192.168.252.128:9997 ``` ### Universal Forwarder — Deployment Client ``` # deploymentclient.conf [target-broker:deploymentServer] targetUri = 192.168.252.128:8089 ``` ### Windows 事件日志收集 ``` # inputs.conf [WinEventLog://Application] disabled = 0 [WinEventLog://Security] disabled = 0 [WinEventLog://System] disabled = 0 ``` ### Windows 防火墙日志监控 ``` # inputs.conf [monitor://C:\Windows\System32\LogFiles\Firewall\pfirewall.log] disabled = 0 sourcetype = windows_firewall ``` ### rsyslog — Syslog 监听器(Kali Linux) ``` # rsyslog.conf module(load="imudp") input(type="imudp" port="514") module(load="imtcp") input(type="imtcp" port="514") ``` ## 🗂️ 创建的自定义 Index 创建了两个专用的 index 来分离和组织接入的数据 —— 映射企业级 index 设计,以实现更快的搜索和更好的访问控制。 | Index | 来源 | 捕获的事件 | |---|---|---| | `windows_logs` | 通过 Universal Forwarder 的 Windows 端点 | 961 个事件 | | `linux_logs` | Kali Linux 虚拟机 — Splunk 内部日志 + syslog | 9,759 个事件 | ## 🔄 数据流 ``` Windows Event Logs │ ▼ Splunk Universal Forwarder ──────────────────────────────────────────────┐ │ │ │ TCP :9997 TCP :8089 mgmt │ ▼ │ Heavy Forwarder ──▶ index=windows_logs Deployment Server ◀─────┘ │ ▼ Splunk Search Head ◀──── rsyslog (:514) ◀──── Kali Linux syslog index=linux_logs ``` | 来源 | 目标 Index | 端口 | |---|---|---| | Windows 事件日志 | windows_logs | 9997 | | Windows 防火墙(pfirewall.log) | windows_logs | 9997 | | Kali Linux syslog | linux_logs | 514 | | Deployment 管理 | — | 8089 | ## 📊 SOC 监控仪表板 在 Splunk 中构建了实时 SOC 监控仪表板,以直观展示整个实验环境的全貌 —— 涵盖事件量、sourcetype 分布、Splunk 运行状况、forwarder 连接状态、失败的登录尝试以及顶部日志源。 ### 面板 01 — 按 Host 和 Sourcetype 统计的事件 | Host | 事件计数 | |---|---| | `kali` (Kali Linux 虚拟机) | ~95,000 个事件 | | `Suresh` (Windows 端点) | ~4,000 个事件 | Sourcetype 细分确认了正在活跃接入 `WinEventLog:Security`、`WinEventLog:Application` 和 `WinEventLog:System`。 ### 面板 02 — Splunk 健康状况与 Forwarder 状态 - 健康状况饼图显示了按 `INFO`、`WARN` 和 `ERROR` 划分的日志严重程度 - Forwarder 状态图确认 Windows Universal Forwarder (`Suresh`) 已活跃连接并向 Splunk 服务器报告 ### 面板 03 — 失败的登录尝试与顶部日志源 - **失败的登录尝试:** 未找到结果 — 确认在此期间环境是干净的,没有暴力破解或身份验证失败的活动 - **顶部日志源:** `mongod.log` 领先,约 52,500 个事件,其次是 `metrics.log` (~17,500) 和 `splunkd.log` (~11,000),`WinEventLogSecurity` 也出现在顶部日志源中 ## 🚨 配置的自动化告警 配置了三个定时安全告警,用于主动检测基础设施和数据接入问题 —— 模拟真实的 SOC 告警工作流。 | 告警 | 触发条件 | 计划时间 | 状态 | |---|---|---|---| | 🔴 检测到 Splunk Enterprise 关闭 | Splunk HF 宕机 | 2026-06-02 12:00 IST | ✅ 已启用 | | 🟠 Windows 日志接入量低 | UF 发送的日志量过低 | 2026-06-03 02:00 IST | ✅ 已启用 | | 🟡 Windows Universal Forwarder 离线 | UF 停止 Splunk 服务 | 2026-06-02 12:00 IST | ✅ 已启用 | ## 🎯 展示的技能
**🔧 Splunk 管理** - Universal Forwarder 部署 - Deployment Server 配置 - Heavy Forwarder 设置 - 自定义 index 创建 - 数据接入与输入管理 **📋 日志管理** - Windows 事件日志收集 - 防火墙日志监控 - Syslog 收集(UDP + TCP) - 集中化日志聚合 - 基于 index 的数据分离
**🔍 安全监控** - 身份验证事件监控 - 网络流量分析 - 防火墙事件审查 - 自动化告警(3 个活跃告警) - SOC 仪表板创建 - 失败登录检测 **🐧 Linux 管理** - 在 Kali Linux 上安装 Splunk - 服务与端口管理 - rsyslog 配置 - 远程日志目录结构化
## ✅ 成果 成功构建了一个功能完整的 Splunk SOC 实验室,可以从 **5 个不同的来源**收集并集中管理日志: - [x] Windows 应用程序日志 - [x] Windows 安全日志 - [x] Windows 系统日志 - [x] Windows 防火墙日志(pfirewall.log) - [x] Syslog 事件(UDP + TCP :514) - [x] 自定义 Index — `windows_logs` & `linux_logs` - [x] 3 个自动化安全告警 — 活跃且已计划 - [x] 实时 SOC 监控仪表板 — 5 个面板 该实验室模拟了**真实的企业级日志架构**,并提供了使用 Splunk 进行 SIEM 管理、日志接入、安全监控、仪表板构建以及集中化日志管理的实战经验。 ## 📁 仓库结构 ``` splunk-soc-lab/ ├── README.md └── configs/ ├── inputs.conf # Windows Event Log + Firewall inputs ├── outputs.conf # UF forwarding target ├── deploymentclient.conf # Deployment Server registration └── rsyslog.conf # Syslog UDP/TCP listener ```
**Suresh Xavier** · Security Operations Engineer 📧 [xavierreivax15@gmail.com](mailto:xavierreivax15@gmail.com) *每一个组件均为手动配置 — 没有任何捷径。*
标签:OISF, SIEM, Splunk, 后端开发, 安全监控, 安全运营中心, 日志管理, 网络映射