整合 Vertex AI 與 Google SecOps
本文說明如何將 Vertex AI 與 Google Security Operations 整合。
用途
Vertex AI 整合功能支援下列用途:
自動分析惡意電子郵件:分析原始 EML 檔案,擷取威脅等級、找出網路釣魚連結或社交工程指標,並建議驗證步驟。
情境實體擴充:生成安全性實體的自然語言摘要,加快調查人員在分類期間的理解速度。
靈活的應對手冊自動化調度:在應對手冊中執行非結構化生成式文字提示詞,協助預測防禦或複雜的安全分析。
自訂資料轉換:使用自然語言指令,自動以程式輔助轉換任意 JSON 資料結構。
事前準備
在 Google SecOps 中設定 Vertex AI 整合前,請先完成下列必要步驟:
選擇並設定下列其中一種驗證方式:
方法 1:Workload Identity (建議):這個方法會使用服務帳戶模擬功能,產生短期權杖。
方法 2:服務帳戶 JSON 金鑰:這個方法會使用靜態、長期有效的密鑰檔案。
如要進一步瞭解服務費用,請參閱「Vertex AI 定價」。
建立服務帳戶
在 Google Cloud 控制台,依序前往 「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶)。
按一下「add」「Create service account」(建立服務帳戶)。
輸入名稱和說明,然後按一下「完成」。記下服務帳戶的電子郵件地址。
授予 IAM 角色
如要允許整合項目與平台服務互動,您必須將權限授予主體。
前往 Google Cloud 控制台的「IAM」。
找到服務帳戶,然後按一下「Edit principal」(編輯主體) (編輯)。
按一下「Add another role」(新增其他角色),然後選取「Vertex AI User」(Vertex AI 使用者) (
roles/aiplatform.user)。按一下 [儲存]。
設定 Workload Identity 憑證
建議您使用 Workload Identity,因為這項功能會透過服務帳戶模擬,使用短期存取權杖。
找出專屬執行個體身分
建立連線時,必須授予 Google SecOps 執行個體權限,才能模擬服務帳戶。
在 Google SecOps 中,依序前往 「Content Hub」 >「Response Integrations」。
選取「Vertex AI」整合,然後在「Workload Identity Email」(Workload Identity 電子郵件) 中輸入服務帳戶電子郵件。
依序點選「儲存」 > 「測試」。測試預計會失敗。
按一下「Test」(測試) 按鈕旁的 close_small,然後找出開頭為
gke-init-python@...或soar-python@...的身分電子郵件。複製這個專屬電子郵件地址。
在 Google Cloud中授權執行個體身分
在 Google Cloud 控制台,依序前往 「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶)。
選取目標服務帳戶,然後依序前往 「Permissions」(權限) >「Grant Access」(授予存取權)。
將不重複的電子郵件地址貼到「新增主體」,並指派「服務帳戶權杖建立者」角色 (
roles/iam.serviceAccountTokenCreator)。
設定 JSON 金鑰
靜態、長期有效的密鑰檔案需要手動輪替。只有在無法使用 Workload Identity 驗證時,才應採用這個方法。
在 Google Cloud 控制台中,依序前往 「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶),然後選取 服務帳戶。
前往「金鑰」分頁,依序點選「新增金鑰」 > 「建立新的金鑰」。
選取「JSON」,然後點選「建立」。瀏覽器會將 JSON 檔案下載到您的電腦。
整合參數
Vertex AI 整合功能需要下列參數:
| 參數 | 說明 |
|---|---|
API Root |
這是必填欄位。 Vertex AI 執行個體的 API 根目錄。 預設值為 |
Workload Identity Email |
選填。 服務帳戶的用戶端電子郵件地址。 只有在使用 Workload Identity 進行驗證時,才需要設定這個參數。如果設定,系統會忽略 |
Service Account JSON File Content |
選填。 服務帳戶金鑰 JSON 檔案的完整內容。 設定這個參數,即可使用服務帳戶金鑰驗證。 |
Project ID |
選填。 Pub/Sub 中的目標專案 ID。 如未提供任何值,整合作業會從服務帳戶憑證擷取 ID。 |
Default Model |
選填。 要指定的預設模型名稱。 預設值為 |
Location |
選填。 Vertex AI API 的位置 ID。 如未提供任何值,整合會從 API 根目錄擷取地區 ID。 |
Verify SSL |
這是必填欄位。 驗證與伺服器連線的 SSL 憑證。(預設為啟用)。 |
如要瞭解如何在 Google SecOps 中設定整合功能,請參閱「設定整合功能」。
如有需要,您可以在後續階段進行變更。設定整合執行個體後,即可在應對手冊中使用。如要進一步瞭解如何設定及支援多個執行個體,請參閱「支援多個執行個體」。
動作
如要進一步瞭解動作,請參閱「 在工作區回應待處理動作」和「在案件中執行手動動作」。
分析 EML
使用「Analyze EML」動作,透過 Vertex AI 分析 EML 檔案。這項操作會個別提交每個檔案。
這項動作不會在 Google SecOps 實體上執行。
動作輸入內容
「Analyze EML」動作需要下列參數:
| 參數 | 說明 |
|---|---|
Model ID |
選用 要使用的模型 ID,例如 |
Temperature |
選用 這個值會決定選取詞元時的隨機程度。這個參數接受 如要進一步瞭解溫度值,請參閱「測試不同參數值」。 |
Files To Analyze |
必要 以半形逗號分隔的 EML 檔案清單,用於提交分析。 |
Max Output Tokens |
選用 每則回覆中可生成的輸出詞元數量上限。 一個符記約為四個字元,100 個符記約等於 60 到 80 個字。這項限制適用於每個實體。 詳情請參閱「測試不同參數值」。 預設值為 |
動作輸出內容
「Analyze EML」動作會提供下列輸出內容:
| 動作輸出類型 | 可用性 |
|---|---|
| 案件總覽附件 | 無法使用 |
| 案件總覽連結 | 無法使用 |
| 案件總覽表格 | 無法使用 |
| 補充資訊表格 | 無法使用 |
| JSON 結果 | 可用 |
| 輸出訊息 | 可用 |
| 指令碼執行結果 | 可用 |
JSON 結果
以下範例顯示使用「Analyze EML」動作時,收到的 JSON 結果輸出內容:
[{
"Entity": "file",
"EntityResult": {
"raw": "{\"threat_level\": \"High\", \"threats_found\": [{\"threat\": \"Phishing Links\", \"explanation\": \"Multiple links point",
"extracted_info": {
"threat_level": "High",
"threats_found": [
{
"threat": "Phishing Links",
"explanation": "Multiple links point to example.com, a suspicious domain likely used for phishing campaigns.",
"example": "URL"
},
{
"threat": "Social Engineering",
"explanation": "The email uses urgency and scarcity tactics, pressuring the recipient to click links quickly.",
"example": "Register Now and Save $1,000 on all 2-Day Project Management (Fundamentals)"
},
{
"threat": "Suspicious Domain",
"explanation": "The email uses the domain example.com', which is not commonly associated with legitimate businesses or organizations and may be a newly registered domain for malicious purposes. This should be checked for validity and legitimacy. The email also uses the domain pdu-xl.com which may also be suspicious.",
"example": "example.com"
}
],
"verification_steps": [
"Check the domain reputation of example.com using online tools like VirusTotal or URLVoid.",
"Analyze email headers to identify the true sender's IP address and location using email analysis tools.",
"Verify the legitimacy of mentioned products or services by independently contacting the companies mentioned."
],
"protection_measures": [
"Avoid clicking links in suspicious emails. Hover over links to check the actual URL in a separate tool.",
"Enable email filtering and anti-phishing features in your email client.",
"Regularly update your antivirus and anti-malware software.",
"Educate users about social engineering tactics and phishing schemes."
]
},
"usageMetadata": {
"promptTokenCount": 12,
"candidatesTokenCount": 778,
"totalTokenCount": 790
}
}
}]
輸出訊息
「Analyze EML」動作可能會傳回下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully analysed the following EML files using Vertex AI:
FILE_PATHS |
動作成功。 |
Error executing action "Analyze EML". Reason:
ERROR_REASON |
動作失敗。 請檢查伺服器連線、輸入參數或憑證。 |
指令碼執行結果
下表列出使用「Analyze EML」動作時,指令碼結果輸出的值:
| 指令碼結果名稱 | 值 |
|---|---|
is_success |
True或False |
描述實體
使用「Describe Entity」(描述實體) 動作,透過 Vertex AI 總結實體相關資訊。
這項動作會對所有 Google SecOps 實體執行,並個別提交每個實體。
動作輸入內容
Describe Entity 動作需要下列參數:
| 參數 | 說明 |
|---|---|
Model ID |
選用 要使用的模型 ID,例如 |
Temperature |
選用 這個值會決定選取詞元時的隨機程度。這個參數接受 如要進一步瞭解溫度值,請參閱「測試不同參數值」。 |
Exclude Fields |
選用 以半形逗號分隔的 Google SecOps 實體中繼資料欄位清單,在生成實體摘要時會排除這些欄位。 |
Force Refresh |
選用 如果選取,動作會忽略 預設為未選取。 |
Refresh After (Days) |
必要 動作在重新整理實體摘要前等待的天數。 這項動作會根據傳送至 Vertex AI 的所有輸入內容 (不含 這項動作會驗證最新實際生成摘要的雜湊值,並忽略快取的雜湊值。 預設值為 |
Max Output Tokens |
選用 每則回覆中可生成的輸出詞元數量上限。 一個符記約為四個字元,100 個符記約等於 60 到 80 個字。這項限制適用於每個實體。 詳情請參閱「測試不同參數值」。 |
動作輸出內容
「Describe Entity」動作會提供下列輸出內容:
| 動作輸出類型 | 可用性 |
|---|---|
| 案件總覽附件 | 無法使用 |
| 案件總覽連結 | 無法使用 |
| 案件總覽表格 | 無法使用 |
| 補充資訊表格 | 無法使用 |
| JSON 結果 | 可用 |
| 輸出訊息 | 可用 |
| 指令碼執行結果 | 可用 |
JSON 結果
以下範例顯示使用「Describe Entity」(描述實體) 動作時,收到的 JSON 結果輸出內容:
[
{
"Entity": "1B16D64CE18772B8F77C74C3D4DC24AA066BB117",
"EntityResult": {
"summary": "This is a suspicious, enriched, internal file hash (SHA1: 1B16D64CE18772B8F77C74C3D4DC24AA066BB117) identified as a Microsoft Excel 2007+ file (\"FC090000\") located on a user's desktop. VirusTotal analysis shows 3 malicious flags out of 65 total engines. The file contains macros, is potentially obfuscated, and exhibits behaviors like writing to files, running DLLs, and downloading content. It was last modified on 2024-11-13 and created on 2021-07-07. The file is linked to a single case (\"potential_apt_doc_files\") which was closed. The file is flagged as an artifact but not vulnerable or a pivot point.\n",
"usageMetadata": {
"promptTokenCount": 12,
"candidatesTokenCount": 778,
"totalTokenCount": 790
}
}
}
]
輸出訊息
Describe Entity 動作可傳回下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully summarized the entity based on the available
information using Vertex AI. |
動作成功。 |
Error executing action "Describe Entity". Reason:
ERROR_REASON |
動作失敗。 請檢查伺服器連線、輸入參數或憑證。 |
指令碼執行結果
下表列出使用「Describe Entity」動作時,指令碼結果輸出的值:
| 指令碼結果名稱 | 值 |
|---|---|
is_success |
True或False |
執行提示詞
使用「執行提示詞」 動作,透過 Vertex AI 執行個別文字提示詞。
這項動作不會在 Google SecOps 實體上執行。
動作輸入內容
「執行提示」動作需要下列參數:
| 參數 | 說明 |
|---|---|
Model ID |
選用 要使用的模型 ID,例如 |
Text Prompt |
必要 提示中要包含的文字指令。 |
Temperature |
選用 這個值會決定選取詞元時的隨機程度。這個參數接受 如要進一步瞭解溫度值,請參閱「測試不同參數值」。 |
Candidate Count |
選用 每次執行動作時要傳回的回覆變化版本數量。 針對每項要求,系統會對輸入詞元計費一次,並對所有生成候選詞元的每個輸出詞元計費。 |
Response MIME Type |
選用 生成候選文字的輸出回覆媒體 (MIME) 類型。 回應媒體 (MIME) 類型適用於下列模型: 可能的值如下:
text/plain。 |
Response Schema |
選用 生成的候選文字應遵循的結構定義。 如要使用這項參數,請設定 回覆結構定義適用於下列模型: |
Max Input Tokens |
選用 要提交的輸入權杖數量上限。 一個詞元最多包含四個字元。100 個詞元約等於 60 到 80 個字。 如未設定值,動作會執行任何提示。 如果權杖數量超過設定的上限,動作就會失敗。 |
Max Output Tokens |
選用 每則回覆中可生成的輸出詞元數量上限。 一個符記約為四個字元,100 個符記約等於 60 到 80 個字。這項限制適用於每個實體。 詳情請參閱「測試不同參數值」。 |
動作輸出內容
「執行提示」動作會提供下列輸出內容:
| 動作輸出類型 | 可用性 |
|---|---|
| 案件總覽附件 | 無法使用 |
| 案件總覽連結 | 無法使用 |
| 案件總覽表格 | 無法使用 |
| 補充資訊表格 | 無法使用 |
| JSON 結果 | 可用 |
| 輸出訊息 | 可用 |
| 指令碼執行結果 | 可用 |
JSON 結果
以下範例顯示使用「Execute Prompt」(執行提示) 動作時,收到的 JSON 結果輸出內容:
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Responding to a malicious email requires a layered approach. Here's a breakdown of remediation steps, prioritizing actions based on urgency:\n\n**Immediate Actions (within minutes):**\n\n1. **Do NOT click any links or open any attachments.** This is paramount. Malicious links can download malware, and attachments can contain viruses or exploits.\n\n2. **Disconnect from the internet (if possible).** This limits the damage the malware can do if it's already on your system. Unplug your ethernet cable or turn off Wi-Fi.\n\n3. **Close the email immediately.** Don't even hover over links or attachments; the preview might be enough to trigger some malware.\n\n**Investigative Actions (within hours):**\n\n4. **Check your email account for unauthorized access.** Look for unfamiliar sent emails, changed settings (like forwarding rules), or new accounts added.\n\n5. **Run a full system scan with your antivirus software.** Ensure your antivirus definitions are up-to-date before running the scan. Consider a second opinion scan with a different reputable antivirus program.\n\n6. **Review your computer's processes (Task Manager on Windows, Activity Monitor on macOS).** Look for unfamiliar processes consuming significant resources. This could indicate malware activity.\n\n7. **Check your network connections.** See if any unauthorized connections exist.\n\n8. **Change your email password immediately.** Use a strong, unique password. Consider using a password manager.\n\n9. **If you clicked a link or opened an attachment, consider the potential impact.** Did you enter credentials? Did you download a file? The severity of action needed depends on this.\n\n**Remediation Actions (within days):**\n\n10. **Contact your IT department or security professional.** They can provide expert guidance and assist with more advanced remediation steps.\n\n11. **Consider more advanced malware scanning tools.** There are specialized tools that can detect malware missed by standard antivirus.\n\n12. **Review your operating system's security settings.** Ensure firewalls are enabled and that other security features are adequately configured.\n\n13. **Report the malicious email to your email provider.** This helps them remove the email and prevent others from being affected. You can often do this by forwarding the email to an abuse reporting address provided by your provider. Report it to the appropriate authorities if you suspect the email involves a crime.\n\n14. **Monitor your accounts and financial records for suspicious activity.** Phishing emails often aim to steal credentials and financial information.\n\n**Preventive Actions (ongoing):**\n\n15. **Implement strong email filtering.** Use spam filters and configure your email provider's security settings to block suspicious emails.\n\n16. **Train yourself and others to identify phishing emails.** Be wary of emails with unusual addresses, grammatical errors, urgent requests, or suspicious attachments.\n\n17. **Keep your software up to date.** Regularly update your operating system, applications, and antivirus software.\n\n18. **Use strong, unique passwords for all accounts.** A password manager can assist with this.\n\n19. **Enable two-factor authentication (2FA) wherever possible.** This adds an extra layer of security to your accounts.\n\n\n**If you suspect your personal data or financial information has been compromised:**\n\n* **Contact your bank and credit card companies immediately.** Report any suspicious transactions and consider placing a fraud alert on your accounts.\n* **Consider credit monitoring services.** This can help you detect and respond to identity theft.\n\n\nThe severity of the remediation steps depends on the nature of the malicious email and what actions you took in response to it. If you're unsure about any step, err on the side of caution and seek professional help.\n"
}
]
},
"finishReason": "STOP",
"avgLogprobs": -0.4171245741660307
}
],
"usageMetadata": {
"promptTokenCount": 12,
"candidatesTokenCount": 778,
"totalTokenCount": 790
},
"modelVersion": "gemini-1.5-flash-002",
"Text_context": ""
"extracted_info": ""
}
輸出訊息
Execute Prompt 動作可能會傳回下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully executed a prompt. |
動作成功。 |
Error executing action "Execute Prompt". Reason:
ERROR_REASON |
動作失敗。 請檢查伺服器連線、輸入參數或憑證。 |
指令碼執行結果
下表列出使用「Execute Prompt」動作時,指令碼結果輸出的值:
| 指令碼結果名稱 | 值 |
|---|---|
is_success |
True或False |
乒乓
使用 Ping 動作測試與 Vertex AI 的連線能力。
這項動作不會在 Google SecOps 實體上執行。
動作輸入內容
無
動作輸出內容
Ping 動作會提供下列輸出內容:
| 動作輸出類型 | 可用性 |
|---|---|
| 案件總覽附件 | 無法使用 |
| 案件總覽連結 | 無法使用 |
| 案件總覽表格 | 無法使用 |
| 補充資訊表格 | 無法使用 |
| JSON 結果 | 無法使用 |
| 輸出訊息 | 可用 |
| 指令碼執行結果 | 可用 |
輸出訊息
Ping 動作可能會傳回下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully connected to Vertex AI with the provided connection
parameters! |
動作成功。 |
|
動作失敗。 請檢查伺服器連線、輸入參數或憑證。 |
指令碼執行結果
下表列出使用 Ping 動作時,指令碼結果輸出的值:
| 指令碼結果名稱 | 值 |
|---|---|
is_success |
True或False |
轉換資料
使用「Transform Data」(轉換資料) 動作,透過 Vertex AI 轉換資料。
這項動作不會在 Google SecOps 實體上執行。
動作輸入內容
「Transform Data」動作需要下列參數:
| 參數 | 說明 |
|---|---|
Model ID |
選用 要使用的模型 ID,例如 |
Text Prompt |
必要 提示中要包含的文字指令。 |
Temperature |
選用 這個值會決定選取詞元時的隨機程度。這個參數接受 如要進一步瞭解溫度值,請參閱「測試不同參數值」。 |
JSON Object |
必要 要用做動作輸入內容的 JSON 物件。 |
Max Output Tokens |
必要 每則回覆中可生成的輸出詞元數量上限。 一個符記約為四個字元,100 個符記約等於 60 到 80 個字。這項限制適用於每個實體。 詳情請參閱「測試不同參數值」。 預設值為 |
動作輸出內容
「轉換資料」動作會提供下列輸出內容:
| 動作輸出類型 | 可用性 |
|---|---|
| 案件總覽附件 | 無法使用 |
| 案件總覽連結 | 無法使用 |
| 案件總覽表格 | 無法使用 |
| 補充資訊表格 | 無法使用 |
| JSON 結果 | 可用 |
| 輸出訊息 | 可用 |
| 指令碼執行結果 | 可用 |
JSON 結果
以下範例顯示使用「Transform Data」(轉換資料) 動作時,收到的 JSON 結果輸出內容:
{
"candidates": [
{
"content": {
"role": "model",
"parts": [
{
"text": "Respondo it. If you're unsure about any step, err on the side of caution and seek professional help.\n"
}
]
},
"finishReason": "STOP",
"avgLogprobs": -0.4171245741660307
}
],
"usageMetadata": {
"promptTokenCount": 12,
"candidatesTokenCount": 778,
"totalTokenCount": 790
},
"modelVersion": "gemini-1.5-flash-002",
"Text_context": ""
"extracted_info": ""
}
輸出訊息
「轉換資料」動作可能會傳回下列輸出訊息:
| 輸出訊息 | 訊息說明 |
|---|---|
Successfully transformed provided data. |
動作成功。 |
Error executing action "Transform Data". Reason:
ERROR_REASON |
動作失敗。 請檢查伺服器連線、輸入參數或憑證。 |
指令碼執行結果
下表列出使用「Transform Data」(轉換資料) 動作時,指令碼結果輸出的值:
| 指令碼結果名稱 | 值 |
|---|---|
is_success |
True或False |
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求解答。