收集 Microsoft IIS 日志

支持的平台:

本文档介绍了如何使用 BindPlane 将 Microsoft Internet Information Services (IIS) 日志收集到 Google 安全运营团队。解析器首先会尝试通过移除不必要的字符和标准化字段名称来清理和标准化输入数据。然后,它使用一系列 grok 模式从各种 Microsoft IIS 日志格式中提取相关字段,并将其映射到统一数据模型 (UDM)。

准备工作

  • 确保您拥有 Google SecOps 实例。
  • 确保您使用的是 Windows 2016 或更高版本。
  • 如果在代理后面运行,请确保防火墙端口处于打开状态。

获取 Google SecOps 提取身份验证文件

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

获取 Google SecOps 客户 ID

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

在 Windows 上安装 Bindplane 代理

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

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    

其他安装资源

  • 如需了解其他安装选项,请参阅此安装指南

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

  1. 在配置 YAML 文件之前,请在“服务”面板中停止 observIQ Distro for Open Telemetry Collector 服务
  2. 访问配置文件:

    1. 找到 config.yaml 文件。通常,在 Linux 上,该目录位于 /etc/bindplane-agent/ 目录中;在 Windows 上,该目录位于安装目录中。
    2. 使用文本编辑器(例如 nanovi 或记事本)打开该文件。
  3. 按如下方式修改 config.yaml 文件:

    receivers:
      iis:
        collection_interval: 60s
    
    processors:
      # Resourcedetection is used to add a unique (host.name) to the metric resource(s), allowing users to filter between multiple agent systems.
      resourcedetection:
        detectors: ["system"]
        system:
          hostname_sources: ["os"]
    
      normalizesums:
    
      batch:
    
    exporters:
      chronicle/powershell:
        endpoint: malachiteingestion-pa.googleapis.com
        # Adjust the path to the credentials file you downloaded in Step 1
        creds: '/path/to/ingestion-authentication-file.json'
        log_type: 'IIS'
        override_log_type: false
        raw_log_field: body
        customer_id: '<customer_id>'
    
    service:
      pipelines:
        logs/winpowershell:
          receivers:
            - iis
          processors:
            - resourcedetection
            - normalizesums
            - batch
          exporters: [chronicle/iis]
    
  4. <customer_id> 替换为实际的客户 ID。

  5. 获取 Google SecOps 提取身份验证文件部分中,将 /path/to/ingestion-authentication-file.json 更新为身份验证文件的保存路径。

  6. 保存 config.yaml 文件后,启动 observIQ Distro for Open Telemetry Collector 服务

重启 Bindplane 代理以应用更改

  • 如需在 Windows 中重启 Bindplane 代理,您可以使用服务控制台,也可以输入以下命令:

    net stop BindPlaneAgent && net start BindPlaneAgent
    

UDM 映射表

