收集 Akamai Enterprise Application Access 日志

解析器版本:3.0

支持的语言:

本文档介绍了如何使用 Akamai Unified Log Streamer (ULS) 和 Bindplane 将 Akamai Enterprise Application Access (EAA) 日志注入到 Google Security Operations。Akamai EAA 是一种零信任网络访问解决方案,可提供安全、身份感知型企业应用访问权限,而无需使用传统 VPN。EAA 会生成访问日志、管理员审核日志、连接器健康状况指标、设备清单和目录健康状况信息等形式的运营数据。解析器会从 JSON 日志中提取字段,执行数据转换(例如字符串转换和 IP 地址提取),并将这些字段映射到 UDM,同时根据特定字段的存在情况处理各种事件类型(包括 NETWORK_HTTP 和 USER_UNCATEGORIZED)。

准备工作

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

  • Google SecOps 实例。
  • Windows Server 2016 或更高版本,或者具有 systemd 的 Linux 主机,用于运行 Bindplane 代理。
  • 安装了 Python 3.9 或更高版本的 Linux 主机,或用于运行 Unified Log Streamer 的容器化环境(Docker 或 Kubernetes)。
  • 如果在代理后面运行,请确保防火墙端口根据 Bindplane 代理要求处于打开状态。
  • 具有管理员权限的 Akamai EAA 租户。
  • Akamai API 凭证:

    • 对于访问和管理员审核 Feed:EAA 旧版 API 密钥和 Secret(在 Enterprise Center 中创建)。
    • 对于连接器运行状况、设备清单和目录运行状况 Feed:Akamai OPEN API 凭据(EdgeGrid 身份验证),具有对 Enterprise Application Access API 的读写权限。

获取 Bindplane 代理的 Google SecOps 凭证

如需向 Google SecOps 验证 Bindplane 代理,请选择以下方法之一:

  • 新部署:使用 Chronicle API(选项 1)。
  • 旧版部署:继续使用数据注入身份验证文件(方法 2),直到 Ingestion API 于 2027 年 7 月 20 日停用。
  1. 登录 Google Cloud 控制台,然后选择与您的 Google SecOps 实例关联的 Google Cloud 项目。
  2. 前往 IAM 和管理 > 服务账号。
  3. 点击创建服务账号。
  4. 提供以下配置详细信息:
    • 服务账号名称:输入账号的名称(例如 bindplane-ingest)。
    • 服务账号说明:输入说明(例如 Bindplane agent log ingestion)。
  5. 点击创建并继续。
  6. 在向此服务账号授予对项目的访问权限部分,点击选择角色,然后选择 Chronicle Editor。
  7. 点击继续,然后点击完成。
  8. 点击您创建的服务账号,然后前往密钥标签页。
  9. 依次点击添加密钥> 创建新密钥。
  10. 选择 JSON,然后点击创建。密钥文件会下载到您的计算机上。
  11. 将密钥文件另存为 Bindplane 收集器目录(Linux 上的 /opt/observiq-otel-collector/ingestion-auth.json 或 Windows 上的 C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json)中的 ingestion-auth.json,或更新 config.yaml 中的 creds_file_path 以匹配您保存该文件的路径。
  12. 前往 IAM 和管理 > 设置,然后复制项目编号。您在配置导出器时需要用到该名称。

方法 2:下载数据注入身份验证文件(旧版)

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 收集代理。
  3. 下载数据注入身份验证文件。
  4. 将文件安全地保存在将安装 Bindplane 代理的系统上。

获取 Google SecOps 客户 ID

  1. 登录 Google SecOps 控制台。
  2. 前往 SIEM 设置 > 个人资料。
  3. 复制并保存组织详细信息部分中的客户 ID。

安装 Bindplane 代理

按照以下说明在 Windows 或 Linux 操作系统上安装 Bindplane 代理。

Windows 安装

  1. 以管理员身份打开命令提示符或 PowerShell。
  2. 运行以下命令:

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    

Linux 安装

  1. 打开具有 root 或 sudo 权限的终端。
  2. 运行以下命令:

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    

其他安装资源

如需了解其他安装选项,请参阅 Bindplane 代理安装指南。

