收集 Microsoft IIS 日志

支持的语言:

本文档介绍了如何使用 Bindplane 将 Microsoft Internet Information Services (IIS) 日志收集到 Google Security Operations。解析器首先会尝试通过移除不必要的字符和标准化字段名称来清理和规范化输入数据。然后,它使用一系列 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. /path/to/ingestion-authentication-file.json 更新为获取 Google SecOps 提取身份验证文件部分中保存身份验证文件的路径。

  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 中间设备的 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 任务的名称。
时间 如果原始日志时间戳无效,则用于构建事件时间戳。
所用时间 请求的时长(以毫秒为单位)。
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

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