日志字段 UDM 映射 逻辑
@timestamp metadata.event_timestamp 原始日志中记录的事件时间戳。
@version metadata.product_version IIS 服务器的版本。
AgentDevice additional.fields.AgentDevice.value.string_value 生成日志的设备。
AgentLogFile additional.fields.AgentLogFile.value.string_value 日志文件的名称。
ASP.NET_SessionId network.session_id 用户的会话 ID。
c-ip principal.ip 客户端的 IP 地址。
频道 security_result.about.resource.attribute.labels.Channel.value 记录事件的渠道。
ChannelID security_result.about.resource.attribute.labels.ChannelID.value 记录事件的渠道的 ID。
计算机 target.hostname 目标机器的主机名。
cs-bytes network.received_bytes 从客户端接收的字节数。
cs-host principal.hostname、principal.asset.hostname 客户端的主机名。
cs-method network.http.method 客户端使用的 HTTP 方法。
cs-uri-query target.url 客户端请求的网址的查询字符串。
cs-uri-stem target.url 客户端请求的网址的路径。
cs-username principal.user.user_display_name 客户的用户名。
cs-version network.tls.version_protocol 客户端使用的 HTTP 版本。
cs(Cookie) 用于提取 Cookie 信息。
cs(引荐来源) network.http.referral_url 将客户引导至当前网页的网址。
cs(User-Agent) network.http.user_agent 客户端的用户代理。
csbyte network.received_bytes 从客户端接收的字节数。
cshost principal.hostname、principal.asset.hostname 客户端的主机名。
csip principal.ip、principal.asset.ip 客户端的 IP 地址。
csmethod network.http.method 客户端使用的 HTTP 方法。
csreferer network.http.referral_url 将客户引导至当前网页的网址。
csuseragent network.http.user_agent 客户端的用户代理。
csusername principal.user.user_display_name 客户的用户名。
csversion network.tls.version_protocol 客户端使用的 HTTP 版本。
日期 用于在原始日志时间戳无效时构建事件时间戳。
说明 security_result.description 事件说明。
devicename target.hostname 目标机器的主机名。
dst_ip target.ip、target.asset.ip 目标机器的 IP 地址。
dst_port target.port 目标计算机的端口号。
时长 请求时长(以毫秒为单位)。
EventEnqueuedUtcTime additional.fields.EventEnqueuedUtcTime.value.string_value 事件加入队列的时间(采用世界协调时间 [UTC])。
EventID metadata.product_log_id 事件的 ID。
EventProcessedUtcTime additional.fields.EventProcessedUtcTime.value.string_value 事件处理时间(世界协调时间 [UTC])。
EventTime metadata.event_timestamp 事件的时间戳。
EventType metadata.product_event_type 事件的类型。
file_path target.file.full_path 事件涉及的文件的完整路径。
FilterId security_result.about.resource.attribute.labels.FilterId.value 过滤条件的 ID。
FilterKey security_result.about.resource.attribute.labels.FilterKey.value 过滤条件的键。
FilterName security_result.about.resource.attribute.labels.FilterName.value 过滤条件的名称。
FilterType security_result.about.resource.attribute.labels.FilterType.value 过滤器的类型。
主机 target.hostname 目标机器的主机名。
host.architecture principal.asset.hardware.cpu_platform 宿主机的架构。
host.geo.name additional.fields.geo_name.value.string_value 宿主机所在的地理位置。
host.hostname target.hostname、target.asset.hostname 宿主机的宿主机名。
host.id observer.asset_id 宿主机的 ID。
host.ip principal.ip、principal.asset.ip 宿主机的 IP 地址。
host.mac principal.mac 宿主机的 MAC 地址。
host.os.build additional.fields.os_build.value.string_value 宿主机上的操作系统的 build 号。
host.os.kernel principal.platform_patch_level 宿主机上操作系统的内核版本。
host.os.name additional.fields.os_name.value.string_value 宿主机上的操作系统的名称。
host.os.platform principal.platform 宿主机上操作系统的平台。
host.os.version principal.platform_version 宿主机上的操作系统版本。
http_method network.http.method 客户端使用的 HTTP 方法。
http_response network.http.response_code HTTP 响应代码。
http_status_code network.http.response_code 响应的 HTTP 状态代码。
http_substatus additional.fields.sc_substatus.value.string_value 响应的 HTTP 子状态代码。
实例 additional.fields.instance.value.string_value 任务的实例 ID。
intermediary_devicename intermediary.hostname、intermediary.asset.hostname 中继设备的主机名。
json_message JSON 格式的原始日志消息。
kv_fields 用于从原始日志消息中提取键值对。
LayerKey security_result.about.resource.attribute.labels.LayerKey.value 图层的键。
LayerName security_result.about.resource.attribute.labels.LayerName.value 图层的名称。
LayerId security_result.about.resource.attribute.labels.LayerId.value 图层的 ID。
log.file.path target.file.full_path 日志文件的完整路径。
log.offset metadata.product_log_id 事件在日志文件中的偏移量。
logstash.collect.host observer.hostname 收集日志的机器的主机名。
logstash.process.host intermediary.hostname 处理日志的机器的主机名。
logstash_json_message JSON 格式的原始日志消息。
消息 security_result.description 原始日志消息。
部委 additional.fields.ministry.value.string_value 与活动相关的部门。
name 实体的名称。
NewValue additional.fields.NewValue.value.string_value 配置设置的新值。
OldValue additional.fields.OldValue.value.string_value 配置设置的旧值。
端口 principal.port 客户端的端口号。
priority_code syslog 消息的优先级代码。
ProcessID principal.process.pid 生成事件的进程的进程 ID。
ProviderGuid security_result.about.resource.attribute.labels.ProviderGuid.value 提供商的 GUID。
ProviderKey security_result.about.resource.attribute.labels.ProviderKey.value 提供方的键。
ProviderName security_result.about.resource.attribute.labels.ProviderName.value 提供商的名称。
referrer_url network.http.referral_url 将客户引导至当前网页的网址。
request_url target.url 客户端请求的网址。
s-computername target.hostname 目标机器的主机名。
s-ip target.ip、target.asset.ip 目标机器的 IP 地址。
s-port target.port 目标计算机的端口号。
s-sitename additional.fields.sitename.value.string_value 网站的名称。
sc-bytes network.sent_bytes 发送到客户端的字节数。
sc-status network.http.response_code 响应的 HTTP 状态代码。
sc-substatus additional.fields.sc_substatus.value.string_value 响应的 HTTP 子状态代码。
sc-win32-status 响应的 Windows 状态代码。
scbyte network.sent_bytes 发送到客户端的字节数。
scstatus network.http.response_code 响应的 HTTP 状态代码。
和程度上减少 security_result.severity 事件的严重程度。
service.type additional.fields.service_type.value.string_value 服务的类型。
sIP principal.ip、principal.asset.ip 客户端的 IP 地址。
sPort principal.port 客户端的端口号。
sSiteName additional.fields.sitename.value.string_value 网站的名称。
src_ip principal.ip、principal.asset.ip、observer.ip 客户端的 IP 地址。
src_port principal.port 客户端的端口号。
sysdate syslog 消息的日期和时间。
syslog_facility security_result.severity_details syslog 消息的设施。
syslog_pri syslog 消息的优先级。
syslog_severity security_result.severity_details syslog 消息的严重程度。
syslog_severity_code syslog 消息的严重性代码。
标记 security_result.rule_name 与事件关联的代码。
任务 additional.fields.task.value.string_value 任务的名称。
时间 用于在原始日志时间戳无效时构建事件时间戳。
time-taken 请求时长(以毫秒为单位)。
uri_query target.url 客户端请求的网址的查询字符串。
user_agent network.http.user_agent 客户端的用户代理。
用户名 target.user.userid 用户的用户名。
UserSid target.user.windows_sid 用户的 Windows SID。
权重 security_result.about.resource.attribute.labels.Weight.value 过滤器的权重。
win32_status 响应的 Windows 状态代码。
xforwardedfor X-Forwarded-For 标头,其中包含以英文逗号分隔的 IP 地址列表。
metadata.log_type IIS
network.direction INBOUND
metadata.vendor_name Microsoft
metadata.product_name Internet Information Server
metadata.event_type NETWORK_HTTPUSER_UNCATEGORIZEDGENERIC_EVENTSTATUS_UPDATEUSER_LOGOUTUSER_LOGIN
extensions.auth.type MACHINE

