收集 Auth0 日志

解析器版本:16.0

支持的国家/地区:

此解析器会从 JSON 格式的消息中提取 Auth0 日志事件。它会初始化 UDM 字段、解析 JSON 载荷、将相关字段映射到 UDM 架构,并根据 type 字段对事件进行分类,从而设置适当的安全操作和事件类型。

准备工作

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

  • Google SecOps 实例。
  • 具有必要权限的 Auth0 账号。

设置 Feed

如需配置 Feed,请按以下步骤操作:

  1. 依次前往设置 > 数据管理 > Feed。如果您使用的是仅 SIEM 平台,请依次前往设置 > Feed。
  2. 点击添加新新闻信息流。
  3. 在下一页上,点击配置单个 Feed。
  4. 在 Feed 名称字段中,输入 Feed 的名称(例如 Auth0 Logs)。
  5. 选择 Webhook 作为来源类型。
  6. 选择 AUTH_ZERO 作为日志类型。
  7. 点击下一步。
  8. 可选:为以下输入参数指定值:
    • 拆分定界符:用于分隔日志行的定界符,例如 \n。
    • 资产命名空间:资产命名空间。
    • 注入标签:应用于此 Feed 中事件的标签。
  9. 点击下一步。
  10. 在最终确定界面中查看 Feed 配置,然后点击提交。
  11. 点击生成密钥,生成用于对此 Feed 进行身份验证的密钥。
  12. 复制并存储密钥。您无法再次查看此密钥。如有需要,您可以重新生成新的密钥,但此操作会使之前的密钥失效。
  13. 在详细信息标签页中,从端点信息字段复制 Feed 端点网址。您需要在客户端应用中指定此端点网址。
  14. 点击完成。

为 webhook Feed 创建 API 密钥

  1. 依次前往 Google Cloud 控制台 > 凭证。

    转到“凭据”页面

  2. 点击创建凭据,然后选择 API 密钥。

  3. 将 API 密钥访问权限限制为 Chronicle API。

指定端点网址

  1. 在客户端应用中,指定 Webhook Feed 中提供的 HTTPS 端点网址。
  2. 通过在自定义标头中以以下格式指定 API 密钥和密钥,启用身份验证:

    X-goog-api-key = API_KEY
    X-Webhook-Access-Key = SECRET
    

    建议:将 API 密钥指定为标头,而不是在网址中指定。如果您的 webhook 客户端不支持自定义标头,您可以使用以下格式的查询参数指定 API 密钥和密钥:

    ENDPOINT_URL?key=API_KEY&secret=SECRET
    

替换以下内容:

  • ENDPOINT_URL:Feed 端点网址。
  • API_KEY:用于向 Google Security Operations 进行身份验证的 API 密钥。
  • SECRET:您为验证 Feed 而生成的密钥。

为 Google SecOps 配置 Auth0 网络钩子

  1. 访问 Auth0 信息中心。
  2. 前往监控 > 直播。
  3. 点击创建日志流。
  4. 点击自定义 Webhook 按钮,然后为其指定一个名称。例如:Google SecOps Webhook。
  5. 配置以下内容:
    • 载荷网址:输入 Google SecOps API 端点网址。
    • Content-Type:将 Content-Type 标头设置为 application/json。这会告知 Google SecOps 所发送数据的格式。
    • 可选:授权令牌:配置密钥以提高安全性。此密钥将用于验证网络钩子请求的真实性。

自定义载荷:您可以通过修改事件类别来自定义发送到 Google SecOps 的载荷。这样,您就可以从 Auth0 事件中选择特定数据点,并根据 Google SecOps 的需要设置其格式。如需详细了解可用的上下文变量和脚本选项,请参阅 Auth0 文档。确保最终载荷符合预期的 Google SecOps UDM 格式。

  1. 点击保存以创建 webhook。
  2. 触发与钩子关联的事件(例如,注册新用户、登录)。
  3. 在 Google SecOps 控制台中检查 Feed,验证日志是否已发送到 Google SecOps。

UDM 映射表

