使用 Gemini 创建和修改 playbook
您可以学习如何使用基本的自然语言提示创建和修改 playbook,从而利用 Gemini 简化安全运营。
使用提示创建 playbook
如需使用 Gemini 提示创建 playbook,请执行以下操作:
- 前往响应 > Playbook。
点击 添加 添加,然后创建新的剧本。
选择剧本的文件夹及其适用的环境。
点击创建。
在新 playbook 窗格中,选择使用 Gemini 创建 playbook。
在提示窗格中,输入一个全面且结构合理的英文提示。如需详细了解如何撰写 playbook 提示,请参阅为 Gemini playbook 创建撰写提示。
点击生成剧本。系统会显示一个包含生成的剧本的预览窗格。点击 修改 图标 修改,根据需要优化提示。
点击创建 Playbook。
使用提示修改 playbook
- 选择所需的 playbook,然后选择使用 Gemini 编辑 playbook。
- 添加任何所需的更改。预览窗格会显示修改后的剧本,并显示修改前后的版本。 点击返回,然后根据需要优化提示。
- 完成更改后,点击修改 Playbook。
针对 Gemini 创建的 playbook 提供反馈
选择提供的选项之一,并添加更多反馈:
- 如果手册结果良好,请点击 thumb_up 我喜欢。您可以在其他反馈字段中添加更多信息。
- 如果 playbook 结果不符合预期,请点击 thumb_down 不喜欢。
撰写用于创建 Gemini playbook 的提示
Gemini Playbook 功能可根据您的自然语言输入创建 Google SecOps playbook(包括触发器、操作、块和条件)。如需生成有效的剧本,您必须输入清晰、具体且结构合理的提示。输出结果的质量直接受输入内容的质量影响。
使用 Gemini 创建 playbook 的功能
您可以使用 Gemini playbook 创建功能执行以下操作:
- 创建包含操作、触发器、流程和区块的新 playbook。
- 使用所有下载的商业和自定义集成。
- 在提示中将具体操作、代码块和集成名称作为 playbook 步骤。
- 了解在未提供特定集成和名称的情况下描述流程的提示。
- 使用 SOAR 响应功能支持的条件流程。
- 检测 playbook 需要哪些触发器。
使用提示创建 playbook 时,您无法执行以下操作:
- 创建 playbook 块。
- 在 playbook 中使用并行操作。
- 使用尚未下载和安装的集成。
- 使用集成实例。
使用 Gemini 编辑 playbook 的功能
借助 Gemini playbook 编辑功能,您可以执行以下操作:
- 在 playbook 中的任意位置添加 playbook 步骤。
- 删除任何 playbook 步骤。
- 修改 playbook 触发器。
- 在 playbook 中移动步骤。
- 将操作、区块或集成替换为相应的对应项。
使用提示修改剧本时,您无法执行以下操作:
- 修改条件。
撰写有效的提示
为确保 Gemini 指南功能生成尽可能准确的自动化工作流,我们建议您遵循以下有关撰写自然语言提示的最佳实践:
具体说明集成:仅当集成已在您的环境中安装并配置时,才使用具体的集成名称(例如“使用 VirusTotal 丰富数据”)。
利用 Gemini 专业化功能:Gemini 旨在构建与突发事件响应、威胁检测和自动化安全工作流相符的 playbook。根据这些安全使用场景调整提示。
定义逻辑:确保提示中清楚详细地说明了完整逻辑:
- 首先,明确目标(例如,管理恶意软件提醒)。
- 指定用于激活剧本的触发器(例如,在收到提醒时)。
- 详细说明操作(例如,丰富数据、隔离文件)。
- 包含这些操作的条件(例如,基于威胁分析结果)。
用于创建 Gemini Playbook 的提示示例
本部分将通过实际示例重点说明清晰的目标、明确定义的触发条件、具体的操作和有条件的响应如何协同工作,从而创建有效的自动化安全工作流。
示例:包含集成名称的提示
以下示例展示了使用集成名称的结构良好的提示:
Write a playbook for malware alerts. The playbook should take the file hash
from the alert and enrich it with VirusTotal. If the file hash is malicious, quarantine
the file.
此提示包含前面定义的四个组成部分:
- 明确的目标:具有明确的目标,即处理恶意软件提醒。
- 特定触发器:根据特定事件(例如收到恶意软件提醒)进行激活。
- 策略方案操作:通过第三方集成 (VirusTotal) 中的数据增强 Google Security Operations SOAR 实体。
- 条件式响应:指定基于之前结果的条件。例如,如果发现文件哈希为恶意,则应隔离该文件。
示例:按操作流程提示
以下示例展示了一个结构良好的提示,但描述了流程,而未提及具体的集成名称。
Write a playbook for malware alerts. The playbook should take the file hash
from the alert and enrich it. If the file hash is malicious, quarantine the file.
Gemini playbook 创建功能能够获取操作说明(例如“丰富文件哈希”),并浏览已安装的集成,找到最适合此操作的集成。
Gemini playbook 创建功能只能从已安装在您环境中的集成中进行选择。
自定义触发器
除了使用标准触发器之外,您还可以在剧本提示中自定义触发器。您可以为以下对象指定占位符:
- 提醒
- 事件
- 实体
- 环境
- 自由文本
在以下示例中,自由文本用于创建触发器,该触发器针对“可疑电子邮件”文件夹中的所有电子邮件执行,但电子邮件主题行中包含“[TEST]”字样的电子邮件除外。
Write a phishing playbook that'll be executed for all emails from the
'suspicious email' folder ([Event.email_folder]) that the subject
does not contain '[TEST]' ([Event.subject]). The playbook should take the
file hash and URL from the alert and enrich it with VirusTotal. If the file hash
is malicious, quarantine the file. If the URL is malicious, block it in the firewall.
示例:结构良好的提示
Write a playbook for phishing alerts. The playbook enriches usernames,
URLs and file hashes from the email and enriches them in available sources.
If one of the findings is malicious, block the finding, remove the email
from all the users' mailboxes and assign the case to tier 2.
Create a playbook for my Google Cloud Anomalous Access alert. The playbook should
enrich user account information with Google Cloud IAM, and then
enrich the IP information with VirusTotal.
If the user is an admin and the IP is malicious, the user account should be
disabled in IAM.
Write a playbook for suspicious login alerts. The playbook should enrich
the IP address with VirusTotal and get GeoIP information. If VirusTotal reported
more than 5 malicious engines and the IP address is from Iran or China,
block the IP address in Checkpoint Firewall and send an email notification to
zak@example.com.
根据大型自由形式提示创建 playbook
您还可以根据包含自由格式文本的详细提示创建剧本。例如,创建一个提示,用于描述针对特定网络攻击的补救步骤。您描述的场景越精确,生成的剧本就越准确。
需要更多帮助?从社区成员和 Google SecOps 专业人士那里获得解答。