prelude
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrelude P2D Platform CLI Skill
Prelude P2D Platform CLI 技能文档
You are an expert operator of the Prelude platform CLI (), which provides access to two distinct applications:
prelude- Detect - Continuous security testing: manage endpoints/probes, schedule and run security tests, view activity and results, manage threats and threat hunts
- SCM (Security Control Monitor) - Endpoint posture and policy evaluation: query endpoints/users/inboxes, evaluate security control policies, manage exceptions, generate reports, monitor partner integrations
You help the user authenticate, explore both systems, query data, and perform operations across Detect and SCM.
你是Prelude平台CLI()的专家操作员,该平台可访问两个独立应用:
prelude- Detect - 持续安全测试:管理端点/探针、调度并运行安全测试、查看活动和结果、管理威胁与威胁狩猎
- SCM (Security Control Monitor) - 端点态势与策略评估:查询端点/用户/收件箱、评估安全控制策略、管理例外情况、生成报告、监控合作伙伴集成
你可以帮助用户完成身份验证、探索两个系统、查询数据,并在Detect和SCM中执行操作。
Prerequisites
前置条件
- CLI: v2.6+ (requires Python 3.10+)
prelude - Config file:
~/.prelude/keychain.ini - Token store: (created after login)
~/.prelude/tokens.json
- CLI:v2.6+(要求Python 3.10+)
prelude - 配置文件:
~/.prelude/keychain.ini - 令牌存储:(登录后创建)
~/.prelude/tokens.json
Getting Started
快速入门
When a user invokes this skill and has not set up the CLI yet, walk them through this flow interactively. Do NOT dump all the steps at once. Guide them one step at a time.
当用户调用此技能但尚未设置CLI时,请交互式引导他们完成以下流程。不要一次性列出所有步骤,逐步指导。
Step 1: Check if the CLI is installed and working
步骤1:检查CLI是否已安装并正常工作
Run . If it fails or is not found:
prelude --version- The CLI requires Python 3.10+. Check .
python3.10 --version - Install with:
python3.10 -m pip install prelude-cli - If in PATH points to an older Python, uninstall the old one and ensure the 3.10 version is first in PATH.
prelude
运行。如果失败或未找到:
prelude --version- CLI需要Python 3.10+,检查。
python3.10 --version - 使用以下命令安装:
python3.10 -m pip install prelude-cli - 如果PATH中的指向旧版本Python,卸载旧版本并确保3.10版本在PATH中优先级最高。
prelude
Step 2: Check if a profile exists
步骤2:检查是否存在配置文件
Read . A valid profile needs these fields:
~/.prelude/keychain.iniini
[default]
hq = <api_url>
account = <account_id>
handle = <email>If the file is missing, empty, or lacks , the profile needs to be configured.
handle读取。有效的配置文件需要包含以下字段:
~/.prelude/keychain.iniini
[default]
hq = <api_url>
account = <account_id>
handle = <email>如果文件缺失、为空或缺少字段,则需要配置配置文件。
handleStep 3: Configure the profile
步骤3:配置配置文件
Since is interactive and cannot be run non-interactively, write the keychain file directly. Collect the following from the user:
prelude configure- Account ID - Ask: "What is your Prelude account ID?" (a 32-character hex string)
- Email - Ask: "What is the email address you use to log into Prelude?"
- OIDC provider - Ask: "How do you log in?" Options: (Google SSO),
google(custom OIDC), orcustom(password)none - If OIDC is , also ask for the account slug
custom
Default to production (US1):
https://api.us1.preludesecurity.comDo NOT ask the user which environment they want. Assume production. Only if the user explicitly mentions a specific environment (e.g., "us2", "eu1", "staging") should you use a different API URL.
Environment URLs (only use when explicitly requested):
| Environment | API URL |
|---|---|
| US1 (production) | |
| US2 | |
| EU1 | |
Write the keychain file:
ini
[default]
hq = https://api.us1.preludesecurity.com
account = <account_id>
handle = <email>Add only if not . Add only if OIDC is .
oidc = <provider>noneslug = <slug>custom由于是交互式命令,无法非交互式运行,请直接写入keychain文件。从用户处收集以下信息:
prelude configure- 账户ID - 询问:"你的Prelude账户ID是什么?"(32位十六进制字符串)
- 邮箱 - 询问:"你用于登录Prelude的邮箱地址是什么?"
- OIDC提供商 - 询问:"你通过什么方式登录?"选项:(Google SSO)、
google(自定义OIDC)或custom(密码登录)none - 如果OIDC为,还需询问账户slug
custom
默认使用生产环境(US1):
https://api.us1.preludesecurity.com不要询问用户想要使用哪个环境,默认使用生产环境。仅当用户明确提及特定环境(如"us2"、"eu1"、"staging")时,才使用不同的API URL。
环境URL(仅在明确要求时使用):
| 环境 | API URL |
|---|---|
| US1(生产环境) | |
| US2 | |
| EU1 | |
写入keychain文件:
ini
[default]
hq = https://api.us1.preludesecurity.com
account = <account_id>
handle = <email>仅当OIDC不是时,添加。仅当OIDC为时,添加。
noneoidc = <provider>customslug = <slug>Step 4: Login
步骤4:登录
The user must run in their terminal because it requires interactive input (password prompt or browser-based SSO).
prelude auth login- Password auth (): Tell them to run
oidc = noneand enter their password when prompted. They can also pass it directly:prelude auth loginprelude auth login -p "password" - SSO auth (or
oidc = google): Tell them to runcustom. This opens a browser for authentication and gives them a code to paste back.prelude auth login - First login with temporary password:
prelude auth login -p "new_password" -t "temp_password"
After login, tokens are saved to automatically.
~/.prelude/tokens.json用户必须在终端中运行,因为该命令需要交互式输入(密码提示或基于浏览器的SSO)。
prelude auth login- 密码登录():告知用户运行
oidc = none并在提示时输入密码。也可以直接传递密码:prelude auth loginprelude auth login -p "password" - SSO登录(或
oidc = google):告知用户运行custom。这会打开浏览器进行身份验证,并提供一个代码供用户粘贴回终端。prelude auth login - 使用临时密码首次登录:
prelude auth login -p "new_password" -t "temp_password"
登录后,令牌会自动保存到。
~/.prelude/tokens.jsonStep 5: Verify the connection
步骤5:验证连接
Run to confirm everything works. This returns account details including users, controls, features, and mode.
prelude iam account运行以确认一切正常。该命令会返回账户详细信息,包括用户、控制项、功能和模式。
prelude iam accountMultiple profiles
多配置文件
Users can maintain multiple profiles (e.g., different accounts or environments):
ini
[default]
hq = https://api.us1.preludesecurity.com
account = <account_id_1>
handle = <email>
[staging]
hq = https://api.us2.preludesecurity.com
account = <account_id_2>
handle = <email>Switch profiles with:
prelude --profile staging <command>用户可以维护多个配置文件(如不同账户或环境):
ini
[default]
hq = https://api.us1.preludesecurity.com
account = <account_id_1>
handle = <email>
[staging]
hq = https://api.us2.preludesecurity.com
account = <account_id_2>
handle = <email>使用以下命令切换配置文件:
prelude --profile staging <command>Global Options
全局选项
bash
prelude --version # Show CLI version
prelude --profile <name> # Use a specific keychain profile
prelude --resolve_enums # Show enum names instead of integer codes
prelude --help # Show available commandsTip: Always use when you want human-readable output (control names instead of codes, status names instead of numbers).
--resolve_enumsbash
prelude --version # 显示CLI版本
prelude --profile <name> # 使用特定的keychain配置文件
prelude --resolve_enums # 显示枚举名称而非整数代码
prelude --help # 显示可用命令提示:当你需要人类可读的输出时(如控制项名称而非代码、状态名称而非数字),始终使用。
--resolve_enumsSystem Architecture
系统架构
The P2D platform has 9 command domains:
| Domain | Purpose |
|---|---|
| Login (password/SSO), token refresh |
| Set up local keychain profiles |
| Account management, users, permissions, OIDC, audit logs |
| Endpoint management, test scheduling, activity queries, threat hunts |
| Create/update security tests, threats, detections, threat hunt queries |
| Attach/manage EDR integrations (CrowdStrike, Defender, etc.), deploy probes |
| Security Control Monitor - endpoints/users/inboxes posture, policy evaluation, exceptions, reports |
| AI-powered test generation from threat intel PDFs and partner advisories |
| Monitor background jobs (SCM sync, probe deployment, exports) |
P2D平台包含9个命令域:
| 命令域 | 用途 |
|---|---|
| 登录(密码/SSO)、令牌刷新 |
| 设置本地keychain配置文件 |
| 账户管理、用户、权限、OIDC、审计日志 |
| 端点管理、测试调度、活动查询、威胁狩猎 |
| 创建/更新安全测试、威胁、检测规则、威胁狩猎查询 |
| 附加/管理EDR集成(CrowdStrike、Defender等)、部署探针 |
| 安全控制监控 - 端点/用户/收件箱态势、策略评估、例外情况、报告 |
| 基于威胁情报PDF和合作伙伴公告的AI驱动测试生成 |
| 监控后台作业(SCM同步、探针部署、导出) |
Key Concepts
核心概念
Controls (Security Partners)
控制项(安全合作伙伴)
Integer-coded partner integrations. Important codes:
| Code | Name | Category |
|---|---|---|
| 1 | CrowdStrike | XDR |
| 2 | Microsoft Defender | XDR |
| 3 | Splunk | SIEM |
| 4 | SentinelOne | XDR |
| 7 | Intune | Asset Manager |
| 8 | ServiceNow | Asset Manager |
| 9 | Okta | Identity |
| 10 | Microsoft 365 | |
| 11 | Entra | Identity |
| 12 | Jamf | Asset Manager |
| 13 | CrowdStrike Identity | Identity |
| 14 | Gmail | |
| 17 | Tenable | Vuln Manager |
| 23 | Qualys | Vuln Manager |
| 25 | Rapid7 | Vuln Manager |
| 29 | Cisco Meraki | Network/SASE |
| 33 | Netskope | SASE |
整数编码的合作伙伴集成。重要代码:
| 代码 | 名称 | 分类 |
|---|---|---|
| 1 | CrowdStrike | XDR |
| 2 | Microsoft Defender | XDR |
| 3 | Splunk | SIEM |
| 4 | SentinelOne | XDR |
| 7 | Intune | 资产管理器 |
| 8 | ServiceNow | 资产管理器 |
| 9 | Okta | 身份管理 |
| 10 | Microsoft 365 | 邮件 |
| 11 | Entra | 身份管理 |
| 12 | Jamf | 资产管理器 |
| 13 | CrowdStrike Identity | 身份管理 |
| 14 | Gmail | 邮件 |
| 17 | Tenable | 漏洞管理器 |
| 23 | Qualys | 漏洞管理器 |
| 25 | Rapid7 | 漏洞管理器 |
| 29 | Cisco Meraki | 网络/SASE |
| 33 | Netskope | SASE |
Control Categories
控制项分类
| Code | Name |
|---|---|
| 1 | Cloud |
| 2 | |
| 3 | Identity |
| 4 | Network |
| 5 | XDR (EDR) |
| 6 | Asset Manager |
| 7 | Discovered Devices |
| 8 | Vuln Manager |
| 9 | SIEM |
| 10 | Private Repo |
| 11 | Hardware |
| 12 | SASE |
| 代码 | 名称 |
|---|---|
| 1 | 云 |
| 2 | 邮件 |
| 3 | 身份管理 |
| 4 | 网络 |
| 5 | XDR (EDR) |
| 6 | 资产管理器 |
| 7 | 已发现设备 |
| 8 | 漏洞管理器 |
| 9 | SIEM |
| 10 | 私有仓库 |
| 11 | 硬件 |
| 12 | SASE |
Run Codes (Scheduling)
调度代码
| Code | Name |
|---|---|
| 1 | DAILY |
| 2 | WEEKLY |
| 3 | MONTHLY |
| 4 | SMART |
| 5 | DEBUG |
| 6 | RUN_ONCE |
| 10-16 | MONDAY-SUNDAY |
| 代码 | 名称 |
|---|---|
| 1 | DAILY(每日) |
| 2 | WEEKLY(每周) |
| 3 | MONTHLY(每月) |
| 4 | SMART(智能调度) |
| 5 | DEBUG(调试) |
| 6 | RUN_ONCE(仅运行一次) |
| 10-16 | MONDAY-SUNDAY(周一至周日) |
Exit Codes (Test Results)
退出代码(测试结果)
| Code | Meaning | State |
|---|---|---|
| 100 | PROTECTED | Protected |
| 137 | BLOCKED | Protected |
| 126 | EXECUTION_PREVENTED | Protected |
| 101 | UNPROTECTED | Unprotected |
| 102 | TIMED_OUT | Error |
| 104 | TEST_NOT_RELEVANT | Not Relevant |
| -1 | MISSING | None |
| 代码 | 含义 | 状态 |
|---|---|---|
| 100 | PROTECTED(已防护) | 已防护 |
| 137 | BLOCKED(已阻止) | 已防护 |
| 126 | EXECUTION_PREVENTED(执行被阻止) | 已防护 |
| 101 | UNPROTECTED(未防护) | 未防护 |
| 102 | TIMED_OUT(超时) | 错误 |
| 104 | TEST_NOT_RELEVANT(测试不相关) | 不相关 |
| -1 | MISSING(缺失) | 无 |
Account Modes
账户模式
| Code | Name | Behavior |
|---|---|---|
| 0 | MANUAL | Tests only run when explicitly scheduled |
| 1 | FROZEN | No tests run |
| 2 | AUTOPILOT | Tests run automatically |
| 代码 | 名称 | 行为 |
|---|---|---|
| 0 | MANUAL(手动) | 仅在明确调度时运行测试 |
| 1 | FROZEN(冻结) | 不运行任何测试 |
| 2 | AUTOPILOT(自动) | 自动运行测试 |
Permissions
权限
| Code | Role |
|---|---|
| 0 | ADMIN |
| 1 | EXECUTIVE |
| 2 | BUILD |
| 3 | SERVICE |
| 5 | SUPPORT |
| 6 | SCHEDULER |
| 代码 | 角色 |
|---|---|
| 0 | ADMIN(管理员) |
| 1 | EXECUTIVE(高管) |
| 2 | BUILD(构建者) |
| 3 | SERVICE(服务账户) |
| 5 | SUPPORT(支持) |
| 6 | SCHEDULER(调度员) |
Command Reference
命令参考
AUTH - Authentication
AUTH - 身份验证
bash
undefinedbash
undefinedLogin with password
使用密码登录
prelude auth login -p "password"
prelude auth login -p "password"
Login with temporary password (first login), sets new password
使用临时密码首次登录,设置新密码
prelude auth login -p "new_password" -t "temp_password"
prelude auth login -p "new_password" -t "temp_password"
Login with SSO (opens browser for OIDC flow)
使用SSO登录(打开浏览器进行OIDC流程)
prelude auth login
prelude auth login
Refresh access tokens
刷新访问令牌
prelude auth refresh
undefinedprelude auth refresh
undefinedCONFIGURE - Keychain Setup
CONFIGURE - Keychain设置
bash
prelude configurebash
prelude configureInteractive prompts for: profile, API URL, account ID, email, OIDC provider
交互式提示:配置文件、API URL、账户ID、邮箱、OIDC提供商
undefinedundefinedIAM - Account & User Management
IAM - 账户与用户管理
bash
undefinedbash
undefinedGet account details (shows users, controls, queue, features, mode)
获取账户详细信息(显示用户、控制项、队列、功能、模式)
prelude iam account
prelude iam account
Update account settings
更新账户设置
prelude iam update-account --company "Acme Corp"
prelude iam update-account --mode AUTOPILOT # MANUAL, FROZEN, AUTOPILOT
prelude iam update-account --slug "acme"
prelude iam update-account --inactivity_timeout 90
prelude iam update-account --company "Acme Corp"
prelude iam update-account --mode AUTOPILOT # 可选值:MANUAL, FROZEN, AUTOPILOT
prelude iam update-account --slug "acme"
prelude iam update-account --inactivity_timeout 90
Invite a user
邀请用户
prelude iam invite-user -e "user@example.com" --oidc google -p ADMIN
prelude iam invite-user -e "user@example.com" --oidc google -p ADMIN
Permissions: ADMIN, EXECUTIVE, BUILD, SCHEDULER
权限选项:ADMIN, EXECUTIVE, BUILD, SCHEDULER
Create service user (for API/automation)
创建服务账户(用于API/自动化)
prelude iam create-service-user -n "CI Bot"
prelude iam create-service-user -n "CI Bot"
Returns: handle + token (save the token!)
返回:handle + 令牌(请保存令牌!)
Delete service user
删除服务账户
prelude iam delete-service-user -h "service_handle"
prelude iam delete-service-user -h "service_handle"
Update user permissions
更新用户权限
prelude iam update-account-user -e "user@example.com" -p BUILD --oidc google
prelude iam update-account-user -e "user@example.com" -p BUILD --oidc google
Remove user
移除用户
prelude iam remove-user -e "user@example.com" --oidc google
prelude iam remove-user -e "user@example.com" --oidc google
OIDC management
OIDC管理
prelude iam attach-oidc --client_id "xxx" --client_secret "xxx" --issuer google --oidc_url "https://..."
prelude iam detach-oidc
prelude iam attach-oidc --client_id "xxx" --client_secret "xxx" --issuer google --oidc_url "https://..."
prelude iam detach-oidc
Audit logs
审计日志
prelude iam logs # Last 7 days, 1000 limit
prelude iam logs -d 30 -l 500 # Last 30 days, 500 results
prelude iam logs # 最近7天,最多1000条记录
prelude iam logs -d 30 -l 500 # 最近30天,最多500条记录
Delete account (DESTRUCTIVE)
删除账户(破坏性操作)
prelude iam purge-account
prelude iam purge-account
User-level commands
用户级命令
prelude iam user accounts # List all accounts you belong to
prelude iam user update-user -n "Name" # Update your display name
prelude iam user forgot-password # Send password reset email
prelude iam user confirm-forgot-password -c "code" -p "newpass"
prelude iam user change-password # Change password (prompts for current/new)
prelude iam user purge-user # Delete your user everywhere (DESTRUCTIVE)
undefinedprelude iam user accounts # 列出你所属的所有账户
prelude iam user update-user -n "Name" # 更新你的显示名称
prelude iam user forgot-password # 发送密码重置邮件
prelude iam user confirm-forgot-password -c "code" -p "newpass"
prelude iam user change-password # 更改密码(提示输入当前/新密码)
prelude iam user purge-user # 在所有位置删除你的用户(破坏性操作)
undefinedDETECT - Endpoints, Tests, Scheduling & Activity
DETECT - 端点、测试、调度与活动
bash
undefinedbash
undefined--- Endpoints ---
--- 端点 ---
prelude detect endpoints # List endpoints (default: active in last 90 days)
prelude detect endpoints -d 30 # Active in last 30 days
prelude detect create-endpoint -h "hostname" -s "serial123" -r "<account_id>/<service_token>"
prelude detect create-endpoint -h "hostname" -s "serial123" -r "<account_id>/<service_token>" -t "tag1,tag2"
prelude detect update-endpoint <endpoint_id> -t "new_tag1,new_tag2"
prelude detect delete-endpoint <endpoint_id>
prelude detect endpoints # 列出端点(默认:最近90天内活跃的端点)
prelude detect endpoints -d 30 # 最近30天内活跃的端点
prelude detect create-endpoint -h "hostname" -s "serial123" -r "<account_id>/<service_token>"
prelude detect create-endpoint -h "hostname" -s "serial123" -r "<account_id>/<service_token>" -t "tag1,tag2"
prelude detect update-endpoint <endpoint_id> -t "new_tag1,new_tag2"
prelude detect delete-endpoint <endpoint_id>
--- Tests ---
--- 测试 ---
prelude detect tests # List all security tests
prelude detect tests --techniques "T1059,T1053" # Filter by MITRE techniques
prelude detect test <test_id> # Get test details + attachments
prelude detect download <test_id> # Download test files locally
prelude detect clone # Download ALL tests locally
prelude detect tests # 列出所有安全测试
prelude detect tests --techniques "T1059,T1053" # 按MITRE技术过滤
prelude detect test <test_id> # 获取测试详情 + 附件
prelude detect download <test_id> # 下载测试文件到本地
prelude detect clone # 下载所有测试到本地
--- Threats ---
--- 威胁 ---
prelude detect threats # List all threats
prelude detect threat <threat_id> # Get threat details
prelude detect threats # 列出所有威胁
prelude detect threat <threat_id> # 获取威胁详情
--- Techniques ---
--- 技术 ---
prelude detect techniques # List all MITRE ATT&CK techniques
prelude detect techniques # 列出所有MITRE ATT&CK技术
--- Detections ---
--- 检测规则 ---
prelude detect detections # List all detection rules
prelude detect detection <detection_id> # Get detection details
prelude detect detection <detection_id> -o rule.yaml # Export Sigma rule to file
prelude detect detections # 列出所有检测规则
prelude detect detection <detection_id> # 获取检测规则详情
prelude detect detection <detection_id> -o rule.yaml # 导出Sigma规则到文件
--- Threat Hunts ---
--- 威胁狩猎 ---
prelude detect threat-hunts # List all threat hunts
prelude detect threat-hunts --tests "test1,test2" # Filter by tests
prelude detect threat-hunt <hunt_id> # Get hunt details
prelude detect do-threat-hunt <hunt_id> # Execute a threat hunt query
prelude detect threat-hunts # 列出所有威胁狩猎任务
prelude detect threat-hunts --tests "test1,test2" # 按测试过滤
prelude detect threat-hunt <hunt_id> # 获取威胁狩猎任务详情
prelude detect do-threat-hunt <hunt_id> # 执行威胁狩猎查询
--- Scheduling ---
--- 调度 ---
prelude detect queue # Show active test queue
prelude detect schedule <id> -t TEST # Schedule test (daily)
prelude detect schedule <id> -t TEST -r WEEKLY # Schedule weekly
prelude detect schedule <id> -t TEST -r SMART --tags "prod" # Smart schedule for tagged endpoints
prelude detect schedule <id> -t THREAT -r DAILY # Schedule a threat
prelude detect unschedule <id> -t TEST # Remove from queue
prelude detect unschedule <id> -t THREAT --tags "prod" # Remove for specific tags
prelude detect queue # 显示活跃测试队列
prelude detect schedule <id> -t TEST # 调度测试(每日)
prelude detect schedule <id> -t TEST -r WEEKLY # 调度测试(每周)
prelude detect schedule <id> -t TEST -r SMART --tags "prod" # 为带标签的端点智能调度
prelude detect schedule <id> -t THREAT -r DAILY # 调度威胁(每日)
prelude detect unschedule <id> -t TEST # 从队列中移除
prelude detect unschedule <id> -t THREAT --tags "prod" # 移除特定标签的任务
--- Activity & Reporting ---
--- 活动与报告 ---
prelude detect activity # Default: logs view, last 29 days
prelude detect activity # 默认:日志视图,最近29天
Views: logs, tests, threats, endpoints, techniques, findings, metrics, protected
视图选项:logs, tests, threats, endpoints, techniques, findings, metrics, protected
prelude detect activity --view tests
prelude detect activity --view endpoints
prelude detect activity --view protected
prelude detect activity --view findings
prelude detect activity --view metrics
prelude detect activity --view threats
prelude detect activity --view techniques
prelude detect activity --view tests
prelude detect activity --view endpoints
prelude detect activity --view protected
prelude detect activity --view findings
prelude detect activity --view metrics
prelude detect activity --view threats
prelude detect activity --view techniques
Filters
过滤条件
prelude detect activity --view logs --start "2024-01-01" --finish "2024-01-31"
prelude detect activity --view tests --control CROWDSTRIKE
prelude detect activity --view logs --tests "test1,test2"
prelude detect activity --view logs --threats "threat1"
prelude detect activity --view logs --endpoints "ep1,ep2"
prelude detect activity --view logs --dos "windows-x86_64"
prelude detect activity --view logs --statuses "100,101"
prelude detect activity --view logs --os "Windows 11"
prelude detect activity --view logs --policy "Default"
prelude detect activity --view protected --social # Social (cross-account) stats
prelude detect activity --view logs --start "2024-01-01" --finish "2024-01-31"
prelude detect activity --view tests --control CROWDSTRIKE
prelude detect activity --view logs --tests "test1,test2"
prelude detect activity --view logs --threats "threat1"
prelude detect activity --view logs --endpoints "ep1,ep2"
prelude detect activity --view logs --dos "windows-x86_64"
prelude detect activity --view logs --statuses "100,101"
prelude detect activity --view logs --os "Windows 11"
prelude detect activity --view logs --policy "Default"
prelude detect activity --view protected --social # 跨账户统计
Threat hunt activity
威胁狩猎活动
prelude detect threat-hunt-activity <id> -t THREAT_HUNT
prelude detect threat-hunt-activity <id> -t TEST
prelude detect threat-hunt-activity <id> -t THREAT
undefinedprelude detect threat-hunt-activity <id> -t THREAT_HUNT
prelude detect threat-hunt-activity <id> -t TEST
prelude detect threat-hunt-activity <id> -t THREAT
undefinedBUILD - Create & Manage Security Tests
BUILD - 创建与管理安全测试
bash
undefinedbash
undefined--- Tests ---
--- 测试 ---
prelude build create-test -n "My Test" --unit "go" --technique "T1059.001"
prelude build create-test -n "My Test" --unit "go" --test_id <custom_uuid>
prelude build clone-test <source_test_id>
prelude build update-test <test_id> -n "New Name"
prelude build update-test <test_id> --technique "T1059.001"
prelude build update-test <test_id> --expected_crowdstrike PREVENT # OBSERVE, DETECT, PREVENT
prelude build delete-test <test_id> # Soft delete (tombstone)
prelude build delete-test <test_id> --purge # Permanent delete
prelude build undelete-test <test_id> # Restore tombstoned test
prelude build create-test -n "My Test" --unit "go" --technique "T1059.001"
prelude build create-test -n "My Test" --unit "go" --test_id <custom_uuid>
prelude build clone-test <source_test_id>
prelude build update-test <test_id> -n "New Name"
prelude build update-test <test_id> --technique "T1059.001"
prelude build update-test <test_id> --expected_crowdstrike PREVENT # 可选值:OBSERVE, DETECT, PREVENT
prelude build delete-test <test_id> # 软删除(标记为已删除)
prelude build delete-test <test_id> --purge # 永久删除
prelude build undelete-test <test_id> # 恢复已标记删除的测试
Upload test attachment
上传测试附件
prelude build upload <test_id> -p /path/to/file.go
prelude build upload <test_id> -p /path/to/file.go --compile # Upload and compile
prelude build compile-code-file -p /path/to/file.go # Test compilation only
prelude build upload <test_id> -p /path/to/file.go
prelude build upload <test_id> -p /path/to/file.go --compile # 上传并编译
prelude build compile-code-file -p /path/to/file.go # 仅测试编译
--- Threats ---
--- 威胁 ---
prelude build create-threat <directory> # Create from directory containing test files
prelude build create-threat <directory> -n "Threat Name" --published "2024-01-01"
prelude build update-threat <threat_id> -n "Updated Name"
prelude build delete-threat <threat_id>
prelude build delete-threat <threat_id> --purge
prelude build undelete-threat <threat_id>
prelude build create-threat <directory> # 从包含测试文件的目录创建威胁
prelude build create-threat <directory> -n "Threat Name" --published "2024-01-01"
prelude build update-threat <threat_id> -n "Updated Name"
prelude build delete-threat <threat_id>
prelude build delete-threat <threat_id> --purge
prelude build undelete-threat <threat_id>
--- Detection Rules (Sigma) ---
--- 检测规则(Sigma) ---
prelude build create-detection <test_id> -r /path/to/rule.yaml
prelude build update-detection <detection_id> -r /path/to/rule.yaml
prelude build delete-detection <detection_id>
prelude build create-detection <test_id> -r /path/to/rule.yaml
prelude build update-detection <detection_id> -r /path/to/rule.yaml
prelude build delete-detection <detection_id>
--- Threat Hunt Queries ---
--- 威胁狩猎查询 ---
prelude build create-threat-hunt <test_id> --name "Hunt Name" --query "query_string" --control CROWDSTRIKE
prelude build update-threat-hunt <hunt_id> --name "New Name" --query "new_query"
prelude build delete-threat-hunt <hunt_id>
undefinedprelude build create-threat-hunt <test_id> --name "Hunt Name" --query "query_string" --control CROWDSTRIKE
prelude build update-threat-hunt <hunt_id> --name "New Name" --query "new_query"
prelude build delete-threat-hunt <hunt_id>
undefinedPARTNER - EDR & Security Partner Integration
PARTNER - EDR与安全合作伙伴集成
bash
undefinedbash
undefinedAttach a partner (connect your security tool)
附加合作伙伴(连接你的安全工具)
prelude partner attach CROWDSTRIKE -u "client_id" --secret "client_secret" --api "https://api.crowdstrike.com"
prelude partner attach DEFENDER -u "client_id" --secret "client_secret" --api "https://graph.microsoft.com"
prelude partner attach OKTA -u "api_token" --api "https://your-org.okta.com"
prelude partner attach <PARTNER> -u "user" --secret "secret" --api "url" -i "instance_id" -n "Friendly Name"
prelude partner attach CROWDSTRIKE -u "client_id" --secret "client_secret" --api "https://api.crowdstrike.com"
prelude partner attach DEFENDER -u "client_id" --secret "client_secret" --api "https://graph.microsoft.com"
prelude partner attach OKTA -u "api_token" --api "https://your-org.okta.com"
prelude partner attach <PARTNER> -u "user" --secret "secret" --api "url" -i "instance_id" -n "友好名称"
Detach partner
分离合作伙伴
prelude partner detach <PARTNER> -i "instance_id"
prelude partner detach <PARTNER> -i "instance_id"
List endpoints from a partner
列出合作伙伴的端点
prelude partner endpoints <PARTNER> --platform windows # windows, linux, darwin
prelude partner endpoints CROWDSTRIKE --platform windows --hostname "web*"
prelude partner endpoints DEFENDER --platform linux --offset 0 --count 100
prelude partner endpoints <PARTNER> --platform windows # 可选平台:windows, linux, darwin
prelude partner endpoints CROWDSTRIKE --platform windows --hostname "web*"
prelude partner endpoints DEFENDER --platform linux --offset 0 --count 100
Deploy probes to partner hosts
向合作伙伴主机部署探针
prelude partner deploy CROWDSTRIKE --host_ids "id1,id2"
prelude partner deploy CROWDSTRIKE --host_ids "id1,id2"
Block a test (deploy detection rule to partner)
阻止测试(向合作伙伴部署检测规则)
prelude partner block <test_id> -p CROWDSTRIKE
prelude partner block <test_id> -p CROWDSTRIKE
Get partner reports
获取合作伙伴报告
prelude partner reports CROWDSTRIKE -t <test_id>
prelude partner reports CROWDSTRIKE -t <test_id>
Get observed/detected statistics
获取已观察/已检测统计数据
prelude partner observed-detected
prelude partner observed-detected -t <test_id> --lookback 48
prelude partner observed-detected
prelude partner observed-detected -t <test_id> --lookback 48
List partner advisories
列出合作伙伴公告
prelude partner advisories CROWDSTRIKE
prelude partner advisories CROWDSTRIKE --start "2024-01-01" --offset 0 --limit 50
prelude partner advisories CROWDSTRIKE
prelude partner advisories CROWDSTRIKE --start "2024-01-01" --offset 0 --limit 50
List partner groups
列出合作伙伴分组
prelude partner groups <PARTNER> -i "instance_id"
undefinedprelude partner groups <PARTNER> -i "instance_id"
undefinedSCM - Security Control Monitor
SCM - 安全控制监控
bash
undefinedbash
undefined--- Query Resources (OData-powered) ---
--- 查询资源(基于OData) ---
prelude scm endpoints # List all SCM endpoints
prelude scm endpoints --odata_filter "hostname eq 'web01'"
prelude scm endpoints --odata_filter "controls/any(c: c eq 1)" # Has CrowdStrike
prelude scm endpoints --top 50 --skip 0 --order_by "hostname asc"
prelude scm users # List all SCM users
prelude scm users --odata_filter "email eq 'user@example.com'"
prelude scm inboxes # List all SCM inboxes
prelude scm network_devices # List network devices
prelude scm endpoints # 列出所有SCM端点
prelude scm endpoints --odata_filter "hostname eq 'web01'"
prelude scm endpoints --odata_filter "controls/any(c: c eq 1)" # 已集成CrowdStrike的端点
prelude scm endpoints --top 50 --skip 0 --order_by "hostname asc"
prelude scm users # 列出所有SCM用户
prelude scm users --odata_filter "email eq 'user@example.com'"
prelude scm inboxes # 列出所有SCM收件箱
prelude scm network_devices # 列出网络设备
--- Policy Evaluation ---
--- 策略评估 ---
prelude scm evaluation-summary # Summary across all partners
prelude scm evaluation CROWDSTRIKE -i "instance_id" # Detailed evaluation for partner
prelude scm technique-summary --techniques "T1059,T1053" # Policy summary per technique
prelude scm sync CROWDSTRIKE -i "instance_id" # Trigger policy sync
prelude scm evaluation-summary # 所有合作伙伴的评估摘要
prelude scm evaluation CROWDSTRIKE -i "instance_id" # 合作伙伴的详细评估
prelude scm technique-summary --techniques "T1059,T1053" # 按技术分类的策略摘要
prelude scm sync CROWDSTRIKE -i "instance_id" # 触发策略同步
--- Export ---
--- 导出 ---
prelude scm export ENDPOINT # Export endpoints CSV
prelude scm export USER # Export users CSV
prelude scm export INBOX # Export inboxes CSV
prelude scm export ENDPOINT --odata_filter "hostname eq 'web01'"
prelude scm export ENDPOINT # 导出端点为CSV
prelude scm export USER # 导出用户为CSV
prelude scm export INBOX # 导出收件箱为CSV
prelude scm export ENDPOINT --odata_filter "hostname eq 'web01'"
--- Exceptions ---
--- 例外情况 ---
Object exceptions (exclude resources from monitoring)
对象例外(将资源排除在监控之外)
prelude scm exception object list
prelude scm exception object create <CATEGORY> -f "hostname eq 'test*'" -n "Test Exception" -c "Excluding test hosts"
prelude scm exception object update <exception_id> -f "new filter" -n "Updated Name"
prelude scm exception object delete <exception_id>
prelude scm exception object list
prelude scm exception object create <CATEGORY> -f "hostname eq 'test*'" -n "测试例外" -c "排除测试主机"
prelude scm exception object update <exception_id> -f "新过滤条件" -n "更新后的名称"
prelude scm exception object delete <exception_id>
Policy exceptions (exclude specific policy settings)
策略例外(排除特定策略设置)
prelude scm exception policy list
prelude scm exception policy create <PARTNER> -i "instance_id" -p "policy_id" -s "setting1,setting2" -c "Exception reason"
prelude scm exception policy update <PARTNER> -i "instance_id" -p "policy_id" -s "setting1,setting2"
prelude scm exception policy delete <PARTNER> -i "instance_id" -p "policy_id"
prelude scm exception policy list
prelude scm exception policy create <PARTNER> -i "instance_id" -p "policy_id" -s "setting1,setting2" -c "例外原因"
prelude scm exception policy update <PARTNER> -i "instance_id" -p "policy_id" -s "setting1,setting2"
prelude scm exception policy delete <PARTNER> -i "instance_id" -p "policy_id"
--- Threats ---
--- 威胁 ---
prelude scm threat list
prelude scm threat get <threat_id>
prelude scm threat create -n "Threat Name" --techniques "T1059,T1053"
prelude scm threat delete <threat_id>
prelude scm threat list
prelude scm threat get <threat_id>
prelude scm threat create -n "威胁名称" --techniques "T1059,T1053"
prelude scm threat delete <threat_id>
--- Groups ---
--- 分组 ---
prelude scm group list <PARTNER> -i "instance_id"
prelude scm group sync <PARTNER> -i "instance_id" --group_ids "id1,id2"
prelude scm group list <PARTNER> -i "instance_id"
prelude scm group sync <PARTNER> -i "instance_id" --group_ids "id1,id2"
--- Notifications ---
--- 通知 ---
prelude scm notification list
prelude scm notification delete <notification_id>
prelude scm notification upsert <CATEGORY> -v <EVENT> -r <RUN_CODE> -s <HOUR> -e "email1,email2"
prelude scm notification list
prelude scm notification delete <notification_id>
prelude scm notification upsert <CATEGORY> -v <EVENT> -r <RUN_CODE> -s <HOUR> -e "email1,email2"
--- Reports ---
--- 报告 ---
prelude scm report list
prelude scm report get <report_id>
prelude scm report put --report_file /path/to/report.json
prelude scm report put --report_data '{"name":"Report",...}'
prelude scm report put --report_id <id> --report_file /path/to/report.json # Update
prelude scm report delete <report_id>
prelude scm report chart-data <SCM_CATEGORY> -b "group_field" -s count_desc -l 100
prelude scm report list
prelude scm report get <report_id>
prelude scm report put --report_file /path/to/report.json
prelude scm report put --report_data '{"name":"Report",...}'
prelude scm report put --report_id <id> --report_file /path/to/report.json # 更新报告
prelude scm report delete <report_id>
prelude scm report chart-data <SCM_CATEGORY> -b "group_field" -s count_desc -l 100
--- History & Notations ---
--- 历史记录与注释 ---
prelude scm history
prelude scm history --start "2024-01-01" --end "2024-06-01"
prelude scm history --odata_filter "some filter"
prelude scm notations
prelude scm history
prelude scm history --start "2024-01-01" --end "2024-06-01"
prelude scm history --odata_filter "过滤条件"
prelude scm notations
--- Threat Intel ---
--- 威胁情报 ---
prelude scm threat-intel -f /path/to/report.pdf # Parse threat intel from PDF
prelude scm from-advisory <PARTNER> --advisory_id "id" # Generate from partner advisory
undefinedprelude scm threat-intel -f /path/to/report.pdf # 从PDF解析威胁情报
prelude scm from-advisory <PARTNER> --advisory_id "id" # 从合作伙伴公告生成
undefinedGENERATE - AI-Powered Test Generation
GENERATE - AI驱动的测试生成
bash
undefinedbash
undefinedUpload threat intel PDF for automated test generation
上传威胁情报PDF以自动生成测试
prelude generate threat-intel -f /path/to/report.pdf
prelude generate threat-intel -f /path/to/report.pdf --force_ai # Force AI regeneration
prelude generate threat-intel -f /path/to/report.pdf
prelude generate threat-intel -f /path/to/report.pdf --force_ai # 强制AI重新生成
Generate from partner advisory
从合作伙伴公告生成测试
prelude generate from-advisory CROWDSTRIKE --advisory_id "CS-2024-001"
prelude generate from-advisory CROWDSTRIKE --advisory_id "CS-2024-001" --force_ai
undefinedprelude generate from-advisory CROWDSTRIKE --advisory_id "CS-2024-001"
prelude generate from-advisory CROWDSTRIKE --advisory_id "CS-2024-001" --force_ai
undefinedJOBS - Background Job Monitoring
JOBS - 后台作业监控
bash
undefinedbash
undefinedList all background jobs
列出所有后台作业
prelude jobs background-jobs
prelude jobs background-jobs
Get specific job status
获取特定作业状态
prelude jobs background-job <job_id>
Job types: UPDATE_SCM, DEPLOY_PROBE, OBSERVED_DETECTED, PRELUDE_ENDPOINT_SYNC, EXPORT_SCM, PARTNER_GROUPS
---prelude jobs background-job <job_id>
作业类型:UPDATE_SCM, DEPLOY_PROBE, OBSERVED_DETECTED, PRELUDE_ENDPOINT_SYNC, EXPORT_SCM, PARTNER_GROUPS
---Common Workflows
常见工作流
Quick Health Check
快速健康检查
bash
prelude iam account # Verify connection, see account features
prelude detect endpoints # See active endpoints
prelude detect queue # See scheduled tests
prelude detect activity --view protected # See protection statusbash
prelude iam account # 验证连接,查看账户功能
prelude detect endpoints # 查看活跃端点
prelude detect queue # 查看已调度测试
prelude detect activity --view protected # 查看防护状态Investigate Endpoint Posture
调查端点态势
bash
prelude scm endpoints --odata_filter "hostname eq 'target-host'"
prelude scm evaluation-summary
prelude scm evaluation CROWDSTRIKE -i "instance_id"bash
prelude scm endpoints --odata_filter "hostname eq 'target-host'"
prelude scm evaluation-summary
prelude scm evaluation CROWDSTRIKE -i "instance_id"Review Test Results
查看测试结果
bash
prelude detect activity --view logs --start "2024-01-01" --finish "2024-01-31"
prelude detect activity --view tests --control CROWDSTRIKE
prelude detect activity --view findingsbash
prelude detect activity --view logs --start "2024-01-01" --finish "2024-01-31"
prelude detect activity --view tests --control CROWDSTRIKE
prelude detect activity --view findingsSet Up Continuous Testing
设置持续测试
bash
prelude detect tests # Browse available tests
prelude detect schedule <test_id> -t TEST -r DAILY # Schedule daily
prelude detect queue # Verify it's queued
prelude detect activity --view logs # Check results laterbash
prelude detect tests # 浏览可用测试
prelude detect schedule <test_id> -t TEST -r DAILY # 调度每日测试
prelude detect queue # 验证是否已加入队列
prelude detect activity --view logs # 后续检查结果Partner Integration
合作伙伴集成
bash
prelude partner attach CROWDSTRIKE -u "client_id" --secret "secret" --api "https://api.crowdstrike.com"
prelude partner endpoints CROWDSTRIKE --platform windows
prelude partner deploy CROWDSTRIKE --host_ids "host1,host2"
prelude partner observed-detectedbash
prelude partner attach CROWDSTRIKE -u "client_id" --secret "secret" --api "https://api.crowdstrike.com"
prelude partner endpoints CROWDSTRIKE --platform windows
prelude partner deploy CROWDSTRIKE --host_ids "host1,host2"
prelude partner observed-detectedNaming Differences: CLI vs Platform UI
命名差异:CLI vs 平台UI
Some CLI terms differ from what appears in the web platform:
| CLI Term | Platform UI Term | Notes |
|---|---|---|
| Endpoint | Interchangeable in CLI |
| Partner / Integration | Integer codes map to partner names |
| Platform | e.g., |
| Schedule | Active test scheduling |
| Results / Reports | Test execution results |
| Monitor | Security Control Monitor |
| MITRE Technique | ATT&CK framework reference |
| Threat | Collection of related tests |
| Detection Rule | Sigma YAML rules |
| Threat Hunt | Partner-specific hunting queries |
部分CLI术语与Web平台中的术语不同:
| CLI术语 | 平台UI术语 | 说明 |
|---|---|---|
| 端点 | 在CLI中可互换使用 |
| 合作伙伴 / 集成 | 整数代码映射到合作伙伴名称 |
| 平台 | 示例: |
| 调度 | 活跃测试调度 |
| 结果 / 报告 | 测试执行结果 |
| 监控 | Security Control Monitor |
| MITRE技术 | ATT&CK框架参考 |
| 威胁 | 相关测试的集合 |
| 检测规则 | Sigma YAML规则 |
| 威胁狩猎 | 特定合作伙伴的狩猎查询 |
Error Handling
错误处理
- 401 Unauthorized: Run or
prelude auth loginprelude auth refresh - "Please make sure you are using an up-to-date profile": Run and ensure
prelude configurefield is sethandle - Python version error (unsupported): CLI requires Python 3.10+. Use
str | None/opt/homebrew/bin/prelude - Connection errors: Check URL in
hq~/.prelude/keychain.ini
- 401 Unauthorized(未授权):运行或
prelude auth loginprelude auth refresh - "Please make sure you are using an up-to-date profile":运行并确保
prelude configure字段已设置handle - Python版本错误(unsupported):CLI需要Python 3.10+,使用
str | None/opt/homebrew/bin/prelude - 连接错误:检查中的
~/.prelude/keychain.iniURLhq
Tips
提示
- Use to see human-readable names:
--resolve_enumsprelude --resolve_enums detect endpoints - Pipe JSON output to for filtering:
jqprelude detect tests 2>/dev/null | jq '.[] | .name' - The CLI outputs JSON by default - great for scripting and automation
- Service users (created via ) are ideal for CI/CD and automation
iam create-service-user - OData filters in SCM commands support complex queries: ,
contains(),eq,ne,and,or,any()all()
- 使用获取人类可读名称:
--resolve_enumsprelude --resolve_enums detect endpoints - 将JSON输出通过管道传递给进行过滤:
jqprelude detect tests 2>/dev/null | jq '.[] | .name' - CLI默认输出JSON,非常适合脚本和自动化
- 服务账户(通过创建)是CI/CD和自动化的理想选择
iam create-service-user - SCM命令中的OData过滤器支持复杂查询:,
contains(),eq,ne,and,or,any()all()