收集 Carbon Black EDR 日志

支持的平台:

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

准备工作

确保您已完成以下两项操作:

  • 已配置的 Google SecOps 实例。
  • 对 AWS IAM 和 S3 的特权访问权限。
  • 对 Cloud 或本地 Carbon Black EDR 的特权访问权限。

配置 Carbon Black EDR On-Prem

为本地配置 Amazon S3 存储分区

  1. 按照以下用户指南创建 Amazon S3 存储分区创建存储分区
  2. 保存存储分区的名称区域,以备日后使用。
  3. 按照以下用户指南创建用户:创建 IAM 用户
  4. 选择创建的用户
  5. 选择安全凭据标签页。
  6. 点击访问密钥部分中的创建访问密钥
  7. 选择第三方服务作为用例
  8. 点击下一步
  9. 可选:添加说明标记。
  10. 点击创建访问密钥
  11. 点击下载 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 存储分区以允许 Event Forwarder 写入事件

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

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

  1. 登录 VMware Carbon Black Cloud。
  2. 前往事件转发器标签页
  3. 启用您希望产品上传到 S3 的事件。
  4. 前往输出和类型,然后将其设置为 S3
  5. 提供采用以下格式 <region>:<bucket-name> 的 S3 存储分区名称(例如 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. 点击保存并重启服务,以使更改生效。

在 Google SecOps 中配置 Feed 以提取 Carbon Black EDR 日志

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

    • 区域:Amazon S3 存储分区所在的区域。
    • S3 URI:存储分区 URI。
      • s3:/BUCKET_NAME
        • BUCKET_NAME 替换为存储分区的实际名称。
    • URI 是:根据日志流配置(单个文件 | 目录 | 包含子目录的目录)选择 URI_TYPE。
    • 来源删除选项:根据您的偏好选择删除选项。
    • 访问密钥 ID:有权访问 S3 存储分区的用户访问密钥。
    • 私有访问密钥:有权访问 S3 存储分区的用户私有密钥。
    • 资源命名空间资源命名空间
    • 提取标签:要应用于此 Feed 中的事件的标签。
  8. 点击下一步

  9. 最终确定界面中查看新的 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 时,将“CB:”与原始日志中的 child_process_guid 字段的值串联。
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 事件) typeendpoint.event.procstart 时,“childproc_publisher_name:”与原始日志中的 childproc_publisher.0.name 值串联。
childproc_publisher.0.state security_result.detection_fields[?key == 'childproc_publisher_state'].value(适用于 endpoint.event.procstart 事件) “childproc_publisher_state:”,与原始日志中的 childproc_publisher.0.state 值串联(当 typeendpoint.event.procstart 时)。
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 事件) typeendpoint.event.crossproc 时,将“crossproc_publisher_state:”与原始日志中的 crossproc_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”。

变化

2024-05-13

  • 将“alert_url”字段映射到“metadata.url_back_to_product”UDM 字段。

2024-01-19

  • 在映射之前,为“filemod_hash.0”和“filemod_hash.1”添加了 null 检查。

2023-12-27

  • 将“filemod_hash.0”和“filemod_hash.1”初始化为 null,以解析未解析的日志。

2023-10-26

  • 添加了“gsub”函数来解析未解析的字段。

2023-10-13

  • 通过添加 JSON 块处理了新的 JSON 日志。
  • 移除了“computer_name”“parent_name”“process_name”“pid”“process_path”“md5”“sha256”“process_guid”“parent_pid”“docs.0.process_pid”“cb_version”“process_hash.0”“process_hash.1”“parent_hash.0”和“parent_hash.1”字段的冗余代码。

2023-07-21

  • 向“security_result.attack_details”添加了 MITRE ATT&CK 策略和技术详细信息。

2023-03-24

  • 将“protocol”字段映射到“network.ip_protocol”。
  • 为“child_username”“child_pid”“child_command_line”字段添加了 null 条件检查。
  • 当“principal.hostname”或“principal.ip”不为 null 时,将“metadata.event_type”从“GENERIC_EVENT”更改为“STATUS_UPDATE”。

2023-03-14

  • bug 修复:
  • 在字段“type”为 null 时,映射了以下字段:
  • 将“process_guid”字段映射到“principal.process.product_specific_process_id”。
  • 将字段“device_external_ip”映射到“target.ip”。
  • 将“device_os”字段映射到“principal.platform”。
  • 将“device_group”字段映射到了“principal.group.group_display_name”。
  • 将“process_pid”字段映射到“principal.process.pid”。
  • 将“process_path”字段映射到了“principal.process.file.full_path”。
  • 将“process_cmdline”字段映射到“principal.process.command_line”。
  • 将字段“process_hash.0”映射到“principal.process.file.md5”。
  • 将字段“principal.1”映射到“principal.process.file.sha256”。
  • 将“process_username”字段映射到“principal.user.userid”。
  • 将“clientIp”字段映射到“principal.ip”。
  • 将“description”字段映射到“metadata.description”。
  • 将“orgName”字段映射到“principal.administrative_domain”。
  • 当字段“ruleName”包含“CYDERES”时,映射了以下字段:
  • 将“deviceInfo.internalIpAddress”字段映射到“principal.ip”。
  • 将字段“deviceInfo.externalIpAddress”映射到了“target.ip”。
  • 将“ruleName”字段映射到了“security_result.rule_name”。
  • 将“deviceInfo.deviceType”字段映射到“principal.asset.platform_software.platform”。
  • 将“domain”字段映射到“principal.administrative_domain”。
  • 将“deviceInfo.groupName”字段映射到了“principal.group.group_display_name”。
  • 将字段“deviceInfo.deviceVersion”映射到“principal.asset.platform_software.platform_version”。
  • 将字段“deviceInfo.deviceId”映射到“principal.asset.asset_id”。
  • 将“eventId”字段映射到“additional.fields”。
  • 当“principal.ip”和“target.ip”不为 null 时,将“metadata.event_type”从“GENERIC_EVENT”更改为“NETWORK_CONNECTION”。
  • 将“metadata.event_type”从“GENERIC_EVENT”更改为“STATUS_UPDATE”,前提是“principal.ip”不为 null。

2023-02-03

  • bug 修复:将“filemod_hash”映射到“target.file”,而不是“target.process.file”。

2023-01-20

  • bug 修复:停止为空进程 ID 填充和映射 product_specific_process_id。

2022-11-25

  • 将“远程 IP 地址”(remote_ip) 映射到“主 IP 地址”(principal.ip),并将“本地 IP 地址”(local_ip) 映射到“目标 IP 地址”(target.ip),适用于“入站”TCP/UDP 事件。
  • 将“远程端口”(remote_port) 映射到“主端口”(principal.port),并将“本地端口”(local_port) 映射到“目标端口”(target.port),适用于“入站”TCP/UDP 事件。

2022-10-06

  • 将所有客户专用解析器迁移到了默认解析器。

2022-07-10

  • 更新了“endpoint.event.'.”类型日志的“event_type”与“PROCESS_LAUNCH”的映射

需要更多帮助?向社区成员和 Google SecOps 专业人士寻求解答。