变化

2025-01-27

增强功能

  • 添加了对解析 XML 日志的支持。

2024-06-20

增强功能

  • streamid 映射到 additional.fields

2024-06-11

增强功能

  • 添加了 Grok 模式来解析未解析的日志。

2024-02-18

增强功能

  • 修改了 Grok 模式字段名称,以正确映射值。
  • 将名称从 intermediary_devicename 更改为 observer_devicename
  • 将名称从 src_ip 更改为 observer_ip
  • 将名称从 dst_ip 更改为 principal_or_intermediary_ip
  • 将名称从 xff_ips 更改为 principal_xff_ips
  • observer_ip 映射到 observer.ip
  • observer_devicename 映射到 observer.hostname
  • principal_xff_ips 映射到 principal.ip
  • 如果存在 principal_xff_ips,则将 principal_or_intermediary_ip 映射到 intermediary.ip
  • 如果 principal_xff_ips 不存在,则将 principal_or_intermediary_ip 映射到 principal.ip

2024-02-12

增强功能

  • 添加了新的 Grok 模式,以支持包含 kv 数据的网络日志。
  • sc-substatus 映射到 additional.fields

2024-01-09

增强功能

  • 添加了新的 Grok 模式,以支持包含键值对数据的网络日志。
  • dst_ip2 映射到 target.ip
  • X-BackEndCookieexchangecookieOutlookSessionMapiContextMapiRoutingcontent_typeMapiSequence 映射到 additional.fields

