收集 Windows Defender 防病毒日志

支持的平台:

本文档介绍了如何使用 Bindplane 将 Windows Defender 防病毒日志注入到 Google Security Operations。

Windows Defender 防病毒软件是 Microsoft Windows 中的内置反恶意软件引擎,可提供实时威胁检测、扫描结果和保护事件日志。Bindplane 代理直接从本地文件系统收集导出的 Windows Defender 事件日志文件。

准备工作

请确保满足以下前提条件:

  • Google SecOps 实例
  • Windows Server 2016 或更高版本,支持 observiq-otel-collector 服务
  • 如果在代理后面运行,请确保防火墙端口已根据 Bindplane 代理要求打开
  • 对运行 Windows Defender 防病毒软件的 Windows 端点的管理员访问权限

获取 Google SecOps 注入身份验证文件

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 收集代理
  3. 下载数据注入身份验证文件。将该文件安全地保存在将要安装 Bindplane 的系统上。

获取 Google SecOps 客户 ID

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 配置文件
  3. 复制并保存组织详细信息部分中的客户 ID

安装 Bindplane 代理

按照以下说明在 Windows 操作系统上安装 Bindplane 代理。

Windows 安装

  1. 以管理员身份打开命令提示符PowerShell
  2. 运行以下命令:

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    
  3. 等待安装完成。

  4. 运行以下命令,验证安装是否成功:

    sc query observiq-otel-collector
    

该服务应显示为 正在运行

其他安装资源

如需了解其他安装选项和问题排查信息,请参阅 Bindplane 代理安装指南

配置 Bindplane 代理以注入日志并将其发送到 Google SecOps

找到配置文件

  • Windows

    notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
    

修改配置文件

  • config.yaml 的全部内容替换为以下配置:

    receivers:
        filelog:
            include:
                - C:\Logs\defender-av\*.evtx
            start_at: beginning
    
    exporters:
        chronicle/windows_defender_av:
            compression: gzip
            creds_file_path: 'C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json'
            customer_id: '<customer_id>'
            endpoint: malachiteingestion-pa.googleapis.com
            log_type: WINDOWS_DEFENDER_AV
            raw_log_field: body
            ingestion_labels:
                env: production
    
    service:
        pipelines:
            logs/defender_av_to_chronicle:
                receivers:
                    - filelog
                exporters:
                    - chronicle/windows_defender_av
    

配置参数

