收集 Carbon Black EDR 日志

支持的语言:

本文档介绍了如何使用 AWS S3 从云端和本地环境中收集 Carbon Black EDR 日志。解析器从 JSON、CSV 或 syslog 格式的消息中提取字段,对其进行标准化处理,然后将其映射到 UDM。它可处理各种 Carbon Black 事件类型,包括网络连接、进程事件、文件修改、注册表更改和 IOC 命中,并在可用时通过威胁情报和设备信息来丰富数据。

准备工作

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

  • Google SecOps 实例。
  • 对 AWS IAM 和 S3 的特权访问权限。
  • 对云端或本地 Carbon Black EDR 的特权访问权限。

配置本地 Carbon Black EDR

为本地环境配置 Amazon S3 存储桶

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

在本地 EDR 服务器上安装 cb-event-forwarder

  1. 安装 CbOpenSource 代码库(如果尚未安装):

    cd /etc/yum.repos.d
    curl -O https://opensource.carbonblack.com/release/x86_64/CbOpenSource.repo
    
  2. 使用 YUM 安装 RPM

    yum install cb-event-forwarder
    
  3. 如果您使用的是 EDR 7.1.0 或更高版本,请运行以下脚本来设置 EDR 所需的相应权限

    /usr/share/cb/integrations/event-forwarder/cb-edr-fix-permissions.sh
    

配置 cb-event-forwarder 以输出 JSON 日志

  1. 打开配置文件:

    sudo nano /etc/cb/integrations/event-forwarder/cb-event-forwarder.conf
    
  2. 修改以下参数:

    [event_forwarder]
    output_format=json   # Enable JSON format
    output_type=s3       # Send logs to AWS S3
    s3_bucket_name=YOUR-S3-BUCKET-NAME
    s3_region=YOUR-S3-BUCKET-NAME
    s3_access_key_id=YOUR_AWS_ACCESS_KEY
    s3_secret_access_key=YOUR_AWS_SECRET_KEY
    s3_prefix=carbonblack/edr/logs
    
  3. 使用键盘保存并退出:

    • 按 Ctrl + X,然后按 Y 和 Enter 键。
  4. 启动 cb-event-forwarder:

    sudo systemctl enable cb-event-forwarder
    sudo systemctl restart cb-event-forwarder
    sudo systemctl status cb-event-forwarder
    

为 S3 配置 Carbon Black Cloud Event Forwarder

创建 AWS S3 存储分区

  1. 登录 AWS 管理控制台。
  2. 确保 AWS 区域与事件转发器的区域一致:
    1. AWS 控制台页面中,找到相应区域。
    2. 使用下拉菜单选择事件转发器的正确区域。
    3. 下表列出了每个 Carbon Black EDR 网址适用的 AWS 区域。
      • “instance-alias”.my.carbonblack.io - 区域:美国东部(北弗吉尼亚)弗吉尼亚) (us-east-1)
      • “instance-alias”.my.cbcloud.de - 区域:欧洲(法兰克福)(eu-central-1)
      • “instance-alias”.my.cbcloud.sg 区域:亚太地区(新加坡)(ap-southeast-1)
  3. 选择服务
  4. 前往 S3 控制台。
  5. 点击创建存储桶,打开创建存储桶向导。
    1. 存储桶名称中,为存储桶输入一个唯一的名称(例如 CB-EDR)。
    2. 确保区域默认设置为您之前选择的区域。
    3. 更新阻止公开访问默认设置,以允许公开访问(这是将日志提取到 Google SecOps 中所必需的)。
    4. 选择创建存储分区

配置 S3 存储分区以允许事件转发器写入事件

  1. 按照以下用户指南创建用户创建 IAM 用户
  2. 选择创建的用户
  3. 选择安全凭据标签页。
  4. 访问密钥部分中,点击创建访问密钥
  5. 选择第三方服务作为使用情形
  6. 点击下一步
  7. 可选:添加说明标记。
  8. 点击创建访问密钥
  9. 点击 Download CSV file(下载 CSV 文件),保存访问密钥不公开的访问密钥以供日后使用。
  10. 点击完成
  11. 选择权限标签页。
  12. 权限政策部分中,点击添加权限
  13. 选择添加权限
  14. 选择直接附加政策
  15. 搜索 AmazonS3FullAccess 政策。
  16. 选择相应政策。
  17. 点击下一步
  18. 点击添加权限

在 EDR 控制台中配置事件转发

  1. 登录 VMware Carbon Black Cloud。
  2. 前往事件转发器标签页
  3. 启用您希望产品上传到 S3 的事件。
  4. 前往输出和类型,然后设置为 S3
  5. 提供 S3 存储桶名称,格式如下:<region>:<bucket-name>(例如:us-east-1:cb-edr)。
  6. 选择以 INI 格式上传 AWS 凭据文件。
  7. 以下是配置文件的示例:

    AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
    AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
    Default region name [None]: us-east-1
    
  8. 点击保存,然后重启服务以使更改生效。

设置 Feed

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

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

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

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

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

    • 区域:Amazon S3 存储桶所在的区域。
    • S3 URI:存储桶 URI。
      • s3:/BUCKET_NAME
        • BUCKET_NAME 替换为存储桶的实际名称。
    • URI is a:根据日志流配置选择 URI_TYPE(Single file | Directory | Directory which includes subdirectories)。
    • 来源删除选项:根据您的偏好设置选择删除选项。
    • 访问密钥 ID:有权访问 S3 存储桶的用户访问密钥。
    • 私有访问密钥:有权访问 S3 存储桶的用户的私有密钥。
  9. 点击下一步

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

设置来自内容中心的 Feed

