收集 AWS Elastic Load Balancer 日志

解析器版本:22.0

支持范围:

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

准备工作

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

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

配置 AWS Elastic Load Balancer

  • 启用访问日志记录,以便将访问日志发送到 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. 点击下载 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:

  • 设置 > 数据管理 > Feed > 添加新 Feed(在仅限 SIEM 的平台上,依次点击设置 > Feed > 添加新 Feed)
  • 内容中心 > 内容包 > 开始使用

如何设置 AWS Elastic Load Balancer Feed

  1. 点击 Amazon Cloud Platform 软件包。
  2. 找到 AWS Elastic Load Balancer 日志类型。
  3. 在以下字段中指定值。

    1. 在以下字段中指定值。
    2. 来源类型:Amazon SQS V2
    3. 队列名称:要从中读取数据的 SQS 队列名称
    4. S3 URI:存储桶 URI。
      • s3://your-log-bucket-name/
        • 将 your-log-bucket-name 替换为 S3 存储桶的实际名称。
    5. 来源删除选项:根据您的提取偏好设置选择删除选项。

    6. 文件存在时间上限:包含过去指定天数内修改过的文件。默认值为 180 天。

    7. SQS 队列访问密钥 ID:账号访问密钥,由 20 个字母数字字符组成。

    8. SQS 队列私有访问密钥:一个包含 40 个字符的字母数字字符串,用作账号访问密钥。

    高级选项

    • Feed 名称:用于标识 Feed 的预填充值。
    • 资产命名空间:与 Feed 关联的命名空间。
    • 注入标签:应用于此 Feed 中所有事件的标签。
  4. 点击创建 Feed。

如需详细了解如何为此产品系列中的不同日志类型配置多个 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 专业人士的解答。