收集 Akamai EAA(企业应用访问)日志
本文档介绍了如何使用 Akamai 的 Unified Log Streamer (ULS) 和 Bindplane 将 Akamai Enterprise Application Access (EAA) 日志注入到 Google Security Operations。Akamai EAA 会生成访问日志、管理员审核日志、身份验证详细信息和连接器运行状况指标等形式的运营数据。解析器从 JSON 日志中提取字段,执行字符串转换和 IP 地址提取等数据转换,并将这些字段映射到 UDM,根据特定字段的存在情况处理各种事件类型(例如 NETWORK_HTTP 和 USER_UNCATEGORIZED)。它还会向 UDM 事件添加供应商和产品名称等元数据。
准备工作
请确保满足以下前提条件:
- Google SecOps 实例
- 运行 Bindplane 代理的 Windows 2016 或更高版本或 Linux 主机,且具有
systemd - Linux、macOS 或容器化环境 (Docker/Kubernetes),用于运行统一日志串流器
- 如果通过代理运行,请确保防火墙端口已根据 Bindplane 代理要求打开
- 具有管理员权限的 Akamai EAA 租户
- Akamai API 凭据(EdgeGrid 身份验证):
- 访问令牌
- 客户端令牌
- 客户端密钥
- API 基本主机名(例如
akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx.luna.akamaiapis.net)
获取 Google SecOps 注入身份验证文件
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 收集代理。
- 下载注入身份验证文件。将文件安全地保存在将要安装 Bindplane 的系统上。
获取 Google SecOps 客户 ID
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 个人资料。
- 复制并保存组织详细信息部分中的客户 ID。
安装 Bindplane 代理
按照以下说明在 Windows 或 Linux 操作系统上安装 Bindplane 代理。
Windows 安装
- 以管理员身份打开命令提示符或 PowerShell。
运行以下命令:
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
Linux 安装
- 打开具有 root 或 sudo 权限的终端。
运行以下命令:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
其他安装资源
- 如需了解其他安装选项,请参阅此安装指南。
配置 Bindplane 代理以注入 Syslog 并将其发送到 Google SecOps
访问配置文件:
- 找到
config.yaml文件。通常,它位于 Linux 上的/etc/bindplane-agent/目录中或 Windows 上的安装目录中。 - 使用文本编辑器(例如
nano、vi或记事本)打开该文件。
- 找到
按如下方式修改
config.yaml文件:receivers: tcplog: listen_address: "0.0.0.0:5140" exporters: chronicle/chronicle_w_labels: 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 service: pipelines: logs/akamai_eaa: receivers: - tcplog exporters: - chronicle/chronicle_w_labels- 替换以下内容:
- 将
<CUSTOMER_ID>替换为实际的客户 ID。 - 将
/path/to/ingestion-authentication-file.json更新为获取 Google SecOps 注入身份验证文件部分中保存身份验证文件的路径。 0.0.0.0:5140:Bindplane 要监听的 IP 地址和端口。根据您的环境需要进行调整。
- 将
- 替换以下内容:
重启 Bindplane 代理以应用更改
如需在 Linux 中重启 Bindplane 代理,请运行以下命令:
sudo systemctl restart bindplane-agent如需在 Windows 中重启 Bindplane 代理,您可以使用服务控制台,也可以输入以下命令:
net stop BindPlaneAgent && net start BindPlaneAgent
安装 Akamai 统一日志流式传输器
统一日志流式传输器 (ULS) 通过 Enterprise Application Access API 从 Akamai EAA 拉取日志,并使用 TCP 或 UDP 将这些日志流式传输到 Bindplane。
Linux 安装
下载最新的 ULS 版本:
curl -LO https://github.com/akamai/uls/releases/latest/download/uls-linux-amd64将该二进制文件设为可执行文件:
chmod +x uls-linux-amd64将其移至标准位置:
sudo mv uls-linux-amd64 /usr/local/bin/uls
macOS 安装
下载最新的 ULS 版本:
curl -LO https://github.com/akamai/uls/releases/latest/download/uls-darwin-amd64将该二进制文件设为可执行文件:
chmod +x uls-darwin-amd64将其移至标准位置:
sudo mv uls-darwin-amd64 /usr/local/bin/uls
Docker 安装
拉取官方 ULS Docker 映像:
docker pull akamai/uls:latest
配置 Akamai EdgeGrid 凭据
创建 EdgeGrid 凭据文件:
mkdir -p ~/.edgerc nano ~/.edgerc添加您的 Akamai API 凭据,格式如下:
[default] client_secret = your-client-secret host = akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx.luna.akamaiapis.net access_token = your-access-token client_token = your-client-token确保凭据文件安全:
chmod 600 ~/.edgerc
替换以下内容:
your-client-secret:您的 Akamai 客户端密钥。your-access-token:您的 Akamai 访问令牌。your-client-token:您的 Akamai 客户端令牌。akab-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx.luna.akamaiapis.net:您的 Akamai API 基本主机名。
将 ULS 配置为将 EAA 日志流式传输到 BindPlane
命令行执行(测试)
运行 ULS 并使用 TCP 输出将日志流式传输到 Bindplane 代理:
uls --input eaa \
--feed access \
--output tcp \
--host <BINDPLANE_HOST> \
--port 5140 \
--edgerc ~/.edgerc \
--section default
- 替换以下内容:
<BINDPLANE_HOST>:运行 Bindplane 的服务器的 IP 地址或主机名5140:在 Bindplane 的tcplog接收器中配置的端口
如需以流式传输多种 Feed 类型,请运行单独的 ULS 实例:
```bash
# Access logs
uls --input eaa --feed access --output tcp --host <BINDPLANE_HOST> --port 5140 --edgerc ~/.edgerc --section default
# Admin audit logs
uls --input eaa --feed admin --output tcp --host <BINDPLANE_HOST> --port 5140 --edgerc ~/.edgerc --section default
# Connector health
uls --input eaa --feed conhealth --output tcp --host <BINDPLANE_HOST> --port 5140 --edgerc ~/.edgerc --section default
```
Systemd 服务(生产)
对于生产环境部署,请将 ULS 配置为 systemd 服务:
创建 ULS 配置文件:
sudo mkdir -p /etc/uls sudo nano /etc/uls/eaa-access-tcp.conf添加以下配置:
ULS_INPUT=eaa ULS_FEED=access ULS_OUTPUT=tcp ULS_HOST=<BINDPLANE_HOST> ULS_PORT=5140 ULS_EDGERC=/root/.edgerc ULS_SECTION=default创建 systemd 服务文件:
sudo nano /etc/systemd/system/uls-eaa-access.service添加以下内容:
[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/local/bin/uls --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启用并启动服务:
sudo systemctl daemon-reload sudo systemctl enable uls-eaa-access.service sudo systemctl start uls-eaa-access.service验证服务是否正在运行:
sudo systemctl status uls-eaa-access.service查看日志:
sudo journalctl -u uls-eaa-access.service -f
为每个额外的 Feed 类型(管理员、conhealth)重复执行步骤 1-7,方法是创建具有不同名称(例如 uls-eaa-admin.service、uls-eaa-conhealth.service)的单独配置和服务文件。
Docker 部署
创建 Docker Compose 文件:
nano 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 command: > --input eaa --feed access --output tcp --host "$${ULS_HOST}" --port "$${ULS_PORT}" --edgerc /root/.edgerc --section default 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 command: > --input eaa --feed admin --output tcp --host "$${ULS_HOST}" --port "$${ULS_PORT}" --edgerc /root/.edgerc --section default 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 command: > --input eaa --feed conhealth --output tcp --host "$${ULS_HOST}" --port "$${ULS_PORT}" --edgerc /root/.edgerc --section default- 将
<BINDPLANE_HOST>替换为 Bindplane 服务器的 IP 地址或主机名。
- 将
启动容器:
docker-compose up -d查看日志:
docker-compose logs -f
UDM 映射表
| 日志字段 | UDM 映射 | 逻辑 |
|---|---|---|
app |
target.application |
app 字段中冒号后面的值。 |
apphost |
target.hostname |
直接映射。 |
browser |
network.http.user_agent |
直接映射。 |
bytes_in |
network.received_bytes |
直接映射。 |
bytes_out |
network.sent_bytes |
直接映射。 |
cc |
principal.location.country_or_region |
直接映射。 |
client_id |
additional.fields.key: "Client 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: "连接器响应时间",security_result.detection_fields.value: connector_resp_time |
如果 connector_resp_time 不为空或不为“-”,则有条件地进行映射。 |
content_type |
additional.fields.key: "Content type", additional.fields.value.string_value: content_type |
如果存在 content_type,则有条件地进行映射。 |
datetime |
metadata.event_timestamp |
使用 RFC3339 格式从 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 信息",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: "来源主机",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: "资源",principal.resource.attribute.labels.value: resource |
如果存在 resource,则有条件地进行映射。 |
resource_type |
principal.resource.attribute.labels.key: "Resource Type", 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 专业人士的解答。