收集 AWS S3 服务器访问日志

解析器版本:4.0

支持的平台:

本文档介绍了如何通过设置 Google Security Operations Feed 来收集 AWS S3 服务器访问日志。解析器使用 Grok 模式提取字段,处理潜在的 JSON 输入,并将提取的字段映射到 UDM。它会根据特定字段的存在情况和值执行数据转换、类型转换和条件逻辑,以确保准确的 UDM 表示。

准备工作

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

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

如何配置 AWS S3 服务器访问日志记录

Google SecOps 支持通过 Amazon SQS 使用 Amazon S3 收集日志。

  1. 登录 AWS 管理控制台。
  2. 访问 Amazon S3 控制台。
  3. 依次前往 Amazon S3 > 存储分区
  4. 选择现有存储桶或创建新存储桶。
  5. 点击属性
  6. 服务器访问日志记录部分,点击修改
  7. 选择启用
  8. 目标存储桶字段中,输入新存储桶的名称,以将日志记录对象发送到该存储桶,或选择现有存储桶作为目标存储桶。
  1. 点击保存更改
  2. 如需为 S3 存储桶创建 SQS 队列,请配置具有 S3 存储空间的 Amazon SQS 实例。 如需了解详情,请参阅为通知配置存储桶(SNS 主题或 SQS 队列)

根据服务和区域,参考以下 AWS 文档确定连接端点:

设置 Feed

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

  • SIEM 设置 > Feed > 添加新 Feed
  • 内容中心 > 内容包 > 开始

如何设置 AWS S3 服务访问权限 Feed

  1. 点击 Amazon Cloud Platform 包。
  2. 找到 AWS S3 服务访问日志类型。
  3. Google SecOps 支持使用访问密钥 ID 和密钥方法收集日志。如需创建访问密钥 ID 和密钥,请参阅使用 AWS 配置工具身份验证
  4. 在以下字段中指定值。

    • 来源类型:Amazon SQS V2
    • 队列名称:要从中读取数据的 SQS 队列名称
    • S3 URI:存储桶 URI。
      • s3://your-log-bucket-name/
        • your-log-bucket-name 替换为您的 S3 存储桶的实际名称。
    • 源删除选项:根据您的提取偏好设置选择删除选项。

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

    • SQS 队列访问密钥 ID:一个包含 20 个字符的字母数字字符串形式的账号访问密钥。

    • SQS 队列私有访问密钥:一个包含 40 个字符的字母数字字符串形式的账号访问密钥。

    高级选项

    • Feed 名称:用于标识 Feed 的预填充值。
    • 资源命名空间:与 Feed 关联的命名空间。
    • 提取标签:应用于相应 Feed 中所有事件的标签。
  5. 点击创建 Feed

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

UDM 映射表

日志字段 UDM 映射 逻辑
aclRequired target.resource.attribute.labels.key: "aclRequired"
target.resource.attribute.labels.value: aclRequired 的值
直接从原始日志字段 aclRequired 映射。
authenticationtype extensions.auth.auth_details 直接从原始日志字段 authenticationtype 映射。
bucket target.resource.name 直接从原始日志字段 bucket 映射。
bucket target.resource.resource_type:“STORAGE_BUCKET” 如果存在 bucket 字段,解析器会将 resource_type 设置为“STORAGE_BUCKET”。
bucketowner target.resource.product_object_id 直接从原始日志字段 bucketowner 映射。
bytes_sent network.sent_bytes 直接从原始日志字段 bytes_sent 映射,先将其转换为无符号整数,然后将“-”替换为“0”。
ciphersuite network.application_protocol:“HTTPS” 如果存在 ciphersuite 字段,解析器会将 application_protocol 设置为“HTTPS”。
ciphersuite network.tls.cipher 直接从原始日志字段 ciphersuite 映射。
errorcode security_result.action_details 直接从原始日志字段 errorcode 映射。
errorcode security_result.action:“BLOCK” 如果 errorcode 字段包含“AccessDenied”(不区分大小写),解析器会将 action 设置为“BLOCK”。
hostheader target.hostname 从原始日志字段 hostheader 中提取,可能会移除端口号。
hostheader target.port 如果存在端口号,则从原始日志字段 hostheader 中提取。
hostid target.resource.attribute.labels.key:“S3 扩展请求 ID”
target.resource.attribute.labels.valuehostid 的值
直接从原始日志字段 hostid 映射。
http_capture network.http.method HTTP 方法是从 http_capture 字段中提取的。
http_capture network.http.version HTTP 版本是从 http_capture 字段中提取的。
http_capture target.url 目标网址使用 hostheaderhttp_request_uri(从 http_capture 中提取)构建,并根据 ciphersuite 的存在情况添加“http://”或“https://”前缀。
httpstatus network.http.response_code 直接从原始日志字段 httpstatus 映射,并将其转换为整数。
object_version_id target.resource.product_object_id 直接从原始日志字段 object_version_id 映射。
objectsize target.file.size 直接从原始日志字段 objectsize 映射,先将其转换为无符号整数,然后将“-”替换为“0”。
operation metadata.product_event_type 直接从原始日志字段 operation 映射。
referrer network.http.referral_url 直接从原始日志字段 referrer(移除引号后)映射。
remoteip metadata.event_type:“USER_RESOURCE_ACCESS” 如果 remoteip 字段为空,解析器会将 event_type 设置为“USER_RESOURCE_ACCESS”。
remoteip principal.ip 直接从原始日志字段 remoteip 映射。
requester target.resource.attribute.labels.key: "访问点 ARN"
target.resource.attribute.labels.value: requester 的值
直接从原始日志字段 requester 映射。
requester_user principal.user.userid 直接从原始日志字段 requester_user 映射。
requestid network.session_id 直接从原始日志字段 requestid 映射。
request_time_ms network.session_duration.nanos 直接从原始日志字段 request_time_ms 映射,先将其转换为整数,将“-”替换为“0”,然后用零填充以表示纳秒。
signatureversion target.resource.attribute.labels.key:“签名版本”
target.resource.attribute.labels.valuesignatureversion 的值
直接从原始日志字段 signatureversion 映射。
time metadata.event_timestamp 从原始日志字段 time 解析并转换为时间戳。
tlsVersion network.tls.version 直接从原始日志字段 tlsVersion 映射。
useragent network.http.user_agent 直接从原始日志字段 useragent(移除引号后)映射。
(解析器逻辑) metadata.event_type:“NETWORK_HTTP” 解析器将默认 event_type 设置为“NETWORK_HTTP”。
(解析器逻辑) metadata.log_type:“AWS_S3_SERVER_ACCESS” 解析器将 log_type 设置为“AWS_S3_SERVER_ACCESS”。
(解析器逻辑) metadata.product_name:“AWS S3 Server Access” 解析器将 product_name 设置为“AWS S3 Server Access”。
(解析器逻辑) metadata.product_version:“HTTP/http_version 解析器使用提取的 http_version 设置 product_version
(解析器逻辑) metadata.vendor_name:“AMAZON” 解析器将 vendor_name 设置为“AMAZON”。
(解析器逻辑) network.application_protocol:“HTTP” 如果不存在 ciphersuite 字段,解析器会将 application_protocol 设置为“HTTP”。
(解析器逻辑) timestamp 解析器会在处理事件时将事件 timestamp 设置为当前时间。

更新日志

查看相应解析器的更改日志

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