收集 AWS Elastic Load Balancing 日志

支持的语言:

本文档介绍了如何通过设置 Google Security Operations Feed 来收集 AWS Elastic Load Balancing 日志。解析器会将日志转换为 UDM 格式。它使用 grok 模式从 CEF 和非 CEF 格式的消息中提取字段,将这些字段映射到 UDM 字段,并处理各种数据转换,包括针对 HTTP、TLS 和安全相关字段的特定逻辑。它还会根据某些字段的存在情况或格式执行条件处理,以确保准确表示 UDM。

准备工作 {: #before-you-begin }

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

  • Google SecOps 实例
  • 对 AWS 的特权访问权限

配置 AWS Elastic Load Balancing

  • 启用访问日志记录,以将访问日志发送到 S3 存储桶
  • 创建 Amazon Simple Queue Service (SQS) 并将其附加到 S3 存储桶。

配置 Amazon S3 存储桶

  1. 登录 AWS 控制台。
  2. 按照以下用户指南创建 Amazon S3 存储桶创建存储桶
  3. 保存存储桶名称(例如 elb-logs)和区域以供日后使用。
  4. 按照以下用户指南创建用户:创建 IAM 用户
  5. 选择创建的用户
  6. 选择安全凭据标签页。
  7. 访问密钥部分中,点击创建访问密钥
  8. 选择第三方服务作为使用情形
  9. 点击下一步
  10. 可选:添加说明标记。
  11. 点击创建访问密钥
  12. 点击 Download CSV file(下载 CSV 文件),保存访问密钥不公开的访问密钥以供日后使用。
  13. 点击完成
  14. 选择权限标签页。
  15. 权限政策部分中,点击添加权限
  16. 选择添加权限
  17. 选择直接附加政策
  18. 搜索并选择 AmazonS3FullAccess 政策。
  19. 点击下一步
  20. 点击添加权限

如何配置 AWS Elastic Load Balancer 以启用访问日志

  1. 登录 AWS 管理控制台。
  2. 搜索并选择 EC2
  3. 在导航菜单中选择负载平衡器
  4. 选择要为其启用日志记录的负载均衡器
  5. 说明标签页中,滚动到属性
  6. 点击修改属性
  7. 选择启用,以启用访问日志。
  8. 选择之前创建的 S3 存储桶(例如 elb-logs)。
  9. 可选:设置日志前缀,以便更轻松地识别日志(例如 elb/access-logs/)。
  10. 点击保存

设置 Feed

您可以通过两种不同的入口点在 Google SecOps 平台中设置 Feed:

  • SIEM 设置 > Feed
  • 内容中心 > 内容包

通过“SIEM 设置”>“Feed”设置 Feed

如需为相应产品系列中的不同日志类型配置多个 Feed,请参阅按产品配置 Feed

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

  1. 依次前往 SIEM 设置> Feed
  2. 点击添加新 Feed
  3. 在下一页上,点击配置单个 Feed
  4. Feed 名称字段中,输入 Feed 的名称(例如 AWS Elastic Load Balancer Logs)。
  5. 选择 Amazon S3 作为来源类型
  6. 选择 AWS Elastic Load Balancer 作为日志类型
  7. 点击下一步
  8. 为以下输入参数指定值:

    • 区域:Amazon S3 存储桶所在的区域。
    • S3 URI:存储桶 URI。
      • s3:/BUCKET_NAME
        • BUCKET_NAME 替换为您的 S3 存储桶的实际名称。
    • URI is a:根据日志流配置选择 URI 类型(Single file | Directory | Directory which includes subdirectories)。
    • 源删除选项:根据您的提取偏好设置选择删除选项。
    • 访问密钥 ID:有权从 S3 存储桶读取数据的用户的访问密钥。

    • 私有访问密钥:具有从 S3 存储桶读取权限的用户的私有密钥。

    • 资源命名空间资源命名空间

    • 注入标签:要应用于此 Feed 中事件的标签。

  9. 点击下一步

  10. 最终确定界面中查看新的 Feed 配置,然后点击提交

设置来自内容中心的 Feed

为以下字段指定值:

  • 区域:Amazon S3 存储桶所在的区域。
  • S3 URI:存储桶 URI。
    • s3:/BUCKET_NAME
      • BUCKET_NAME 替换为您的 S3 存储桶的实际名称。
  • URI is a:根据日志流配置选择 URI 类型(Single file | Directory | Directory which includes subdirectories)。
  • 源删除选项:根据您的提取偏好设置选择删除选项。
  • 访问密钥 ID:有权从 S3 存储桶读取数据的用户的访问密钥。

  • 私有访问密钥:具有从 S3 存储桶读取权限的用户的私有密钥。

高级选项

  • Feed 名称:用于标识 Feed 的预填充值。
  • 来源类型:用于将日志收集到 Google SecOps 中的方法。
  • 资产命名空间与 Feed 关联的命名空间
  • 提取标签:应用于相应 Feed 中所有事件的标签。

UDM 映射表

日志字段 UDM 映射 逻辑
actions_executed security_result.action 如果 actions_executed 为“waf,forward”或“waf,redirect”,则设置为“ALLOW”。如果 actions_executed 为“waf”,则设置为“BLOCK”。
chosen_cert_arn principal.user.attribute.labels 如果 chosen_cert_arn 包含“session”,请将其值映射到 security_result.description。否则,请创建一个键为“ARN”、值为 chosen_cert_arn 的标签,并将其添加到 principal.user.attribute.labels 数组中。
chosen_cert_arn security_result.description 如果 chosen_cert_arn 包含“session”,则将其值映射到此字段。
client_ip principal.asset.ip 直接映射。
client_ip principal.ip 直接映射。
client_port principal.port 直接映射。
classification security_result.rule_name 如果不为空或“-”,则直接映射。
classification_reason security_result.summary 如果不为空或“-”,则直接映射。
Customer (CEF) principal.user.user_display_name 直接从 CEF 字段映射。
data 多项 使用 Grok 模式进行解析,以提取多个字段。如需了解具体映射,请参阅其他行。
data.act (CEF) security_result.action_details 直接从 CEF 字段映射。
data.app (CEF) principal.application 直接从 CEF 字段映射。
data.ccode (CEF) principal.location.country 直接从 CEF 字段映射。
data.cicode (CEF) principal.location.city 直接从 CEF 字段映射。
data.cn1 (CEF) network.http.response_code 直接从 CEF 字段映射。
data.cpt (CEF) principal.port 直接从 CEF 字段映射。
data.cs1Label (CEF) additional.fields 创建键为“Cap Support”、值为 cs1Label 的键值对。
data.cs2Label (CEF) additional.fields 创建键为“Javascript Support”、值为 cs2Label 的键值对。
data.cs3Label (CEF) additional.fields 创建键为“CO Support”、值为 cs3Label 的键值对。
data.cs4Label (CEF) additional.fields 创建键为“VID”、值为 cs4Label 的键值对。
data.cs5Label (CEF) additional.fields 创建键为“clappsig”且值来自 cs5Label 的键值对。
data.cs6Label (CEF) additional.fields 创建键为“clapp”、值为 cs6Label 的键值对。
data.cs7Label (CEF) additional.fields 创建键为“latitude”、值为 cs7Label 的键值对。
data.deviceExternalId (CEF) about.asset.asset_id 用作素材资源 ID 的一部分:Incapsula.SIEMintegration:deviceExternalId
data.deviceFacility (CEF) principal.location.region 直接从 CEF 字段映射。
data.dproc (CEF) target.process.command_line 直接从 CEF 字段映射。
data.dst_ip target.asset.ip 直接映射。
data.dst_ip target.ip 直接映射。
data.dst_port target.port 直接映射。
data.elb target.resource.id 直接映射。
data.fileId (CEF) security_result.detection_fields 创建键为“fileId”、值为 fileId 的键值对。
data.in (CEF) network.received_bytes 直接从 CEF 字段映射。
data.request (CEF) target.url 直接从 CEF 字段映射。
data.requestClientApplication (CEF) network.http.user_agent 直接从 CEF 字段映射。
data.requestMethod (CEF) network.http.method 直接从 CEF 字段映射。
data.severity (CEF) security_result.severity 如果严重程度为 0,则映射到 LOW。
data.sip (CEF) principal.asset.ip 直接从 CEF 字段映射。
data.sip (CEF) principal.ip 直接从 CEF 字段映射。
data.siteid (CEF) security_result.detection_fields 创建键为“siteid”、值为 siteid 的键值对。
data.sourceServiceName (CEF) principal.application 直接从 CEF 字段映射。
data.spt (CEF) principal.port 直接从 CEF 字段映射。
data.src (CEF) principal.ip 直接从 CEF 字段映射。
data.suid (CEF) principal.user.userid 直接从 CEF 字段映射。
data.ver (CEF) network.tls.version 版本部分使用 grok 提取并映射。
data.ver (CEF) network.tls.cipher 使用 grok 提取并映射密码部分。
data.xff (CEF) principal.ip 直接从 CEF 字段映射。
domain_name principal.administrative_domain 直接映射。
http_method network.http.method 直接映射。
log_type metadata.log_type 直接映射。
message 多项 使用 Grok 模式进行解析,以提取多个字段。如需了解具体映射,请参阅其他行。
received_bytes network.received_bytes 直接映射。
redirect_url network.application_protocol 如果 redirect_url 以“http”开头,则提取并映射协议。
redirect_url target.asset.hostname 如果 redirect_url 以“http”开头,则提取主机名并进行映射。
redirect_url target.hostname 如果 redirect_url 以“http”开头,则提取主机名并进行映射。
redirect_url target.port 如果 redirect_url 以“http”开头,则提取并映射端口。
request_creation_time metadata.collected_timestamp 在解析日期后直接映射。
request_processing_time security_result.detection_fields 创建键为“request_processing_time”、值为相应字段的键值对。
response_processing_time security_result.detection_fields 使用键“response_processing_time”和此字段中的值创建键值对。
sent_bytes network.sent_bytes 直接映射。
ssl_cipher network.tls.cipher 直接映射。
ssl_protocol network.tls.version 直接映射。
target_group_arn target.group.group_display_name 直接映射。
target_processing_time security_result.detection_fields 使用键“target_processing_time”和此字段中的值创建键值对。
target_status_code target.labels 创建一个键为“target_status_code”、值为相应字段的标签,并将其添加到 target.labels 数组中。
time metadata.event_timestamp 在解析日期后直接映射。
trace_id metadata.product_log_id 移除“Root=”后直接映射。
url network.http.referral_url 直接映射。
user_agent network.http.user_agent 直接映射。
(解析器) metadata.event_type 如果存在正文和目标机器 ID,则设置为“NETWORK_HTTP”;如果仅存在正文机器 ID,则设置为“STATUS_UPDATE”;如果不存在目标 IP、主机名或目标 IP,则设置为“GENERIC_EVENT”;否则设置为“NETWORK_HTTP”。
(解析器) metadata.product_name 设置为“AWS Elastic Load Balancer”。
(解析器) metadata.vendor_name 设置为“AMAZON”。

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