将 Vertex AI 与 Google SecOps 集成

本文档介绍了如何将 Vertex AI 与 Google Security Operations 集成。

使用场景

Vertex AI 集成支持以下应用场景:

  • 自动分析恶意邮件:分析原始 EML 文件,以提取威胁级别、识别钓鱼式攻击链接或社会工程学指标,并推荐验证步骤。

  • 情境实体丰富:生成安全实体的自然语言摘要,以加快调查人员在分类期间的理解。

  • 灵活的 playbook 编排:在 playbook 中运行非结构化生成式文本提示,以协助进行预测性防御或复杂的安全分析。

  • 自定义数据转换:使用自然语言指令自动对任意 JSON 数据结构进行程序化转换。

准备工作

在 Google SecOps 中配置 Vertex AI 集成之前,请完成以下前提步骤:

  1. 创建服务账号。

  2. 向您的服务账号授予必要的 Identity and Access Management 角色。

  3. 选择并配置以下身份验证方法之一:

如需详细了解服务费用,请参阅 Vertex AI 价格。

创建服务账号

  1. 在 Google Cloud 控制台中,前往 IAM 和管理 > 服务账号。

    转到“服务账号”

  2. 点击 add 创建服务账号。

  3. 提供名称和说明,然后点击完成。记下服务账号的邮箱。

授予 IAM 角色

如需允许集成与平台服务交互,您必须向主账号授予权限。

  1. 在 Google Cloud 控制台中,前往 IAM

    转到 IAM

  2. 找到您的服务账号,然后点击修改主账号(修改)。

  3. 点击添加其他角色,然后选择 Vertex AI User (roles/aiplatform.user)。

  4. 点击保存。

配置 Workload Identity 凭证

Workload Identity 是推荐的方法,因为它使用服务账号模拟来使用短期有效访问令牌。

识别唯一实例身份

建立连接需要向 Google SecOps 实例授予模拟服务账号的权限。

  1. 在 Google SecOps 中,前往内容中心 > 响应集成。

  2. 选择 Vertex AI 集成,然后在 Workload Identity 邮箱中输入您的服务账号邮箱。

  3. 依次点击保存 > 测试。测试预计会失败。

  4. 点击测试按钮旁边的 close_small,然后找到以 gke-init-python@... 或 soar-python@... 开头的身份电子邮件。

  5. 复制此唯一邮箱。

在 Google Cloud中授权实例身份

  1. 在 Google Cloud 控制台中,前往 IAM 和管理 > 服务账号。

    转到“服务账号”

  2. 选择目标服务账号,然后依次前往权限 > 授予访问权限。

  3. 将唯一邮箱粘贴到新主账号中,并分配 Service Account Token Creator 角色 (roles/iam.serviceAccountTokenCreator)。

配置 JSON 密钥

静态、长期有效的密钥文件需要手动轮替。仅当 Workload Identity 身份验证不可用时,才使用此方法。

  1. 在 Google Cloud 控制台中,依次前往 IAM 和管理 > 服务账号,然后选择您的服务账号。

    转到“服务账号”

  2. 前往密钥标签页,然后依次点击添加密钥 > 创建新密钥。

  3. 选择 JSON,然后点击创建。浏览器会将 JSON 文件下载到您的计算机。

集成参数

Vertex AI 集成需要以下参数:

参数 说明
API Root

必填。

Vertex AI 实例的 API 根。

默认值为 https://LOCATION-aiplatform.googleapis.com。

Workload Identity Email

可选。

服务账号的客户端邮箱。

仅当您使用 Workload Identity 进行身份验证时,才需要配置此参数。如果已配置,则会忽略 Service Account JSON File Content。

Service Account JSON File Content

可选。

服务账号密钥 JSON 文件的完整内容。

为服务账号密钥身份验证配置此参数。

Project ID

可选。

Pub/Sub 中要定位到的项目 ID。

如果未提供任何值,则集成会从服务账号凭证中检索 ID。

Default Model

可选。

要定位的默认模型的名称。

默认值为 gemini-1.5-flash-002。

Location

可选。

Vertex AI API 的位置 ID。

如果未提供任何值,集成会从 API 根目录中提取位置 ID。

Verify SSL

必填。

验证与服务器连接的 SSL 证书。默认处于启用状态。

如需了解如何在 Google SecOps 中配置集成,请参阅配置集成。