日志字段 UDM 映射 逻辑
client_id principal.asset.product_object_id 直接从 client_id 字段映射。
client_name principal.hostname 直接从 client_name 字段映射。
connection security_result.description 直接从 connection 字段映射。
connection_id security_result.rule_id 直接从 connection_id 字段映射。
date metadata.event_timestamp 使用 ISO8601 格式从 date 字段解析。
description metadata.description 直接从 description 字段映射。
details.error security_result.detection_fields 从 details.error 字段映射。键为“Error”。
details.error.oauthError security_result.detection_fields 从 details.error.oauthError 字段映射。键为“oauthError”。
details.error.type security_result.detection_fields 从 details.error.type 字段映射。键为“oauth_error_type”。
details.ipOnAllowlist security_result.detection_fields 从 details.ipOnAllowlist 字段映射。键为“ipOnAllowlist”。
details.link target.url 直接从 details.link 字段(如果存在)映射,否则从其他字段派生(见下文)。
details.request.auth.strategy security_result.detection_fields 从 details.request.auth.strategy 字段映射。键为“strategy”。
details.request.body.app_metadata.blockedReason security_result.detection_fields 从 details.request.body.app_metadata.blockedReason 字段映射。键为“blockedReason”。
details.request.body.app_metadata.customer_id target.user.product_object_id 直接从 details.request.body.app_metadata.customer_id 字段映射。
details.request.body.app_metadata.migrated security_result.detection_fields 从 details.request.body.app_metadata.migrated 字段映射。密钥“已迁移”。
details.request.channel security_result.detection_fields 从 details.request.channel 字段映射。键为“channel”。
details.request.method network.http.method 在转换为大写后直接从 details.request.method 字段映射。
details.request.path target.url 如果 details.link 不存在,则直接从 details.request.path 字段映射,否则从其他字段派生(见下文)。
details.response.body.email target.user.email_addresses 直接从 details.response.body.email 字段映射。
details.response.body.email_verified security_result.detection_fields 从 details.response.body.email_verified 字段映射。键为“email_verified”。
details.response.body.nickname target.user.user_display_name 直接从 details.response.body.nickname 字段映射。
details.response.body.user_id target.user.userid 直接从 details.response.body.user_id 字段映射。
details.response.statusCode network.http.response_code 在转换为整数后,直接从 details.response.statusCode 字段映射。
details.return_to target.url 如果 details.link 和 details.request.path 不存在,则直接从 details.return_to 字段映射,否则从其他字段派生(见下文)。
details.session_id network.session_id 直接从 details.session_id 字段映射。
details.stats.loginsCount additional.fields 从 details.stats.loginsCount 字段映射。键为“loginsCount”。
details.requiresVerification security_result.detection_fields 从 details.requiresVerification 字段映射。键为“requiresVerification”。
details.to target.user.email_addresses 直接从 details.to 字段映射。
hostname target.hostname 直接从 hostname 字段映射。
ip principal.ip 直接从 ip 字段映射。
js_data.audience target.url 如果 details.link、details.request.path 和 details.return_to 不存在,则直接从 js_data.audience 字段映射。
js_data.details.body.email_verified security_result.detection_fields 从 js_data.details.body.email_verified 字段映射。键为“email_verified”。
js_data.details.body.is_signup security_result.detection_fields 从 js_data.details.body.is_signup 字段映射。键为“is_signup”。
js_data.details.body.transaction.redirect_uri target.url 如果 details.link、details.request.path、details.return_to 和 js_data.audience 不存在,则直接从 js_data.details.body.transaction.redirect_uri 字段映射。
js_data.scope security_result.detection_fields 从 js_data.scope 字段映射。键为“scope”。
js_data.tracking_id security_result.detection_fields 从 js_data.tracking_id 字段映射。键为“tracking_id”。
log_id metadata.product_log_id 直接从 log_id 字段映射。
metadata.log_type metadata.log_type 直接从 log_type 字段映射。
metadata.product_name metadata.product_name 设置为“AUTH_ZERO”。
metadata.vendor_name metadata.vendor_name 设置为“AUTH_ZERO”。
metadata.product_event_type metadata.product_event_type 直接从 type 字段映射。
network.http.parsed_user_agent network.http.parsed_user_agent 从 user_agent 字段解析。
network.http.user_agent network.http.user_agent 直接从 user_agent 字段映射。
security_result.action security_result.action 由 type 字段(ALLOW 或 BLOCK)决定。如需了解具体映射,请参阅解析器代码。
strategy security_result.detection_fields 从 strategy 字段映射。键为“strategy”。
strategy_type security_result.detection_fields 从 strategy_type 字段映射。键为“strategy_type”。
target.user.email_addresses target.user.email_addresses 如果 user_name 字段是邮箱,则直接从该字段映射;否则,从其他字段派生(见上文)。
target.user.userid target.user.userid 直接从 user_id 字段映射,如果 user_id 不存在,则从 details.response.body.user_id 或 user_name 映射。
user_agent network.http.user_agent 直接从 user_agent 字段映射。
user_id target.user.userid 直接从 user_id 字段映射。
user_name target.user.email_addresses 直接从 user_name 字段映射。如果 security_result.action 为“ALLOW”且 type 为“slo”“sapi”“s”“ss”或“ssa”,则设置为“MACHINE”。如果 extensions.auth.type 为“MACHINE”且 type 为“slo”,则设置为“OTP”。由 type、client_name、ip、hostname 和 has_user 等字段组合确定。如需了解具体映射,请参阅解析器代码。

更新日志

查看此解析器的更新日志

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