收集 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 執行個體。
- 搭載
systemd的 Windows Server 2016 以上版本或 Linux 主機,可執行 Bindplane 代理程式。 - 搭載 Python 3.9 以上版本的 Linux 主機,或用於執行 Unified Log Streamer 的容器化環境 (Docker 或 Kubernetes)。
- 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟。
- 具備管理員存取權的 Akamai EAA 租戶。
Akamai API 憑證:
- 如要存取及管理稽核動態消息:EAA 舊版 API 金鑰和密鑰 (在企業中心建立)。
- 如要使用連接器健康狀態、裝置清單和目錄健康狀態動態消息,請提供 Akamai OPEN API 憑證 (EdgeGrid 驗證),並具備 Enterprise Application Access API 的讀寫權限。
取得 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 代理程式安裝指南。
設定 Bindplane 代理程式,擷取記錄並傳送至 Google SecOps
在文字編輯器中開啟 Bindplane 代理程式設定檔:
Linux:
sudo nano /status observiq-otel-collector/config.yamlWindows:
notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"按照下列方式編輯
config.yaml檔案:receivers: tcplog: listen_address: "0.0.0.0:5140" 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 service: pipelines: logs/akamai_eaa: receivers: - tcplog exporters: - chronicle/akamai_eaa
更改下列內容:
/path/to/ingestion-authentication-file.json:擷取驗證檔案的完整路徑。- Linux:
/etc/bindplane-agent/ingestion-auth.json - Windows:
C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
- Linux:
<CUSTOMER_ID>:Google SecOps 客戶 ID。0.0.0.0:5140:Bindplane 要監聽的 IP 位址和通訊埠。視環境需要調整。
重新啟動 Bindplane 代理程式,以套用變更
如要在 Linux 中重新啟動 Bindplane 代理程式,請執行下列步驟:
執行下列指令:
sudo systemctl restart observiq-otel-collector確認服務正在執行:
sudo systemctl status observiq-otel-collector檢查記錄中是否有錯誤:
sudo journalctl -u observiq-otel-collector -f
如要在 Windows 中重新啟動 Bindplane 代理程式,請按照下列步驟操作:
您可以選擇下列其中一個選項:
- 以管理員身分開啟命令提示字元或 PowerShell:
net stop observiq-otel-collector && net start observiq-otel-collector- 服務控制台:
- 按下
Win+R,輸入services.msc,然後按下 Enter 鍵。 - 找出 observIQ OpenTelemetry Collector。
- 按一下滑鼠右鍵,然後選取「重新啟動」。
- 按下
確認服務正在執行:
sc query observiq-otel-collector檢查記錄中是否有錯誤:
type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
建立 Akamai API 憑證
Akamai EAA 會根據動態饋給類型使用兩種 API 憑證。建立與要收集的動態饋給相應的憑證。
建立 EAA 舊版 API 憑證 (用於存取和管理動態消息)
- 登入 Akamai Control Center。
- 在左側的主要導覽選單中,選取「企業中心」。
- 依序前往「一般設定」>「設定」。
- 選取「API 金鑰」分頁標籤。
- 按一下右上角的「產生新的 API 金鑰」。
- 輸入 API 金鑰的名稱和說明。
在確認畫面上,複製「金鑰」和「密碼」。
建立 Akamai OPEN API 憑證 (適用於連接器健康狀態、裝置清單和目錄健康狀態動態饋給)
- 登入 Akamai Control Center。
- 依序前往「帳戶管理員」>「身分和存取權」。
- 選取「API 使用者」分頁標籤。
- 按一下「Create API Client」(建立 API 用戶端)。
- 在「Select APIs」(選取 API) 部分,搜尋「Enterprise Application Access」(企業應用程式存取權),並將存取層級設為「READ-WRITE」(讀寫)。
- 完成其餘設定,然後按一下「建立 API 用戶端」。
按一下「下載」,即可下載
.edgerc格式的憑證;按一下「複製」,即可將憑證複製到現有的.edgerc檔案。
設定 .edgerc 憑證檔案
在要執行 ULS 的系統上建立
.edgerc憑證檔案:touch ~/.edgerc使用文字編輯器開啟檔案:
nano ~/.edgerc請以以下格式新增 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>保護憑證檔案:
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
統一記錄串流器 (ULS) 會透過 Akamai API 從 Akamai EAA 提取記錄,並使用 TCP 將記錄串流至 Bindplane 代理程式。ULS 是 Python 應用程式,需要 Python 3.9 以上版本。
Linux 安裝 (Python)
複製 ULS 存放區:
git clone https://github.com/akamai/uls.git cd uls安裝 ULS Python 需求:
pip3 install -r bin/requirements.txt安裝 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驗證安裝項目:
python3 bin/uls.py --help
安裝 Docker
提取官方 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:在 Bindplanetcplog接收器中設定的通訊埠。如要串流多個動態饋給類型,請執行個別的 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 服務。
建立 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/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啟用並啟動服務:
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 Compose 部署作業
建立
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 位址或主機名稱。
啟動容器:
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.recieved_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 |
使用 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: "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 專業人員尋求答案。