配置 Bindplane 代理以注入日志并将其发送到 Google SecOps

  1. 在文本编辑器中打开 Bindplane 代理配置文件:

    Linux:

    sudo nano /opt/observiq-otel-collector/config.yaml
    

    Windows:

    notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
    
  2. 按如下方式修改 config.yaml 文件:

    receivers:
      tcplog:
        listen_address: "0.0.0.0:5140"
    
    exporters:
      chronicle/akamai_eaa:
        protocol: https
        # Region of your instance, for example us, europe, asia-southeast1
        location: <LOCATION>
        # Project number of the Google Cloud project linked to the instance
        project: '<PROJECT_NUMBER>'
        compression: gzip
        creds_file_path: '/path/to/ingestion-authentication-file.json'
        customer_id: '<CUSTOMER_ID>'
        endpoint: chronicle.googleapis.com
        log_type: 'AKAMAI_EAA'
        raw_log_field: body
        ingestion_labels:
          source: akamai_eaa
    
    service:
      pipelines:
        logs/akamai_eaa:
          receivers:
            - tcplog
          exporters:
            - chronicle/akamai_eaa
    

替换以下内容:

  • /path/to/ingestion-authentication-file.json:服务账号 JSON 密钥文件的完整路径(选项 1)。
    • Linux:/opt/observiq-otel-collector/ingestion-auth.json
    • Windows:C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
  • 将 <LOCATION> 替换为 Google SecOps 实例的区域(例如 us、europe 或 asia-southeast1)。导出器会使用此值作为 chronicle.googleapis.com 的前缀。
  • 将 <PROJECT_NUMBER> 替换为 IAM 和管理 > 设置中的项目编号。
  • <CUSTOMER_ID>:Google SecOps 客户 ID。
  • 0.0.0.0:5140:Bindplane 监听的 IP 地址和端口。根据您的环境进行调整。

旧版提取 API 导出工具

  • 如果您使用选项 2 中的数据注入身份验证文件,请将 exporters 代码块替换为以下内容。将 creds_file_path 设置为提取身份验证文件的路径,如果您的实例位于美国境外,请将 malachiteingestion-pa.googleapis.com 替换为您的区域端点(例如 europe-malachiteingestion-pa.googleapis.com)。

    exporters:
      chronicle/akamai_eaa:
        compression: gzip
        creds_file_path: '/path/to/ingestion-authentication-file.json'
        customer_id: '<CUSTOMER_ID>'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: 'AKAMAI_EAA'
        raw_log_field: body
        ingestion_labels:
          source: akamai_eaa
    

重启 Bindplane 代理以应用更改

如需在 Linux 中重启 Bindplane 代理,请运行以下命令:

  1. 运行以下命令:

    sudo systemctl restart observiq-otel-collector
    
  2. 验证服务是否正在运行:

    sudo systemctl status observiq-otel-collector
    
  3. 检查日志中的错误:

    sudo journalctl -u observiq-otel-collector -f
    

如需在 Windows 中重启 Bindplane 代理,请执行以下操作:

  1. 请从下列选项中选择一项:

    • 以管理员身份运行命令提示符或 PowerShell:
    net stop observiq-otel-collector && net start observiq-otel-collector
    
    • 服务控制台:
      1. 按 Win+R,输入 services.msc,然后按 Enter 键。
      2. 找到 observIQ OpenTelemetry 收集器。
      3. 右键点击,然后选择重新启动。
  2. 验证服务是否正在运行:

    sc query observiq-otel-collector
    
  3. 检查日志中是否存在错误:

    type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
    

创建 Akamai API 凭证

Akamai EAA 使用两种类型的 API 凭据,具体取决于 Feed 类型。创建与您要收集的 Feed 对应的凭据。

创建 EAA 旧版 API 凭据(用于访问和管理 Feed)

  1. 登录 Akamai 控制中心。
  2. 从左侧的主导航菜单中选择企业中心。
  3. 依次前往常规设置 > 设置。
  4. 选择 API 密钥标签页。
  5. 点击右上角的生成新的 API 密钥。
  6. 输入 API 密钥的名称和说明。
  7. 在确认屏幕上,复制密钥和密钥。