替换以下占位符:

  • 接收器配置

    • filelog:用于从磁盘收集日志文件的接收器类型
    • include:要监控的文件路径列表。将此变量设置为您导出 Windows Defender 事件日志的位置(例如 C:\Logs\defender-av\*.evtx
    • start_at:设置为 beginning 可读取现有日志,设置为 end 可仅读取新条目
  • 导出器配置

    • windows_defender_av:导出器的描述性名称
    • creds_file_path:提取身份验证文件的完整路径:
      • WindowsC:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
    • <customer_id>:上一步中的客户 ID
    • endpoint:区域端点网址:
      • 美国malachiteingestion-pa.googleapis.com
      • 欧洲europe-malachiteingestion-pa.googleapis.com
      • 亚洲asia-southeast1-malachiteingestion-pa.googleapis.com
      • 如需查看完整列表,请参阅区域级端点
    • WINDOWS_DEFENDER_AV:日志类型,与在 Chronicle 中显示的完全一致
    • ingestion_labels:YAML 格式的可选标签(例如 env: production
  • 流水线配置

    • defender_av_to_chronicle:流水线的描述性名称

保存配置文件

  • 修改后,保存文件:
    • Windows:依次点击文件 > 保存

重启 Bindplane 代理以应用更改

如需在 Windows 中重启 Bindplane 代理,请执行以下操作:

  1. 请从下列选项中选择一项:

    • 以管理员身份运行命令提示符或 PowerShell:
    net stop observiq-otel-collector && net start observiq-otel-collector
    
    • 服务控制台:
      1. Win+R,输入 services.msc,然后按 Enter 键。
      2. 找到 observIQ OpenTelemetry 收集器
      3. 右键点击并选择重新启动
  2. 验证服务是否正在运行:

    sc query observiq-otel-collector
    
  3. 检查日志是否存在错误:

    type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
    

配置 Windows Defender 防病毒软件日志导出

Windows Defender 防病毒日志存储在 Windows 事件日志中的 Microsoft-Windows-Windows Defender/Operational 下。您需要将这些日志导出到磁盘上的文件中,以便 Bindplane 代理可以收集它们。

  1. 创建一个目录来存储导出的日志文件:

    mkdir C:\Logs\defender-av
    
  2. 使用 wevtutil 导出 Windows Defender 防病毒软件事件日志:

    wevtutil epl "Microsoft-Windows-Windows Defender/Operational" C:\Logs\defender-av\defender-av.evtx
    
  3. (可选)使用 Windows 任务计划程序安排定期导出:

    $action = New-ScheduledTaskAction -Execute "wevtutil" -Argument 'epl "Microsoft-Windows-Windows Defender/Operational" C:\Logs\defender-av\defender-av.evtx /ow:true'
    $trigger = New-ScheduledTaskTrigger -RepetitionInterval (New-TimeSpan -Hours 1) -Once -At (Get-Date)
    Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "ExportDefenderLogs" -Description "Export Windows Defender AV logs for Bindplane agent"
    
  4. 验证导出的日志文件是否正在 `C:\Logs\defender-av` 中创建。

  5. 确保 config.yaml 中的 Bindplane 代理 include 路径与导出目录一致。

UDM 映射表

日志字段 UDM 映射 逻辑
OpcodeValue、ThreadID、渠道、引擎版本、安全情报版本、网络实时检查引擎版本、网络实时检查安全情报版本、rtp_state、oa_state、ioav_state、bm_state、防病毒安全情报使用时长、反间谍软件安全情报使用时长、上次快速扫描使用时长、上次完整扫描使用时长、防病毒安全情报创建时间、反间谍软件安全情报创建时间、上次快速扫描开始时间、上次快速扫描结束时间、上次快速扫描来源、上次完整扫描开始时间、上次完整扫描结束时间、上次完整扫描来源、产品状态 additional.fields 如果非空,则与标签映射合并 {key: field name, value: {string_value: field value}}
metadata.description 根据 EventID 设置为特定于事件的说明字符串
metadata.event_type 如果 has_principal 为 true,则设置为“SCAN_HOST”,否则设置为“GENERIC_EVENT”;对于 EventID 1011、1116、1117,设置为“SCAN_FILE”
ProviderGuid metadata.product_deployment_id 移除 {} 后 ProviderGuid 中的值
metadata.product_event_type 根据 EventID 设置为特定于活动的商品活动类型字符串
RecordNumber metadata.product_log_id 直接复制为字符串的值
platform_version metadata.product_version 直接复制值
FWLink metadata.url_back_to_product 直接复制值
metadata.vendor_name 设置为“Microsoft”
metadata.product_name 设置为“Windows Defender AV”
SourceModuleType observer.application 直接复制值
网域,_domain principal.administrative_domain 来自网域的值,或使用 grok 从检测用户中提取的 _domain(针对 EventID 1116、1117)
主机名 principal.hostname 直接复制值
进程名称 principal.process.file.full_path 直接复制了 EventID 1116、1117 的值
ProcessID principal.process.pid 直接复制值
SourceModuleName principal.resource.name 直接复制值
AccountType principal.user.role_description 直接复制值
AccountName principal.user.user_display_name 直接复制值
用户、UserID、_account principal.user.userid 来自用户的值,如果非空,则为 UserID;否则,为使用 grok 从检测用户中提取的 _account(针对 EventID 1116、1117)
SourceName security_result.about.resource.attribute.labels 如果非空,则与标签映射 {key: "SourceName", value: SourceName} 合并
security_result.action 默认设置为“ALLOW”;对于 EventID 1116,设置为“BLOCK”;对于 EventID 1117,设置为“QUARANTINE”
security_result.category 对于 EventID 1011、1116、1117,设置为“SOFTWARE_MALICIOUS”
ActivityID security_result.detection_fields 如果 ActivityID 不为空且不为“-”,则与 detection_fields {key: "Activity ID", value: ActivityID} 合并
EventID security_result.description 设置为“EventID: %{EventID}”
威胁名称 security_result.rule_name 直接复制了 EventID 1011、1116、1117 的值
严重程度、级别、EventType security_result.severity 如果严重程度与 verbose|information|info 匹配,则设置为 LOW;如果与 warning|error 匹配,则设置为 MEDIUM;如果与 critical 匹配,则设置为 HIGH;严重程度可从 Level (5|4 -> information, 2|3 -> warning, 1 -> critical) 或 EventType (ERROR -> %{severity}, INFO -> "INFORMATIONAL", else severity_details) 设置
严重程度名称、严重程度 security_result.severity_details 来自 EventID 1011、1116、1117 的严重程度名称的值;或来自非 ERROR 或 INFO 的 EventType 的严重程度
威胁名称 security_result.summary 直接复制了 EventID 1011、1116、1117 的值
类别名称 security_result.threat_name 直接复制了 EventID 1011、1116、1117 的值
FWLink security_result.url_back_to_product 直接复制了 EventID 1011、1116、1117 的值
路径 target.file.full_path 直接复制了 EventID 1116、1117 的值
target.hostname 对于 EventID 1117,设置为“”(空字符串)
路径 target.registry.registry_key 直接复制了 EventID 1011 的值
EventRecordID event.idm.read_only_udm.metadata.product_log_id 从变更日志映射
Product Version event.idm.read_only_udm.metadata.product_version 从变更日志映射
ProviderGuid event.idm.read_only_udm.metadata.product_deployment_id 从变更日志映射
Hostname event.idm.read_only_udm.principal.asset.hostname 从变更日志映射
xmlns event.idm.read_only_udm.principal.url 从变更日志映射
Threat Resource Path event.idm.read_only_udm.target.file.full_path 从变更日志映射
Hashes event.idm.read_only_udm.target.file.sha1 从变更日志映射
RenderingInfoLevel event.idm.read_only_udm.security_result.severity_details 从变更日志映射
Action Name event.idm.read_only_udm.security_result.action_details 从变更日志映射
Detection Time event.idm.read_only_udm.security_result.first_discovered_time 从变更日志映射
Threat ID event.idm.read_only_udm.security_result.threat_id 从变更日志映射
Remediation User event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Status Description event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Action ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Additional Actions ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Additional Actions String event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Category ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Detection ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Engine Version event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Error Code event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Error Description event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Execution ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Execution Name event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Origin ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Origin Name event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Post Clean Status event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Pre Execution Status event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Security Intelligence Version event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Severity ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Source ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
State event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Status Code event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Type ID event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Type Name event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
Level event.idm.read_only_udm.additional.fields 从变更日志映射
Culture event.idm.read_only_udm.additional.fields 从变更日志映射
Keywords event.idm.read_only_udm.additional.fields 从变更日志映射
Opcode event.idm.read_only_udm.additional.fields 从变更日志映射
Product Name event.idm.read_only_udm.additional.fields 从变更日志映射
Provider Name event.idm.read_only_udm.additional.fields 从变更日志映射
RenderingInfoMessage event.idm.read_only_udm.additional.fields 从变更日志映射
Service event.idm.read_only_udm.additional.fields 从变更日志映射
Task event.idm.read_only_udm.additional.fields 从变更日志映射
Version event.idm.read_only_udm.additional.fields 从变更日志映射
Security UserID event.idm.read_only_udm.additional.fields 从变更日志映射
EventID event.idm.read_only_udm.security_result.summary 从变更日志映射

更新日志

查看相应解析器的更改日志

需要更多帮助?获得社区成员和 Google SecOps 专业人士的解答。