收集 Akamai EAA (Enterprise Application Access) 記錄
本文說明如何使用 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 執行個體
- 搭載
systemd的 Windows 2016 以上版本或 Linux 主機,用於執行 Bindplane 代理程式 - 執行 Unified Log Streamer 的 Linux、macOS 或容器化環境 (Docker/Kubernetes)
- 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 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 安裝
- 開啟具備根層級或 sudo 權限的終端機。
執行下列指令:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
其他安裝資源
- 如需其他安裝選項,請參閱這份安裝指南。
設定 Bindplane 代理程式,擷取系統記錄檔並傳送至 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
重新啟動 Bindplane 代理程式,以套用變更
如要在 Linux 中重新啟動 Bindplane 代理程式,請執行下列指令:
sudo systemctl restart bindplane-agent如要在 Windows 中重新啟動 Bindplane 代理程式,可以使用「服務」控制台,或輸入下列指令:
net stop BindPlaneAgent && net start BindPlaneAgent
安裝 Akamai Unified Log Streamer
Unified Log Streamer (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接收器中設定的通訊埠
如要串流多個動態饋給類型,請執行個別 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
針對每個額外的動態饋給類型 (管理員、健康狀態),重複執行步驟 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: "Connector response time", 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: "Error code", 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: "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: "Session info", 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:「總回應時間」,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 專業人員尋求答案。