创建 Akamai OPEN API 凭证(用于连接器运行状况、设备资产清单和目录运行状况 Feed)

  1. 登录 Akamai 控制中心。
  2. 依次前往账号管理 > 身份和访问权限。
  3. 选择 API 用户标签页。
  4. 点击创建 API 客户端。
  5. 在选择 API 部分中,搜索 Enterprise Application Access,并将访问权限级别设置为读写。
  6. 完成其余设置,然后点击创建 API 客户端。
  7. 点击下载,以 .edgerc 格式下载凭证,或点击复制,将凭证复制到现有 .edgerc 文件中。

配置 .edgerc 凭据文件

  1. 在将运行 ULS 的系统上创建 .edgerc 凭据文件:

    touch ~/.edgerc
    
  2. 在文本编辑器中打开该文件:

    nano ~/.edgerc
    
  3. 按以下格式添加您的 Akamai API 凭据:

    [default]
    ; EAA Legacy API credentials (for access and admin feeds)
    eaa_api_host = manage.akamai-access.com
    eaa_api_key = <EAA_API_KEY>
    eaa_api_secret = <EAA_API_SECRET>
    
    ; Akamai OPEN API credentials (for conhealth, devinv, dirhealth feeds)
    host = <OPEN_API_HOST>
    client_token = <CLIENT_TOKEN>
    client_secret = <CLIENT_SECRET>
    access_token = <ACCESS_TOKEN>
    
  4. 确保凭据文件安全:

    chmod 600 ~/.edgerc
    

替换以下内容:

  • <EAA_API_KEY>:EAA 旧版 API 密钥(例如 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)。
  • <EAA_API_SECRET>:EAA 旧版 API 密钥。
  • <OPEN_API_HOST>:您的 Akamai OPEN API 主机名(例如 akaa-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx.luna.akamaiapis.net)。
  • <CLIENT_TOKEN>:您的 Akamai OPEN API 客户端令牌(例如 akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx)。
  • <CLIENT_SECRET>:您的 Akamai OPEN API 客户端密钥。
  • <ACCESS_TOKEN>:您的 Akamai OPEN API 访问令牌(例如 akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx)。

安装 Akamai Unified Log Streamer

Unified Log Streamer (ULS) 通过 Akamai API 从 Akamai EAA 拉取日志,并使用 TCP 将其流式传输到 Bindplane 代理。ULS 是一个 Python 应用,需要 Python 3.9 或更高版本。

Linux 安装 (Python)

  1. 克隆 ULS 代码库:

    git clone https://github.com/akamai/uls.git
    cd uls
    
  2. 安装 ULS Python 要求:

    pip3 install -r bin/requirements.txt
    
  3. 安装 EAA CLI 依赖项:

    git clone --depth 1 --single-branch https://github.com/akamai/cli-eaa.git ext/cli-eaa
    pip3 install -r ext/cli-eaa/requirements.txt
    
  4. 验证安装:

    python3 bin/uls.py --help
    

Docker 安装

  1. 拉取官方 ULS Docker 映像:

    docker pull akamai/uls:latest
    

将 ULS 配置为将 EAA 日志流式传输到 Bindplane

命令行执行(测试)

  • 运行 ULS 并使用 TCP 输出,将日志流式传输到 Bindplane 代理:

    python3 bin/uls.py --input eaa \
        --feed access \
        --output tcp \
        --host <BINDPLANE_HOST> \
        --port 5140 \
        --edgerc ~/.edgerc \
        --section default
    

替换以下内容:

  • <BINDPLANE_HOST>:运行 Bindplane 代理的服务器的 IP 地址或主机名。
  • 5140:在 Bindplane tcplog 接收器中配置的端口。

  • 如需以流式传输多种 Feed 类型,请运行单独的 ULS 实例:

    # Access logs
    python3 bin/uls.py --input eaa --feed access --output tcp --host <BINDPLANE_HOST> --port 5140 --edgerc ~/.edgerc --section default
    
    # Admin audit logs
    python3 bin/uls.py --input eaa --feed admin --output tcp --host <BINDPLANE_HOST> --port 5140 --edgerc ~/.edgerc --section default
    
    # Connector health
    python3 bin/uls.py --input eaa --feed conhealth --output tcp --host <BINDPLANE_HOST> --port 5140 --edgerc ~/.edgerc --section default
    