2023-12-19

增强功能

  • 如果 EventType 等于 VERBOSE,则将 Configuration 映射为 metadata.product_event_type 的值。
  • Message 映射到 security_result.description
  • PhysicalPath 映射到 target.file.full_path
  • OldValueNewValueConfigurationConfigPath 映射到 additional.fields

2023-12-06

增强功能

  • @timestamp 映射到 metadata.event_timestamp
  • host.hostname 映射到 target.hostname
  • logstash.process.host 映射到 intermediary.hostname
  • logstash.collect.host 映射到 observer.hostname
  • _user 映射到 principal.user.userid
  • http_response 映射到 network.http.response_code
  • referer 映射到 network.http.referral_url
  • syslog_severity 映射到 security_result.severity_details
  • message 映射到 security_result.description
  • request_url/login.aspxentityAutoLogout=1 时,将 metadata.event_type 设置为 USER_LOGOUT
  • request_url/login.aspx 时,请将 metadata.event_type 设置为 USER_LOGIN

2023-10-27

增强功能

  • Noun.hostnameNoun.asset.hostname 映射到相同的值。
  • cIP 映射到 target.ip
  • csUriStem 映射到 `target.url
  • sPort 映射到 principal.port
  • csUserAgent 映射到 http.user_agent
  • sIP 映射到 principal.ip
  • csMethod 映射到 network.http.method
  • scStatus 映射到 http.response_code
  • sComputerName 映射到 target.hostname
  • _resourceId 映射到 target.resource.id
  • scBytes 映射到 network.sent_bytes
  • csBytes 映射到 network.received_bytes
  • sSiteNameTenantIdEventProcessedUtcTimeManagementGroupNameEventEnqueuedUtcTime 映射到 additional.fields
  • TimeGenerated 映射到 about.resource.attribute.labels
  • SourceSystem 映射到 security_result.detection_fields

2023-06-23

bug 修复

  • 日志格式变更
  • 为更改的日志模式定义了 Grok
  • 将 cs-host 映射到 principal.application
  • 使用 if-else 将 uristem 和 cs-uri-stem 映射到 target.url
  • 将 cs-version 映射到 network.tls.version_protocol
  • 将严重程度的值替换为“级别”字段中的值
  • 将 sitename 的值替换为 s-sitename
  • 将 UserSid 的值替换为 UserID
  • 将 AgentDevice 映射为标签键和值
  • app_name 映射到 principal.application
  • ChannelID 映射到 security_result.about.resource.attribute
  • Level 映射到 security_result.severity
  • ExecutionProcessID 映射到 principal.process.pid
  • ExecutionThreadID 映射到 principal.process.product_specific_process_id
  • Domain 映射到 principal.user.userid
  • UserID 映射到 principal.user.windows_sid
  • AccountType 映射到 principal.user.role_name

2023-05-12

增强功能

  • 解析失败的 JSON 日志
  • cshost 映射到 principal.hostname
  • csusername 映射到 principal.user.user_display_name
  • sip 映射到 target.ip
  • uristem 映射到 target.url
  • sport 映射到 target.port
  • csversion 映射到 network.tls.version_protocol
  • csuseragent 映射到 network.http.user_agent
  • csip 映射到 principal.ip
  • xforwardedfor 映射到 principal.ip
  • csmethod 映射到 network.http.method
  • csreferer 映射到 network.http.referral_url
  • scstatus 映射到 network.http.response_code
  • computername 映射到 target.asset.hostname
  • scbyte 映射到 network.sent_bytes
  • csbyte 映射到 network.received_bytes
  • datetime 映射到 metadata.event_timestamp

2023-03-01

增强功能

  • 添加了对具有以下键的 JSON 格式日志的支持:c-*s-*cs-*sc-*

2022-10-25

增强功能

  • 从日志中提取了 uri_queryintermediary_device_nameprincipal_usernamesent_bytesreceived_bytes
  • 已将 dst_port 更改为 src_port
  • src_port 映射到 principal.port
  • target.url 映射更新为 request_url+?+uri_query
  • token_data 映射到 security_result.detection_fields 作为 Cookie
  • sent_bytes 映射到 network.sent_bytes
  • received_bytes 映射到 network.received_bytes
  • 如果 target_host 为空,则将 intermediary_devicename 映射到 target.hostname;否则将其映射到 intermediary.hostname
  • principal_username 映射到 principal.user.userid
  • 仅当 target_host 为空时,才会将 Devicename 映射到 target.hostname
  • 如果 xff_ips 为空,则将 src_ip 映射到 principal.ip
  • 如果 xff_ips 不为空:
  • src_ip 映射到 intermediary.ip
  • xff_ips 映射到 principal.ip
  • 为其他日志类型添加了 Grok 模式。

2022-10-01

增强功能

  • 编写了 Grok 来解析无法解析的 syslog。
  • Severity 映射到 security_result.severity
  • UserName 映射到 target.user.userid
  • UserSid 映射到 target.user.windows_sid
  • ProviderKey 映射到 security_result.about.resource.attribute.labels
  • LayerKey 映射到 security_result.about.resource.attribute.labels
  • LayerName 映射到 security_result.about.resource.attribute.labels
  • LayerId 映射到 security_result.about.resource.attribute.labels
  • Weight 映射到 security_result.about.resource.attribute.labels
  • Conditions 映射到 security_result.about.resource.attribute.labels
  • Action 映射到 security_result.about.resource.attribute.labels
  • CalloutKey 映射到 security_result.about.resource.attribute.labels
  • CalloutName 映射到 security_result.about.resource.attribute.labels
  • Channel 映射到 security_result.about.resource.attribute.labels
  • FilterId 映射到 security_result.about.resource.attribute.labels
  • FilterKey 映射到 security_result.about.resource.attribute.labels
  • FilterName 映射到 security_result.about.resource.attribute.labels
  • FilterType 映射到 security_result.about.resource.attribute.labels
  • ProviderGuid 映射到 security_result.about.resource.attribute.labels
  • ProviderName 映射到 security_result.about.resource.attribute.labels
  • SourceName 映射到 security_result.about.resource.attribute.labels
  • SyslogSeverity 映射到 security_result.about.resource.attribute.labels
  • Category 映射到 security_result.category_details
  • EventType 映射到 metadata.product_event_type
  • EventID 映射到 metadata.product_log_id
  • ProcessID 映射到 principal.process.pid
  • SourceModuleName 映射到 target.resource.name
  • SourceModuleType 映射到 observer.application

2022-09-30

增强功能

  • 将 xff 标头 IP 映射到 intermediary.ip。
  • 将主机名映射到 target.hostname。
  • 添加了额外的 Grok 模式,以正确解析包含额外信息的特定日志,并将这些额外信息映射到其他字段。
  • 将 ASP.NET_Session_id 映射到 network.session_id。

2022-03-30

增强功能

  • 解析其他字段。

需要更多帮助?向社区成员和 Google SecOps 专业人士寻求解答。