Muts256/Sentinel

GitHub: Muts256/Sentinel

基于 Azure 云环境的 Microsoft Sentinel 安全运营实验室,演示蜜罐部署、日志分析、威胁检测与事件响应的完整 SOC 工作流程。

Stars: 0 | Forks: 0

嗨,我是 Michael!
网络安全专家

👨‍💻 Sentinel 配置与调查

## Sentinel 通过在 Microsoft Azure 中部署蜜网(honeynet),将安全日志转发到 Microsoft Sentinel,并实时检测暴力破解攻击,模拟安全运营中心(SOC)环境。该项目展示了端到端的 SOC 工作流程,包括日志摄取、使用 KQL 查询进行威胁检测、事件创建与调查,以及利用 Pulsedive 等外部威胁情报源进行丰富化。 ## 摘要: - 目标:使用 Microsoft Sentinel 和 KQL 调查模拟的数据泄露。 - 工具:Microsoft Sentinel、Log Analytics Workspace、KQL、Azure VM 日志。 - 重点:识别异常、追踪攻击者行为、重构时间线。 - 展示的关键技能:日志分析、事件调查、IOC 关联、威胁搜寻逻辑。 - 结果:发现了暴力破解指标并开发了用于检测的分析查询。 ### 工具与技术: - Microsoft Sentinel。 - KQL (Kusto Query Language)。 - Azure Log Analytics Workspace。 - Azure VM 安全日志。 - Pulsedive 威胁情报集成。 - SecurityAlert、SecurityEvent、Syslog 数据集。 ## Sentinel 配置 ### 拓扑 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se1.png) ### 什么是 Sentinel? Microsoft Sentinel 是一个云原生的安全信息事件管理(SIEM)系统。它收集、规范化并分析来自整个环境(本地、云、第三方)的安全日志/事件。 Sentinel 也是一个安全编排自动化与响应(SOAR)平台。它通过 playbook 自动化响应,因此可以在无需人工干预的情况下快速遏制或修复事件。 ### 创建资源组 (RG) 在订阅下的 Azure 账户中,创建一个资源组。资源组是一个逻辑容器,用于保存相关的 Azure 资源。 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se2.png) ### 创建虚拟网络 (Vnet) Vnet 是 Azure 内部的逻辑隔离网络,您可以在其中安全地运行和连接 Azure 资源。它的工作方式与本地网络相同,但托管在 Azure 中。 确保在与上一步创建资源组时相同的资源组和区域下创建 VNet ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se3.png) ### 创建虚拟机 (VM) 这是一台将故意留作未受保护状态以引诱攻击者的 VM,即蜜罐。搜索 Virtual Machine 并点击 Virtual Machines 开始创建它。 在与 RG 和 Vnet 相同的资源组和区域中创建 VM 填写所需详细信息。在大小方面至少使用 2vcpus。更低的配置将会非常缓慢。确保确认您拥有许可证,否则过程将失败 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se5.png) VM 验证完成后点击 Create。 部署 VM 后。导航到网络安全组 (NSG) 并创建一个允许来自任何源的任何流量的规则 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se10.png) 使用 RDP 登录到 VM。关闭防火墙。 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se12.png) 测试 ICMP 是否得到响应 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se14.png) 在 Azure 中,在搜索中键入 Log Analytics 以创建工作区。这是 Sentinel 日志摄取的要求。创建工作区并将其添加到 Sentinel ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se19.png) 在 Microsoft Sentinel 页面中,点击内容管理,然后点击内容中心选项卡并选择 Windows Security Events ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se21.png) 在 Windows Security Events 页面上,点击 install ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se22.png) 这将安装 Azure Monitor Agent ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se23.png) 选择 Azure Monitor Agent,然后点击 Manage 以安装数据连接器。 ![image alt](https://github.com/Muts256/SNC-Public/blob/c230cd4bd37cc83b1030ccc097ef15cd5fd20850/Images/Sentinel/Se24.png) 接下来,创建一个数据收集规则。此规则将指示代理从所选 Windows 设备上的事件日志中收集日志 在配置选项卡中,点击 Create Collection Rule ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se26.png) 在 Basic 选项卡中,填写规则名称,选择与 VM 创建时相同的资源组 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se27.png) 在 Resources 选项卡中选择之前创建的 VM ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se28.png) 点击 Review + create 以创建规则。 导航到 Sentinel 中的 logs 选项卡。注意:日志可能需要一段时间才能从 VM 摄取。 要测试日志是否已被摄取,请编写查询以显示一些数据 ``` SecurityEvent | where EventID == "4625" ``` 此查询将显示所有已记录的失败登录。 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se33.png) ### 在地图上绘制 IP 地址 要绘制这些 IP 起源的大致区域的 IP 地址,我们需要创建一个 Watchlist。 点击 Sentinel 实例,在 configure 下,点击 Watchlist,使用 watchlist 向导创建一个新的 watchlist ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se35.png) 导航到此 GitHub,将 CSV 文件下载到您的本地设备 ``` https://raw.githubusercontent.com/joshmadakor1/lognpacific-public/refs/heads/main/misc/geoip-summarized.csv ``` 此 csv 将帮助估算事件日志中捕获的 IP 地址的来源/位置。 将 csv 导入 watchlist 实例。点击 Source,然后将文件拖放到 csv 文件的位置。确保在 SearchKey 字段中选择 network。 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se37.png) 点击 Review and create。 等待 csv 文件导入 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se39.png) 在 Microsoft Sentinel 上创建一个 workbook。点击 Add a workbook。 ![image alt](https://github.com/Muts256/SNC-Public/blob/944309b8538cfda11bf3315ce5dcb05450fb484d/Images/Sentinel/Se40.png) 在右侧点击 edit,删除 workbook 中的所有内容。 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se41.png) 再次点击 Edit,为 workbook 指定标题和位置。点击 save ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se42.png) 点击 Open in Azure。点击 edit。选择 advanced query。复制并粘贴 map.json 内容 导航到此网站 ``` https://drive.google.com/file/d/1ErlVEK5cQjpGyOcu4T02xYy7F31dWuir/view?usp=drive_link ``` 将 map.json 内容复制到 advanced query 并点击 done editing ``` { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let GeoIPDB_FULL = _GetWatchlist(\"geoip\");\nlet WindowsEvents = SecurityEvent;\nWindowsEvents | where EventID == 4625\n| order by TimeGenerated desc\n| evaluate ipv4_lookup(GeoIPDB_FULL, IpAddress, network)\n| summarize FailureCount = count() by IpAddress, latitude, longitude, cityname, countryname\n| project FailureCount, AttackerIp = IpAddress, latitude, longitude, city = cityname, country = countryname,\nfriendly_location = strcat(cityname, \" (\", countryname, \")\");", "size": 3, "timeContext": { "durationMs": 2592000000 }, "queryType": 0, "resourceType": "microsoft.operationalinsights/workspaces", "visualization": "map", "mapSettings": { "locInfo": "LatLong", "locInfoColumn": "countryname", "latitude": "latitude", "longitude": "longitude", "sizeSettings": "FailureCount", "sizeAggregation": "Sum", "opacity": 0.8, "labelSettings": "friendly_location", "legendMetric": "FailureCount", "legendAggregation": "Sum", "itemColorSettings": { "nodeColorField": "FailureCount", "colorAggregation": "Sum", "type": "heatmap", "heatmapPalette": "greenRed" } } }, "name": "query - 0" } ``` 将显示一个地图,标示攻击 IP 地址起源的大致区域。 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se43.png) ### 创建计划规则 计划规则是在定期间隔运行的自动化查询或检测逻辑,用于搜索数据中的特定模式、异常或威胁 在 Analytics 选项卡中,点击 creare a new Schedule rule ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se44.png) 在 MITRE ATT&CK 部分,选择所有相关的战术、技术和子技术 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se46.png) 设置查询逻辑 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se45.png) ### 查询解释 SecurityEvent - 这指定了您要查询的表。 - 在 Azure Log Analytics 中,SecurityEvent 包含 Windows 安全事件日志。 - 这些内容包括登录尝试、权限使用、账户管理等。 | where EventID == 4625 - 过滤数据以仅包含 EventID 为 4625 的行(事件)。 - 4625 是登录尝试失败(由于密码错误、用户未知等)的 Windows 事件 ID。 | project TimeGenarated, EventID, Computer, IpAddress, Account, LogonType - 这将仅选择(投影)您希望在结果中看到的特定列: - TimeGenerated:记录事件的时间 设置规则运行的频率。出于测试目的,我将其设置为每 5 分钟一次 ![image alt](https://github.com/Muts256/SNC-Public/blob/0f6a3a603176cb35bc3c93aea247e7915f3e2af3/Images/Sentinel/Se47.png) 保存规则 导航到 MDE 中的 incidents 选项卡。如果检测到违规或 EventID 4625,应该已经创建了一个或多个事件 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se50.png) 点击 incidents,然后点击 open incident page ![image alt](https://github.com/Muts256/SNC-Public/blob/08d929184427034bd911651411e24c21f5ad6326/Images/Sentinel/Se52.png) 将事件分配给分析师 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se51.png) 分析师可以添加任务并调查事件,做笔记并记录为完成所采取的行动。 ![image alt](https://github.com/Muts256/SNC-Public/blob/cf0772582c5d1da6ca58fd069f18df54cdac76d/Images/Sentinel/Se56.png) ## 威胁情报 **威胁情报 (TI)** 是指与现有和新出现的网络威胁相关的数据的收集、分析和应用。这包括如下信息: - 恶意 IP 地址和域名 - 恶意软件哈希 - 攻击技术和战术 - 威胁行为者行为和基础设施 威胁情报的主要目标是提供 **可操作的见解**,帮助安全团队更有效地预测、识别和响应威胁。 ### 为什么威胁情报在 SOC 中很重要 #### 1. 提高检测准确性 通过使用威胁情报源丰富警报和日志,SOC 分析师可以确定可疑活动是否与已知的恶意行为者或基础设施相关联。这减少了误报,并确保警报包含有意义的上下文。 #### 2. 主动防御 威胁情报使 SOC 团队能够通过识别新兴的 **战术、技术和程序 (TTP)**(通常映射到 **MITRE ATT&CK** 等框架)来领先于攻击者。这支持在攻击完全实现之前采取主动的防御措施。 #### 3. 更快的事件响应 在事件期间,威胁情报围绕 **危害指标** 提供有价值的上下文,使分析师能够快速确定优先级并响应高风险威胁。例如,将 IP 地址识别为已知僵尸网络的一部分可以加速遏制决策。 #### 4. 战略见解 除了日常操作之外,威胁情报通过突出针对组织行业的对手组织、常见攻击媒介和防御控制中的潜在差距,为长期安全战略提供信息。 #### 5. 与 SOC 工具集成 现代 **SIEM 和 SOAR 平台**,例如 **Microsoft Sentinel** 和 **Microsoft Defender XDR**,直接与威胁情报源(例如 **MISP**、**Pulsedive**)集成。这种集成确保实时威胁数据增强自动化检测、威胁搜寻和响应工作流程。 ### 连接威胁情报源 - Pulsedive 在 Data Connector 中打开 MDE 的 content hub。在搜索中输入 Threatintelligence ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se57.png) 选择 ThreatIntelligence (NEW) ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se58.png) 安装 Data Connector ![image alt](https://github.com/Muts256/SNC-Public/blob/0c83d8ffbcc2756e0abe8bdf4ff32a1677778634/Images/Sentinel/Se70.png) 安装完成后,点击 Manage 配置连接器 ![image alt](https://github.com/Muts256/SNC-Public/blob/821b19934fbc53b312f091be320d57a6f96c34d4/Images/Sentinel/Se71.png) 在 PulseDive 官方网站上开设一个账户 ``` https://pulsedive.com/ ``` 导航到测试数据 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se63.png) 在同一页面上将有连接到源服务器所需的信息,包括用户名和密码 (API Key) ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se64.png) 在威胁情报页面打开连接器页面 ![image alt](https://github.com/Muts256/SNC-Public/blob/fec4b3ea3218e4601e4dc4abe340d400e51b4ddc/Images/Sentinel/Se72.png) 填写配置连接所需的详细信息 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se65.png) 如果详细信息正确,您应该会收到连接成功的通知 ![image alt](https://github.com/Muts256/SNC-Public/blob/61bb14162e0d1e777dc86ce76e03547f1d888ec4/Images/Sentinel/Se73.png) 一段时间后,来自 Pulsedive 的数据将被摄取到 Sentinel 中。 ![image alt](https://github.com/Muts256/SNC-Public/blob/345cc5e9441fc31ef50218313c8e0ffcb9e05b34/Images/Sentinel/Se68.png) Pulsedive 与 Microsoft Sentinel 的集成通过关于恶意 IP、域名和指标的实时威胁情报丰富安全事件。这种上下文丰富通过减少误报并帮助分析师快速识别已知的威胁基础设施,提高了检测准确性。Pulsedive 数据的自动摄取也加强了 SOC 内的主动威胁搜寻并加速了事件响应。 ### 调查步骤摘要: - 将 Windows 设备的事件日志摄取到 Sentinel 中。 - 识别暴力破解尝试。 - 使用 KQL 检测重复的失败身份验证尝试。 - 通过将指标映射到 MITRE ATT&CK 框架来构建分析检测规则。 - 生成工单,并将其分配给 SOC 成员进行调查。 - 配置来自威胁情报源 的额外指标,以实现更快、更广泛的检测范围。 ### 建议: - 对所有外部可访问的系统强制执行 MFA。 - 实施基于地理位置的访问限制。 - 添加带有阈值的暴力破解检测规则。 - 监控可疑的命令行活动。 - 启用 Sentinel Fusion 关联以进行多阶段攻击检测。 ### 经验教训: - 配置网络威胁情报源以提高检测准确性、主动防御。 - 配置 Sentinel、Log Analytics 工作区和分析规则,分别用于日志摄取和异常检测。 - 使用 KQL 过滤噪音以便快速调查。 - 集中监控的价值。 - 事件处理工作流程。 [PDF](https://github.com/Muts256/Sentinel/blob/main/SOC%20Lab%20Honynet.pdf)

🤳 与我联系:

[michael-musoke | LinkedIn][linkedin]
标签:Azure Monitor, Azure 云安全, Azure 虚拟机, KQL, KQL 查询, Kusto 查询语言, Log Analytics Workspace, Microsoft Sentinel, Playbooks, Pulsedive, SOAR, 免杀技术, 威胁情报, 安全事件, 安全运营中心, 底层分析, 开发者工具, 攻击调查, 日志引入, 暴力破解检测, 红队行动, 网络安全项目, 网络映射, 蜜罐, 蜜网, 证书利用