Systemd 服务(生产)

对于生产部署,请将 ULS 配置为 systemd 服务。

  1. 创建 ULS 配置文件:

    sudo mkdir -p /etc/uls
    sudo nano /etc/uls/eaa-access-tcp.conf
    
  2. 添加以下配置:

    ULS_INPUT=eaa
    ULS_FEED=access
    ULS_OUTPUT=tcp
    ULS_HOST=<BINDPLANE_HOST>
    ULS_PORT=5140
    ULS_EDGERC=/root/.edgerc
    ULS_SECTION=default
    
  3. 创建 systemd 服务文件:

    sudo nano /etc/systemd/system/uls-eaa-access.service
    
  4. 添加以下内容:

    [Unit]
    Description=Unified Log Streamer - EAA Access Logs to Bindplane
    After=network.target
    
    [Service]
    Type=simple
    EnvironmentFile=/etc/uls/eaa-access-tcp.conf
    ExecStart=/usr/bin/python3 /opt/uls/bin/uls.py --input ${ULS_INPUT} --feed ${ULS_FEED} --output ${ULS_OUTPUT} --host ${ULS_HOST} --port ${ULS_PORT} --edgerc ${ULS_EDGERC} --section ${ULS_SECTION}
    Restart=always
    RestartSec=10
    User=root
    
    [Install]
    WantedBy=multi-user.target
    
  5. 启用并启动服务:

    sudo systemctl daemon-reload
    sudo systemctl enable uls-eaa-access.service
    sudo systemctl start uls-eaa-access.service
    
  6. 验证服务是否正在运行:

    sudo systemctl status uls-eaa-access.service
    
  7. 查看日志:

    sudo journalctl -u uls-eaa-access.service -f
    

为每个额外的 Feed 类型(管理员、conhealth)重复执行步骤 1-7,方法是创建具有不同名称(例如 uls-eaa-admin.service、uls-eaa-conhealth.service)的单独配置和服务文件。

Docker Compose 部署

  1. 创建 docker-compose.yml 文件:

    version: '3.8'
    
    services:
      uls-eaa-access:
        image: akamai/uls:latest
        container_name: uls-eaa-access
        restart: unless-stopped
        environment:
          - ULS_INPUT=eaa
          - ULS_FEED=access
          - ULS_OUTPUT=tcp
          - ULS_HOST=<BINDPLANE_HOST>
          - ULS_PORT=5140
        volumes:
          - ~/.edgerc:/root/.edgerc:ro
    
      uls-eaa-admin:
        image: akamai/uls:latest
        container_name: uls-eaa-admin
        restart: unless-stopped
        environment:
          - ULS_INPUT=eaa
          - ULS_FEED=admin
          - ULS_OUTPUT=tcp
          - ULS_HOST=<BINDPLANE_HOST>
          - ULS_PORT=5140
        volumes:
          - ~/.edgerc:/root/.edgerc:ro
    
      uls-eaa-conhealth:
        image: akamai/uls:latest
        container_name: uls-eaa-conhealth
        restart: unless-stopped
        environment:
          - ULS_INPUT=eaa
          - ULS_FEED=conhealth
          - ULS_OUTPUT=tcp
          - ULS_HOST=<BINDPLANE_HOST>
          - ULS_PORT=5140
        volumes:
          - ~/.edgerc:/root/.edgerc:ro
    

将 <BINDPLANE_HOST> 替换为 Bindplane 代理服务器的 IP 地址或主机名。

  1. 启动容器:

    docker compose up -d
    
  2. 查看日志:

    docker compose logs -f
    

UDM 映射表

