收集 Akamai Guardicore Segmentation(旧称 Guardicore Centra)日志

支持的平台:

本文档介绍了如何配置 Akamai Guardicore Segmentation(以前称为 Guardicore Centra),以使用 Akamai Unified Log Streamer (ULS) 通过 HTTP 输出将日志推送到 Google Security Operations。

Guardicore Centra 是一个微分段平台,可为数据中心、云环境和端点提供零信任网络安全。它可提供应用依赖关系的可视化视图,通过欺骗技术检测违规行为,并提供精细的分段控制来防止横向移动和遏制威胁。

准备工作

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

  • Google SecOps 实例
  • Guardicore Centra 实例(云端或本地)
  • 用于运行 Akamai ULS 的 Linux 服务器(最低配置:1 个 vCPU、1 GB RAM、500 MB 磁盘空间)
  • 在 ULS 服务器上安装了 Python 3.9 或更高版本
  • 拥有 Guardicore Centra 的管理员访问权限,可创建只读 API 用户
  • 从 ULS 服务器到 Google SecOps 提取端点的出站 HTTPS 访问权限
  • 访问 Google Cloud 控制台(用于创建 API 密钥)

在 Google SecOps 中创建 Feed

  1. 前往 SIEM 设置 > Feed。
  2. 点击添加新 Feed。
  3. 在下一页上,点击配置单个 Feed。
  4. 在Feed 名称字段中,输入 Feed 的名称。例如 Guardicore Centra Logs。
  5. 选择 Webhook 作为来源类型。
  6. 选择 Guardicore Centra 作为日志类型。
  7. 点击下一步。
  8. 为以下输入参数指定值:
    • 定界符:输入 \n 以拆分多行事件(ULS 会发送以换行符分隔的 JSON)。
    • 资产命名空间:资产命名空间。
    • 注入标签:要应用于此 Feed 中事件的标签。
  9. 点击下一步。
  10. 在最终确定界面中查看新的 Feed 配置,然后点击提交。

生成并保存密钥

创建 Feed 后,您必须生成用于身份验证的密钥,如下所示:

  1. 在 Feed 详情页面上,点击生成密钥。
  2. 对话框会显示密钥。
  3. 复制并妥善保存密钥。

获取 Feed 端点网址

  1. 前往 Feed 的详细信息标签页。
  2. 在端点信息部分,复制 Feed 端点网址。
  3. 网址格式可以是以下任一格式:

    https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs
    

    或

    https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs
    
  4. 保存此网址以供后续步骤使用。

  5. 点击完成。

创建 Google Cloud API 密钥

Google SecOps 需要使用 API 密钥进行身份验证。在 Google Cloud 控制台中创建受限 API 密钥。

创建 API 密钥

  1. 前往 Google Cloud 控制台的“凭据”页面。
  2. 选择您的项目。 这是与您的 Google SecOps 实例关联的项目。
  3. 依次点击创建凭据 > API 密钥。
  4. 系统会创建 API 密钥,并在对话框中显示该密钥。
  5. 点击修改 API 密钥以限制密钥。

限制 API 密钥

  1. 在 API 密钥设置页面中:
    • 名称:输入一个描述性名称(例如 Google SecOps Guardicore Webhook API Key)。
  2. 在 API 限制下:
    1. 选择限制密钥。
    2. 在选择 API 下拉菜单中,搜索并选择 Chronicle API。
  3. 点击保存。
  4. 复制页面顶部 API 密钥字段中的 API 密钥值。
  5. 安全地保存 API 密钥。

配置 Guardicore Centra 凭据

在 Guardicore Centra 中创建只读 API 用户

