收集 Microsoft IIS 日志
支持的平台:
Google SecOps
SIEM
本文档介绍了如何使用 BindPlane 将 Microsoft Internet Information Services (IIS) 日志收集到 Google 安全运营团队。解析器首先会尝试通过移除不必要的字符和标准化字段名称来清理和标准化输入数据。然后,它使用一系列 grok
模式从各种 Microsoft IIS 日志格式中提取相关字段,并将其映射到统一数据模型 (UDM)。
准备工作
- 确保您拥有 Google SecOps 实例。
- 确保您使用的是 Windows 2016 或更高版本。
- 如果在代理后面运行,请确保防火墙端口处于打开状态。
获取 Google SecOps 提取身份验证文件
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 收集代理。
- 下载提取身份验证文件。将该文件安全地保存在将安装 BindPlane 的系统上。
获取 Google SecOps 客户 ID
- 登录 Google SecOps 控制台。
- 依次选择 SIEM 设置 > 配置文件。
- 复制并保存组织详细信息部分中的客户 ID。
在 Windows 上安装 Bindplane 代理
- 以管理员身份打开命令提示符或 PowerShell。
运行以下命令:
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
其他安装资源
- 如需了解其他安装选项,请参阅此安装指南。
配置 Bindplane 代理以注入 Syslog 并将其发送到 Google SecOps
- 在配置 YAML 文件之前,请在“服务”面板中停止
observIQ Distro for Open Telemetry Collector
服务。 访问配置文件:
- 找到
config.yaml
文件。通常,在 Linux 上,该目录位于/etc/bindplane-agent/
目录中;在 Windows 上,该目录位于安装目录中。 - 使用文本编辑器(例如
nano
、vi
或记事本)打开该文件。
- 找到
按如下方式修改
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]
将
<customer_id>
替换为实际的客户 ID。在获取 Google SecOps 提取身份验证文件部分中,将
/path/to/ingestion-authentication-file.json
更新为身份验证文件的保存路径。保存
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_HTTP 、USER_UNCATEGORIZED 、GENERIC_EVENT 、STATUS_UPDATE 、USER_LOGOUT 、USER_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-BackEndCookie
、exchangecookie
、OutlookSession
、MapiContext
、MapiRouting
、content_type
和MapiSequence
映射到additional.fields
。
2023-12-19
增强功能:
- 如果
EventType
等于VERBOSE
,则将Configuration
映射为metadata.product_event_type
的值。 - 将
Message
映射到security_result.description
。 - 将
PhysicalPath
映射到target.file.full_path
。 - 将
OldValue
、NewValue
、Configuration
和ConfigPath
映射到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.aspx
且entity
为AutoLogout=1
时,将metadata.event_type
设置为USER_LOGOUT
。 - 当
request_url
为/login.aspx
时,请将metadata.event_type
设置为USER_LOGIN
。
2023-10-27
增强功能:
- 将
Noun.hostname
和Noun.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
。 - 将
sSiteName
、TenantId
、EventProcessedUtcTime
、ManagementGroupName
和EventEnqueuedUtcTime
映射到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
。 - 将
date
和time
映射到metadata.event_timestamp
。
2023-03-01
增强功能:
- 添加了对具有以下键的 JSON 格式日志的支持:
c-*
、s-*
、cs-*
、sc-*
。
2022-10-25
增强功能:
- 从日志中提取了
uri_query
、intermediary_device_name
、principal_username
、sent_bytes
、received_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 专业人士寻求解答。