日志字段 UDM 映射 逻辑
app target.application app 字段中冒号后面的值。
apphost target.hostname 直接映射。
browser network.http.user_agent 直接映射。
bytes_in network.recieved_bytes 直接映射。
bytes_out network.sent_bytes 直接映射。
cc principal.location.country_or_region 直接映射。
client_id additional.fields.key:“客户端 ID”,additional.fields.value.string_value:client_id 如果存在 client_id,则有条件地进行映射。
clientip principal.ip 直接映射。
cloud_zone principal.cloud.availability_zone 直接映射。
connector_resp_time security_result.detection_fields.key: "Connector response time", security_result.detection_fields.value: connector_resp_time 如果 connector_resp_time 不为空或“-”,则按条件映射。
content_type additional.fields.key: "内容类型",additional.fields.value.string_value: content_type 如果存在 content_type,则有条件地进行映射。
datetime metadata.event_timestamp 使用 RFC 3339 格式从 datetime 字段解析。
deny_reason security_result.summary 直接映射。
device_type principal.platform,principal.platform_version 根据正则表达式匹配结果映射到 WINDOWS、LINUX 或 MAC。原始值会映射到 principal.platform_version。
di metadata.ingestion_labels.key: "di", metadata.ingestion_labels.value: di 直接映射为提取标签。
error_code additional.fields.key: "错误代码",additional.fields.value.string_value: error_code 如果存在 error_code,则有条件地映射。
event metadata.description 直接映射。
geo_city principal.location.city 直接映射。
geo_country principal.location.country_or_region 直接映射。
geo_state principal.location.state 直接映射。
groups principal.user.group_identifiers 直接映射。
http_method network.http.method 直接映射。
http_ver network.application_protocol,network.application_protocol_version 使用 grok 进行解析,以提取协议和版本。
idpinfo additional.fields.key: "IDP Info", additional.fields.value.string_value: idpinfo 如果存在 idpinfo,则有条件地进行映射。
internal_host additional.fields.key: "Internal host", additional.fields.value.string_value: internal_host 如果存在 internal_host,则有条件地进行映射。
metadata.log_type metadata.log_type 硬编码为“AKAMAI_EAA”。
metadata.product_name metadata.product_name 硬编码为“AKAMAI_EAA”。
metadata.vendor_name metadata.vendor_name 硬编码为“AKAMAI_EAA”。
metadata.event_type metadata.event_type 由逻辑决定:如果存在 uid,则为 USER_UNCATEGORIZED;如果同时设置了 principal.ip 和 target,则为 NETWORK_HTTP;否则为 GENERIC_EVENT。
origin_host additional.fields.key: "Origin host", additional.fields.value.string_value: origin_host 如果存在 origin_host,则有条件地进行映射。
origin_resp_time security_result.detection_fields.key: "Origin response time", security_result.detection_fields.value: origin_resp_time 如果 origin_resp_time 不为空或不为“-”,则有条件地进行映射。
os principal.platform 根据正则表达式匹配,映射到 WINDOWS、MAC 或 LINUX。
port target.port app 字段中冒号后面的值。
ral metadata.description ral 数组的串联值,以英文逗号分隔。
referer network.http.referral_url 直接映射。
resource principal.resource.attribute.labels.key: "Resource", principal.resource.attribute.labels.value: resource 如果存在 resource,则有条件地映射。
resource_type principal.resource.attribute.labels.key:“资源类型”,principal.resource.attribute.labels.value:resource_type 如果存在 resource_type,则有条件地映射。
rscd metadata.ingestion_labels.key: "rscd", metadata.ingestion_labels.value: rscd 直接映射为提取标签。
session_id network.session_id 直接映射。
session_info additional.fields.key:“会话信息”,additional.fields.value.string_value:session_info 如果存在 session_info,则有条件地进行映射。
state principal.location.state 直接映射。
status_code network.http.response_code 直接映射。
total_resp_time security_result.detection_fields.key: "Total response time", security_result.detection_fields.value: total_resp_time 如果 total_resp_time 不为空或不为“-”,则有条件地进行映射。
ts metadata.event_timestamp 如果存在 ts 字段,则从该字段中解析为 UNIX 毫秒或秒,否则从 datetime 字段中解析。
uid principal.user.userid 直接映射。
uip principal.ip 直接映射。
url_path target.url 直接映射。
user_agent network.http.user_agent,network.http.parsed_user_agent 直接映射并解析为结构化 parsed_user_agent 字段。
username principal.user.email_addresses 或 principal.user.userid 如果看起来像电子邮件,则映射到 email_addresses,否则映射到 userid。

更新日志

查看此解析器的更新日志

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