如有需要,您可以在后续阶段进行更改。配置集成实例后,您可以在 playbook 中使用该实例。如需详细了解如何配置和支持多个实例,请参阅支持多个实例。

操作

如需详细了解操作,请参阅 在工作桌上响应待处理的操作和在案例中运行手动操作。

分析 EML

使用分析 EML 操作,通过 Vertex AI 分析 EML 文件。 此操作会单独提交每个文件。

此操作不会在 Google SecOps 实体上运行。

操作输入

Analyze EML 操作需要以下参数:

参数 说明
Model ID 可选

要使用的模型的 ID,例如 gemini-1.5-flash-002。

Temperature 可选

用于控制词元选择随机程度的值。此参数接受 float 数据类型值。

如需详细了解温度值,请参阅使用参数值进行实验。

Files To Analyze 必需

要提交以供分析的 EML 文件的逗号分隔列表。

Max Output Tokens 可选

每个回答中要生成的输出 token 数量上限。

词元约为 4 个字符。100 个 token 大约对应 60-80 个单词。此限制适用于每个实体。

如需了解详情,请参阅使用参数值进行实验。

默认值为 100。

操作输出

Analyze EML(分析 EML)操作会提供以下输出:

操作输出类型 可用性
案例墙附件 不可用
案例墙链接 不可用
案例墙表格 不可用
丰富化表 不可用
JSON 结果 可用
输出消息 可用
脚本结果 可用
JSON 结果

以下示例展示了使用分析 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

操作失败。

请检查与服务器的连接、输入参数或凭据。

脚本结果

下表列出了使用分析 EML 操作时脚本结果输出的值:

脚本结果名称 值
is_success True 或 False

描述实体

使用描述实体操作,通过 Vertex AI 汇总实体相关信息。

此操作会对所有 Google SecOps 实体运行,并单独提交每个实体。

操作输入

描述实体操作需要以下参数:

参数 说明
Model ID 可选

要使用的模型的 ID,例如 gemini-1.5-flash-002。

Temperature 可选

用于控制词元选择随机程度的值。此参数接受 float 数据类型值。

如需详细了解温度值,请参阅使用参数值进行实验。

Exclude Fields 可选

在生成实体摘要期间要排除的 Google SecOps 实体元数据字段的英文逗号分隔列表。

Force Refresh 可选

如果选中,该操作会忽略 Refresh After (Days) 参数和哈希验证,并在每次操作运行时重新生成实体摘要。

默认情况下不选择。

Refresh After (Days) 必需

操作在刷新实体摘要之前等待的天数。

该操作会根据发送到 Vertex AI 的所有输入(不包括 Fields To Ignore 参数中的值)生成哈希值。如果哈希值发生变化,该操作会在设定的天数后刷新摘要。如果哈希值未更改,则即使 Refresh After (Days) 参数值早于最新摘要生成时间,该操作也不会刷新摘要。

该操作会验证最新实际生成的摘要的哈希值,并忽略缓存的哈希值。

默认值为 30。

Max Output Tokens 可选

每个回答中要生成的输出 token 数量上限。

词元约为 4 个字符。100 个 token 大约对应 60-80 个单词。此限制适用于每个实体。

如需了解详情,请参阅使用参数值进行实验。

操作输出

描述实体操作提供以下输出:

操作输出类型 可用性
案例墙附件 不可用
案例墙链接 不可用
案例墙表格 不可用
丰富化表 不可用
JSON 结果 可用
输出消息 可用
脚本结果 可用
JSON 结果

以下示例展示了使用描述实体操作时收到的 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
            }
        }
    }
]
输出消息

描述实体操作可能会返回以下输出消息:

输出消息 消息说明
Successfully summarized the entity based on the available information using Vertex AI. 操作成功。
Error executing action "Describe Entity". Reason: ERROR_REASON

操作失败。

请检查与服务器的连接、输入参数或凭据。

脚本结果

下表列出了使用描述实体操作时脚本结果输出的值:

脚本结果名称 值
is_success True 或 False

执行提示

使用执行提示操作,通过 Vertex AI 执行单个文本提示词。

此操作不会在 Google SecOps 实体上运行。

操作输入

执行提示操作需要以下参数:

参数 说明
Model ID 可选

要使用的模型的 ID,例如 gemini-1.5-flash-002。

Text Prompt 必需

要包含在提示中的文本指令。

Temperature 可选

用于控制词元选择随机程度的值。此参数接受 float 数据类型值。