ULS 通过门户用户向 Centra API 进行身份验证。创建具有只读权限的专用用户,而不是使用管理员账号,具体操作如下:

  1. 登录 Guardicore Centra 管理控制台。
  2. 依次前往管理 > 用户。
  3. 点击 Create User(创建用户)。
  4. 提供以下配置详细信息:
    • 用户名:输入集成用户的名称(例如 secops-uls)。
    • 密码:输入密码。
    • 权限方案:选择支持(只读权限)。
  5. 点击保存。
  6. 退出账号,然后使用新用户登录,并完成强制性密码更改。
  7. 记下 Centra 管理控制台的主机名(不含 https://)。ULS 会将此主机名用作 API 主机名。

创建用于 Guardicore 身份验证的 .edgerc 文件

Akamai ULS 从 .edgerc 文件中的 gc_hostname、gc_username 和 gc_password 键读取 Guardicore 凭据。

  1. 在 ULS 服务器上,在主目录中创建 .edgerc 文件,如下所示:

    nano ~/.edgerc
    
  2. 添加以下配置:

    [default]
    gc_hostname = your-instance.cloud.guardicore.com
    gc_username = your_username
    gc_password = your_password
    

    替换以下值:

    • your-instance.cloud.guardicore.com - 您的 Guardicore Centra 管理主机名(不含 https://)
    • your_username - 上一部分中创建的只读 API 用户的用户名
    • your_password - 该用户的密码

    示例:

    [default]
    gc_hostname = cus-1234.cloud.guardicore.com
    gc_username = secops-uls
    gc_password = MySecurePassword123
    
  3. 保存并关闭文件。

  4. 按如下方式设置适当的权限:

    chmod 600 ~/.edgerc
    

安装 Akamai ULS

从 GitHub 安装 ULS

  1. 在 ULS 服务器上,按如下所示克隆 ULS 代码库:

    git clone https://github.com/akamai/uls.git
    cd uls
    
  2. 安装 Python 依赖项:

    pip3 install -r requirements.txt
    
  3. 将 Guardicore 日志提取器模块 (gc-logs) 安装到 ULS 结账的 ext 目录中:

    git clone -q --depth 1 -b v0.0.8 --single-branch https://github.com/MikeSchiessl/gc-logs.git ext/cli-gc
    pip3 install -r ext/cli-gc/bin/requirements.txt
    
  4. 验证安装:

    python3 bin/uls.py --help
    

配置 ULS 以将日志发送到 Google SecOps

构建 Google SecOps 网络钩子网址

  • 按如下方式组合 Google SecOps 端点网址和 API 密钥:

    <ENDPOINT_URL>?key=<API_KEY>
    
  • 示例:

    https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs?key=AIzaSyD...
    

针对 Guardicore NETLOG Feed 运行 ULS

NETLOG Feed 包含来自 Guardicore 代理的网络流日志。

  1. 使用以下命令运行 ULS:

    python3 bin/uls.py \
        --input gc \
        --feed NETLOG \
        --output http \
        --httpurl "https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs?key=YOUR_API_KEY" \
        --httpauthheader '{"X-Webhook-Access-Key": "YOUR_SECRET_KEY"}' \
        --httpformat '%s'
    
    • 替换以下值:
      • YOUR_API_KEY - 之前创建的 Google Cloud API 密钥
      • YOUR_SECRET_KEY - 之前生成的 Google SecOps 密钥
  2. ULS 开始将 NETLOG 事件流式传输到 Google SecOps。

针对 Guardicore INCIDENT Feed 运行 ULS

INCIDENT Feed 包含 Guardicore 检测到的安全事件。

  1. 使用以下命令运行 ULS:

    python3 bin/uls.py \
        --input gc \
        --feed INCIDENT \
        --output http \
        --httpurl "https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs?key=YOUR_API_KEY" \
        --httpauthheader '{"X-Webhook-Access-Key": "YOUR_SECRET_KEY"}' \
        --httpformat '%s'
    
    • 替换以下值:
      • YOUR_API_KEY - 之前创建的 Google Cloud API 密钥
      • YOUR_SECRET_KEY - 之前生成的 Google SecOps 密钥
  2. ULS 开始将 INCIDENT 事件流式传输到 Google SecOps。

针对 Guardicore AGENT Feed 运行 ULS

AGENT Feed 包含代理状态和健康信息。

  1. 使用以下命令运行 ULS:

    python3 bin/uls.py \
        --input gc \
        --feed AGENT \
        --output http \
        --httpurl "https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs?key=YOUR_API_KEY" \
        --httpauthheader '{"X-Webhook-Access-Key": "YOUR_SECRET_KEY"}' \
        --httpformat '%s'
    
    • 替换以下值:
      • YOUR_API_KEY - 之前创建的 Google Cloud API 密钥
      • YOUR_SECRET_KEY - 之前生成的 Google SecOps Secret 密钥
  2. ULS 将开始向 Google SecOps 流式传输 AGENT 事件。

针对 Guardicore SYSTEM Feed 运行 ULS

SYSTEM Feed 包含系统提醒和事件。

  1. 使用以下命令运行 ULS:

    python3 bin/uls.py \
        --input gc \
        --feed SYSTEM \
        --output http \
        --httpurl "https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs?key=YOUR_API_KEY" \
        --httpauthheader '{"X-Webhook-Access-Key": "YOUR_SECRET_KEY"}' \
        --httpformat '%s'
    
    • 替换以下值:
      • YOUR_API_KEY - 之前创建的 Google Cloud API 密钥
      • YOUR_SECRET_KEY - 之前生成的 Google SecOps Secret 密钥
  2. ULS 将开始向 Google SecOps 流式传输 SYSTEM 事件。

为 Guardicore AUDIT Feed 运行 ULS

AUDIT Feed 包含管理操作的审核日志。

  1. 使用以下命令运行 ULS:

    python3 bin/uls.py \
        --input gc \
        --feed AUDIT \
        --output http \
        --httpurl "https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs?key=YOUR_API_KEY" \
        --httpauthheader '{"X-Webhook-Access-Key": "YOUR_SECRET_KEY"}' \
        --httpformat '%s'
    
    • 替换以下值:
      • YOUR_API_KEY - 之前创建的 Google Cloud API 密钥
      • YOUR_SECRET_KEY - 之前生成的 Google SecOps Secret 密钥
  2. ULS 将开始向 Google SecOps 流式传输 AUDIT 事件。

将 ULS 作为后台服务运行

为确保 ULS 持续运行,请将其配置为 systemd 服务。

为 NETLOG Feed 创建 systemd 服务文件

  1. 创建服务文件:

    sudo nano /etc/systemd/system/uls-guardicore-netlog.service
    
  2. 添加以下内容:

    [Unit]
    Description=Akamai ULS - Guardicore NETLOG
    After=network.target
    
    [Service]
    Type=simple
    User=root
    WorkingDirectory=/root/uls
    ExecStart=/usr/bin/python3 /root/uls/bin/uls.py --input gc --feed NETLOG --output http --httpurl "https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs?key=YOUR_API_KEY" --httpauthheader '{"X-Webhook-Access-Key": "YOUR_SECRET_KEY"}' --httpformat '%%s'
    Restart=always
    RestartSec=10
    
    [Install]
    WantedBy=multi-user.target
    
    • 替换以下值:
      • /root/uls - 您克隆 ULS 代码库的路径
      • YOUR_API_KEY - Google Cloud API 密钥
      • YOUR_SECRET_KEY - Google SecOps 密钥
  3. 保存并关闭文件。

  4. 启用并启动服务:

    sudo systemctl daemon-reload
    sudo systemctl enable uls-guardicore-netlog.service
    sudo systemctl start uls-guardicore-netlog.service
    
  5. 检查服务状态:

    sudo systemctl status uls-guardicore-netlog.service
    

为其他 Feed 创建其他服务

针对您要收集的每个 Feed (INCIDENT, AGENT, SYSTEM, AUDIT) 重复上述步骤,并创建单独的服务文件,如下所示:

  • /etc/systemd/system/uls-guardicore-incident.service
  • /etc/systemd/system/uls-guardicore-agent.service
  • /etc/systemd/system/uls-guardicore-system.service
  • /etc/systemd/system/uls-guardicore-audit.service

在每个文件中相应地更改 --feed 参数和服务名称。

验证日志注入

  1. 等待 5-10 分钟,让系统提取并处理日志。
  2. 在 Google SecOps 控制台中,前往搜索。
  3. 运行以下 UDM 搜索查询:

    metadata.vendor_name = "Guardicore"
    
  4. 如果日志成功提取,您应该会在搜索结果中看到 Guardicore 事件。

  5. 您还可以搜索特定类型的 Feed:

    metadata.vendor_name = "Guardicore" AND metadata.product_name = "Centra"
    

问题排查

ULS 连接错误

如果 ULS 无法连接到 Guardicore,请执行以下操作:

  1. 验证 .edgerc 文件是否包含正确的主机名和凭据。
  2. 按如下方式测试与 Guardicore 实例的连接:

    curl -u "username:password" https://your-instance.cloud.guardicore.com/api/v3.0/visibility
    
  3. 检查是否可以从 ULS 服务器访问 Guardicore 实例。

ULS HTTP 输出错误

如果 ULS 无法将日志发送到 Google SecOps,请执行以下操作:

  1. 验证 API 密钥和密钥是否正确。
  2. 检查 Google SecOps 端点网址是否适合您所在的区域。
  3. 验证 ULS 服务器的出站 HTTPS 连接:

    curl -I https://malachiteingestion-pa.googleapis.com
    
  4. 查看 ULS 日志中是否有错误消息:

    sudo journalctl -u uls-guardicore-netlog.service -f
    

日志未在平台中显示

如果日志未显示在 Google SecOps 中,请执行以下操作:

  1. 在 SIEM 设置 > Feed 中,验证 webhook feed 是否处于有效状态。
  2. 查看 Feed 的运行状况标签页,了解是否存在注入错误。
  3. 验证 Feed 配置中的拆分分隔符是否设置为 \n。
  4. 确保日志类型设置为 Guardicore Centra。

自签名证书错误

如果您的 Guardicore 实例使用自签名证书,ULS 可能会失败并出现 SSL 验证错误。如需绕过 SSL 验证(不建议在生产环境中使用),请执行以下操作:

  • 将 --httpinsecure 标志添加到 ULS 命令:

    python3 bin/uls.py \
        --input gc \
        --feed NETLOG \
        --output http \
        --httpurl "https://<REGION>-chronicle.googleapis.com/v1alpha/projects/<PROJECT_NUMBER>/locations/<REGION>/instances/<INSTANCE_ID>/feeds/<FEED_ID>:importPushLogs?key=YOUR_API_KEY" \
        --httpauthheader '{"X-Webhook-Access-Key": "YOUR_SECRET_KEY"}' \
        --httpformat '%s' \
        --httpinsecure
    

可用的 Guardicore Feed

Akamai ULS 支持以下 Guardicore Feed:

Feed 名称 说明 ULS Feed 参数
NETLOG 来自 Guardicore 代理的网络流日志 NETLOG
INCIDENT Guardicore 检测到的安全事件 INCIDENT
AGENT 代理状态和健康信息 AGENT
SYSTEM 系统提醒** 系统级提醒和事件
AUDIT Logs 管理操作和配置更改 AUDIT

身份验证方法参考

Google SecOps 网络钩子 Feed 支持多种身份验证方法。Akamai ULS 使用混合方法,即在网址中使用 API 密钥,在标头中使用密钥。

ULS 使用的方法:混合(网址 + 标头)

  • 请求格式:

    POST <ENDPOINT_URL>?key=<API_KEY> HTTP/1.1
    Content-Type: application/json
    X-Webhook-Access-Key: <SECRET_KEY>
    
    {"event": "data", "timestamp": "2025-01-15T10:30:00Z"}
    
  • ULS 命令格式:

    --httpurl "<ENDPOINT_URL>?key=<API_KEY>"
    --httpauthheader '{"X-Webhook-Access-Key": "<SECRET_KEY>"}'
    

身份验证标头名称

Google SecOps 接受以下用于身份验证的 HTTP 标头名称:

对于 API 密钥:

  • X-goog-api-key(推荐)
  • X-goog-api-key(不区分大小写)

对于密钥:

  • X-Webhook-Access-Key(推荐)
  • X-Webhook-Access-Key(不区分大小写)

Webhook 限制和最佳实践

请求限制

限制 值
单行日志大小上限 1 MB
最大 QPS(每秒查询次数) 15000
请求超时 90 秒
重试行为 由发件人管理。当超出突发限制时,Google SecOps 会返回 HTTP 429;发送系统必须缓冲并重试。

最佳做法

  • 为每种 Feed 类型运行单独的 ULS 实例,以提高可靠性并简化问题排查。
  • 使用 systemd 监控 ULS 服务状态,并针对服务故障设置提醒。
  • 定期轮替 Guardicore 凭据并更新 .edgerc 文件。
  • 在 Guardicore 中使用具有只读 API 访问权限的专用服务账号。
  • 为 ULS 日志配置日志轮换,以防止磁盘可用空间问题。
  • 通过在多个服务器上运行 ULS 并进行负载均衡来测试故障切换场景。

UDM 映射表

下表列出了 Guardicore Centra 日志的日志字段及其对应的 UDM 字段。

日志字段 UDM 字段 说明
timestamp metadata.event_timestamp 事件时间戳
source_ip principal.ip 来源 IP 地址
destination_ip target.ip 目标 IP 地址
source_port principal.port 来源端口号
destination_port target.port 目标端口号
protocol network.ip_protocol 网络协议
action security_result.action 采取的安全措施
severity security_result.severity 事件严重程度
user principal.user.userid 用户名
hostname principal.hostname 来源主机名
process_name principal.process.file.full_path 进程名称
incident_id security_result.detection_fields.key 突发事件标识符
description security_result.description 活动说明

更新日志

查看此解析器的更新日志

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