为以下字段指定值:

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

高级选项

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

UDM 映射表

日志字段 UDM 映射 逻辑
action security_result.detection_fields[?key == 'action'].value 原始日志中 action 字段的值。
cb_server intermediary.hostname 原始日志中 cb_server 字段的值。
cb_version metadata.product_version 原始日志中 cb_version 字段的值。
child_pid target.process.pid(适用于 ingress.event.childproc 事件) typeingress.event.childproc 时,原始日志中 child_pid 字段的值。
child_process_guid target.process.product_specific_process_id(适用于 ingress.event.childproc 事件) typeingress.event.childproc 时,与原始日志中的 child_process_guid 字段的值串联的“CB:”。
child_username target.user.userid(适用于 ingress.event.childproc 事件) typeingress.event.childproc 时,原始日志中 child_username 字段的值。
childproc_guid target.process.product_specific_process_id(适用于 endpoint.event.procstart 事件) typeendpoint.event.procstart 时,与原始日志中的 childproc_guid 字段的值串联的“CB:”。
childproc_hash.0 target.process.file.md5(适用于 endpoint.event.procstart 事件) typeendpoint.event.procstart 时,原始日志中 childproc_hash 数组的第一个元素。
childproc_hash.1 target.process.file.sha256(适用于 endpoint.event.procstart 事件) typeendpoint.event.procstart 时,原始日志中 childproc_hash 数组的第二个元素。
childproc_name target.process.file.full_path(适用于 endpoint.event.procstart 事件) typeendpoint.event.procstart 时,原始日志中 childproc_name 字段的值。
childproc_pid target.process.pid(适用于 endpoint.event.procstart 事件) typeendpoint.event.procstart 时,原始日志中 childproc_pid 字段的值。
childproc_publisher.0.name security_result.detection_fields[?key == 'childproc_publisher_name'].value(适用于 endpoint.event.procstart 事件) “childproc_publisher_name:”与原始日志中 typeendpoint.event.procstart 时的 childproc_publisher.0.name 值串联。
childproc_publisher.0.state security_result.detection_fields[?key == 'childproc_publisher_state'].value(适用于 endpoint.event.procstart 事件) “childproc_publisher_state:”与原始日志中 typeendpoint.event.procstart 时的 childproc_publisher.0.state 值串联。
childproc_reputation security_result.detection_fields[?key == 'childproc_reputation'].value(适用于 endpoint.event.procstart 事件) typeendpoint.event.procstart 时,原始日志中 childproc_reputation 字段的值。
childproc_username target.user.userid(适用于 endpoint.event.procstart 事件) typeendpoint.event.procstart 时,原始日志中 childproc_username 字段的值。
clientIp principal.ipprincipal.asset.ip 原始日志中 clientIp 字段的值。
cmdline target.process.command_line(适用于 feed.query.hit.processfeed.storage.hit.process 事件)、additional.fields[?key == 'cmdline_*'].value.string_value(适用于 watchlist.storage.hit.process 事件) typefeed.query.hit.processfeed.storage.hit.process 时,原始日志中 cmdline 字段的值。对于 watchlist.storage.hit.process 事件,它存储在 additional.fields 中,键为“cmdline_*”。
command_line target.process.command_line(适用于 ingress.event.procstart 事件) typeingress.event.procstart 时,原始日志中 command_line 字段的值。
comms_ip intermediary.ip 原始日志中 comms_ip 字段的值。
computer_name principal.hostnameprincipal.asset.hostname 原始日志中 computer_name 字段的值。
crossproc_api additional.fields[?key == 'crossproc_api'].value.string_value(适用于 endpoint.event.apicall 事件) typeendpoint.event.apicall 时,原始日志中 crossproc_api 字段的值。
crossproc_guid additional.fields[?key == 'crossproc_guid'].value.string_value(适用于 endpoint.event.crossproc 事件) typeendpoint.event.crossproc 时,原始日志中 crossproc_guid 字段的值。
crossproc_hash.0 additional.fields[?key == 'crossproc_md5'].value.string_value(适用于 endpoint.event.crossproc 事件) typeendpoint.event.crossproc 时,原始日志中 crossproc_hash 数组的第一个元素。
crossproc_hash.1 additional.fields[?key == 'crossproc_sha256'].value.string_value(适用于 endpoint.event.crossproc 事件) typeendpoint.event.crossproc 时,原始日志中 crossproc_hash 数组的第二个元素。
crossproc_name target.process.file.full_path(适用于 endpoint.event.crossproc 事件) typeendpoint.event.crossproc 时,原始日志中 crossproc_name 字段的值。
crossproc_publisher.0.name security_result.detection_fields[?key == 'crossproc_publisher_name'].value(适用于 endpoint.event.crossproc 事件) “crossproc_publisher_name:”与原始日志中的 crossproc_publisher.0.name 值(当 typeendpoint.event.crossproc 时)串联。
crossproc_publisher.0.state security_result.detection_fields[?key == 'crossproc_publisher_state'].value(适用于 endpoint.event.crossproc 事件) “crossproc_publisher_state:”与原始日志中 typeendpoint.event.crossproccrossproc_publisher.0.state 的值串联。
crossproc_reputation additional.fields[?key == 'crossproc_reputation'].value.string_value(适用于 endpoint.event.crossproc 事件) typeendpoint.event.crossproc 时,原始日志中 crossproc_reputation 字段的值。
crossproc_target additional.fields[?key == 'crossproc_target'].value.string_value(适用于 endpoint.event.crossproc 事件) typeendpoint.event.crossproc 时,原始日志中 crossproc_target 字段的值。转换为字符串“true”或“false”。

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