如需详细了解温度值,请参阅使用参数值进行实验。

Candidate Count 可选

每次操作运行时要返回的响应变体数量。

对于每个请求,系统会针对输入词元计费一次,并针对所有生成的候选词元的每个输出词元计费。

Response MIME Type 可选

生成的候选文本的输出回答的媒体 (MIME) 类型。

以下模型支持回答媒体 (MIME) 类型:gemini-1.5-pro、gemini-1.5-flash。

可能的值如下:

  • application/json
  • text/plain
  • text/x.enum
默认值为 text/plain。
Response Schema 可选

生成的候选文本要遵循的架构。

如需使用此参数,请配置 Response MIME Type 参数。

响应 schema 适用于以下模型:gemini-1.5-pro、gemini-1.5-flash。

Max Input Tokens 可选

要提交的输入 token 的数量上限。

一个 token 最多包含 4 个字符。100 个 token 大约对应 60-80 个单词。

如果您未设置值,该操作会执行任何提示。 如果令牌数量超过配置的数量上限,则操作会失败。

Max Output Tokens 可选

每个回答中要生成的输出 token 数量上限。

词元约为 4 个字符。100 个 token 大约对应 60-80 个单词。此限制适用于每个实体。

如需了解详情,请参阅使用参数值进行实验。

操作输出

执行提示操作会提供以下输出:

操作输出类型 可用性
案例墙附件 不可用
案例墙链接 不可用
案例墙表格 不可用
丰富化表 不可用
JSON 结果 可用
输出消息 可用
脚本结果 可用
JSON 结果

以下示例展示了使用执行提示操作时收到的 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": ""
}
输出消息

执行提示操作可以返回以下输出消息:

输出消息 消息说明
Successfully executed a prompt. 操作成功。
Error executing action "Execute Prompt". Reason: ERROR_REASON

操作失败。

请检查与服务器的连接、输入参数或凭据。

脚本结果

下表列出了使用执行提示操作时脚本结果输出的值:

脚本结果名称 值
is_success True 或 False

Ping

使用 Ping 操作测试与 Vertex AI 的连接。

此操作不会在 Google SecOps 实体上运行。

操作输入

无。

操作输出

Ping 操作提供以下输出:

操作输出类型 可用性
案例墙附件 不可用
案例墙链接 不可用
案例墙表格 不可用
丰富化表 不可用
JSON 结果 不可用
输出消息 可用
脚本结果 可用
输出消息

Ping 操作可能会返回以下输出消息:

输出消息 消息说明
Successfully connected to Vertex AI with the provided connection parameters! 操作成功。

Failed to connect to Vertex AI. The API root that you provided doesn't match the following expected pattern: "https://((\w|-)+)-aiplatform.googleapis.com". Check the spelling.

Failed to connect to Vertex AI! The error is ERROR_REASON

操作失败。

请检查与服务器的连接、输入参数或凭据。

脚本结果

下表列出了使用 Ping 操作时脚本结果输出的值:

脚本结果名称 值
is_success True 或 False

转换数据

使用转换数据操作通过 Vertex AI 执行数据转换。

此操作不会在 Google SecOps 实体上运行。

操作输入

转换数据操作需要以下参数:

参数 说明
Model ID 可选

要使用的模型的 ID,例如 gemini-1.5-flash-002。

Text Prompt 必需

要包含在提示中的文本指令。

Temperature 可选

用于控制词元选择随机程度的值。此参数接受 float 数据类型值。

如需详细了解温度值,请参阅使用参数值进行实验。

JSON Object 必需

用作操作输入的 JSON 对象。

Max Output Tokens 必需

每个回答中要生成的输出 token 数量上限。

词元约为 4 个字符。100 个 token 大约对应 60-80 个单词。此限制适用于每个实体。

如需了解详情,请参阅使用参数值进行实验。

默认值为 100。

操作输出

转换数据操作会提供以下输出:

操作输出类型 可用性
案例墙附件 不可用
案例墙链接 不可用
案例墙表格 不可用
丰富化表 不可用
JSON 结果 可用
输出消息 可用
脚本结果 可用
JSON 结果

以下示例展示了使用转换数据操作时收到的 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

操作失败。

请检查与服务器的连接、输入参数或凭据。

脚本结果

下表列出了使用转换数据操作时脚本结果输出的值:

脚本结果名称 值
is_success True 或 False

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