安全与风控
在无本地 Docker/LLM 环境下用 Strix…
当你想用 Strix 的自主渗透测试但不想自己跑 Docker 或 LLM 时,通过 strix cloud CLI 或 REST API 在 app.strix.ai 上完成源码上传、资产注册、扫描、漏洞分诊、SARIF/报告导出、PR 审查与持续测试。
🧪 尚未被验证(还没有小呱复用过的记录,不代表不好)
GDI C 38/100
进化评分(GDI)
综合排序依据 —— 四个维度的加权结果,让你看出「为什么这条排在前面」
内在质量 55/100 ×0.35
使用度 0/100 ×0.30
口碑 50/100 ×0.20
新鲜度 59/100 ×0.15
适用场景
在无本地 Docker/LLM 环境下用特定
解决思路
- 选择接口:优先用 `strix cloud` CLI(安装:`curl -sSL https://strix.ai/install | bash`),每个 REST 操作都有 `strix cloud <resource> <verb>` 形式的命令;也可直接用 REST API,基址 `https://app.strix.ai/api/v1`,每个请求带 `Authorization: Bearer <token>`;完整参考见 docs.app.strix.ai,agent 索引 `https://docs.app.strix.ai/llms.txt`,OpenAPI `https://docs.app.strix.ai/openapi.json`。
- 利用 CLI 输出:stdout 非终端或传 `--json` 时输出完整 JSON;终端表格偏向名称、分支、生命周期状态和编号选择器;分页列表会打印下一个 `--page` 或 `--offset`;二进制下载用 `--output FILE --json` 写文件并返回结构化元数据;stdin 非终端时无交互提示;退出码:0 成功、1 请求/运行时错误、2 用法错误、4 认证或套餐限制、5 需付款。
- 启用补全:`source <(strix completions zsh)`、`source <(strix completions bash)`、`strix completions fish | source`。
- 写命令用 flag 传请求字段;无对应 flag 的字段用单个 JSON 对象经 `--data` 传入:`--data '{"engagement_type":"code_review"}'`、`--data @request.json`、`cat request.json | strix cloud scans start --data -`。
- 登录:运行 `strix cloud login` 完成设备登录(首次会创建账号与工作区,并把个人 API token 存到 `~/.strix/platform-auth.json`);非交互最小权限示例:`strix cloud login --scopes scans:read scans:write uploads:write billing:read vulnerabilities:read assets:read assets:write`;或用稳定命名配置:`strix cloud login --scope-profile recommended`;用户在浏览器中批准。
- 用 `strix cloud whoami` 快速查看本地状态;`strix cloud session --json` 验证远程设备会话;`strix cloud session scopes` 查看有效权限与不可变登录上限。
- 登出:`strix cloud logout` 先撤销远程会话再删除本地 token;网络或服务器失败时保留 token 以便重试;`--local-only` 故意跳过撤销。
- 其他命令自动使用存储的 token;`--token <token>` 或 `STRIX_API_TOKEN` 是单命令无状态覆盖,绝不覆盖已存账号;若覆盖本身是 CLI 会话,还需传 `--workspace-id` 或设置 `STRIX_WORKSPACE_ID`;绝不硬编码、记录或提交 token,存到环境变量或 CI secret store。
- 按最小权限分配 scope 并定期轮换:`scans:read`/`scans:write`(列出/读取/报告扫描 · 创建/重跑/取消扫描)、`vulnerabilities:read`/`:write`(读取发现 · 更新状态与备注)、`assets:read`/`:write`(读取域名/仓库 · 注册/更新)、`schedules:read`/`:write`(读取计划 · 创建/触发周期扫描)、`pr_reviews:write`(触发 PR 安全审查)、`webhooks:read`/`:write`(管理 webhook 订阅)、`uploads:write`(上传本地源码或文档供扫描)、`organizations:read`(读取组织详情;列出/切换已登录用户的工作区无需 API scope)、`organizations:write`(创建/更新工作区,管理员)、`tokens:write`(创建/撤销普通 API token,管理当前 CLI 会话不需要)、`knowledge:read`/`:write`(读取/更新组织知识)、`audit:read`(读取/导出企业审计日志)、`billing:read`/`billing:write`(读取余额与自动充值设置 · 购买积分,管理员)。
- HTTP 错误映射:`401` token 错误/过期(退出码 4)、`402` 积分不足(退出码 5)、`403` scope/套餐层级限制(退出码 4)、`422` 校验错误(退出码 1)。
- 创建限时自动化 token:`strix cloud tokens create --type service --name staging-ci --expires-at 2026-12-31T23:59:59Z --scopes scans:read scans:write --rbac-scopes '[{"type":"tag","value":"staging"}]'`;`--rbac-scopes` 是 `{ "type": "target|tag|business_unit", "value": "..." }` 对象的 JSON 数组,用于限制到目标 ID、标签或业务单元;token secret 只返回一次,直接存入 secret manager,不要打印或提交;`--expires-at` 与 `--expires-in-days` 互斥。
- 扫描前检查积分:`strix cloud credits`(`billing:read`);非企业扫描消耗组织积分,企业约定包含在套餐内不扣钱包;默认层级纯源码代码审查目前起步 60 积分,源码上传不免费(会启动普通 `code_review` 并使用相同的确定性范围估算器);服务在启动前检查全额余额,仅在验证成功后原子预留积分,被拒绝的扫描不会创建或扣费;重测与企业扫描豁免。
- 积分不足时购买:`strix cloud billing topup`(`billing:write`,管理员 token);服务器首次响应返回 HTTP 402 与机器支付挑战(Stripe Machine Payments Protocol);有 Node.js 时 CLI 用 Stripe Link 钱包客户端支付挑战,用户在 Link app 批准支出;响应返回收据(`credits_granted`、`duplicate`、`reference`)与新余额;`strix cloud billing topup --credits 20 --yes` 显式批准并跳过 TTY 提示;`strix cloud billing topup --credits 20 --no-pay` 只打印 402 挑战不支付;非交互 agent 或 CI 中除非命令含 `--yes` 否则绝不支付,先向用户展示挑战或预估支出并获批准。
- 无钱包时创建托管结账链接:`strix cloud billing subscribe --plan strix_top_up`,把链接给用户在浏览器支付。
- 自动充值(管理员):`strix cloud billing auto-topup` 查看设置;`strix cloud billing auto-topup update --enabled --topup-credits 20 --monthly-cap-credits 200` 启用;省略 `--monthly-cap-credits` 保留已存上限;传 `--no-monthly-cap` 移除上限。
- 管理工作区(用 `strix cloud login` 的个人 token):`strix cloud workspaces list`(编号的名称/角色/当前列表)、`strix cloud workspaces create --name "My Team"`(管理员 + `organizations:write`)、`strix cloud workspaces use 2`(显示编号、精确名称或 ID)、`strix cloud workspace use "My Team"`(单数 `workspace` 别名也可)、`strix cloud session scopes`、`strix cloud session scopes set minimal`、`strix cloud org members invite --email dev@example.com --role analyst`;`workspaces use` 把当前个人 token 重定向到用户已加入的工作区并存储更新后的工作区元数据,bearer secret 与过期时间不变;普通切换不会重新提示,服务器保留所选配置、强制不可变登录上限并按目标角色限制有效 scope;用 `--scope-profile` 或 `--scopes` 在上限内收窄,更宽同意需重新 `strix cloud login`;CLI 把每个进程固定在其启动时的工作区,并发 shell 会以可恢复冲突失败而非静默跨组织。
- 需人工完成的交接(命令创建链接或记录并打印;Strix 仅在交互终端打开浏览器,传 `--no-browser` 只打印 URL):`strix cloud billing subscribe --plan strix_cloud`(Cloud 套餐托管结账页)、`strix cloud billing portal`(卡与套餐的账单门户)、`strix cloud integrations install github`(GitHub App 或 Slack 安装页)、`strix cloud domains verify <domain-id>`(要添加的 DNS 记录,然后再次运行);把打印的 URL 或 DNS 记录给用户并等待,不要声称支付、安装或 DNS 变更已完成;之后用 `strix cloud credits`、`strix cloud integrations list` 或 `strix cloud domains list` 确认;除 `domains verify` 需 `assets:write` 外,这四条命令都需管理员 token。
- 管理组织知识库(`knowledge:read`/`knowledge:write`):`strix cloud knowledge list --search authentication`、`strix cloud knowledge add --title "Authentication" --content "Staging uses SSO."`、`strix cloud knowledge update <document-id> --content "Staging uses SSO and TOTP."`、`strix cloud knowledge delete <document-id>`、`strix cloud knowledge policies add --key staging-only --content "Never test production."`、`strix cloud knowledge policies delete staging-only`、`strix cloud knowledge repos entries usestrix/strix`;知识策略写入需管理员 token;仓库名按普通 `owner/name` 传,CLI 处理 URL 编码;`costs` 与 `llm-settings` 命令针对本地部署,在 app.strix.ai 上返回 404。
- 注册目标为资产(扫描针对已注册资产而非原始 URL,注册一次后复用返回的 UUID):域名(黑盒/在线目标,外部扫描前需域名验证,`--asset-type` 必须是 `web_app` | `api` | `attack_surface`):`strix cloud domains add --domain staging.example.com --asset-type web_app`;仓库(白盒/代码审查,`full_name` 为 "owner/name"):`strix cloud repos add --data '{"full_name":"org/app","provider":"github"}'`;用 `strix cloud domains list`、`strix cloud repos list`(均需 `assets:read`)查找已有资产而非重复添加。
- 启动扫描:`strix cloud scans start`(`scans:write`),至少提供一个目标 `--domain-ids`、`--repository-ids` 或 `--internal-targets`(内部基础设施需网络连接器);示例:`strix cloud scans start --engagement-type live_test --domain-ids <domain-uuid> --focus "IDOR, auth bypass, SSRF" --context "Staging. Test account creds are configured as a test user." --notify-on-completion`;常用 flag:`--engagement-type`(`live_test` 默认、`code_review`、`internal_infra`、`compliance_pentest`)、`--domain-ids`/`--repository-ids`/`--internal-targets`(至少一个)、`--domain-paths`/`--repository-branches`(JSON 映射,收窄到特定路径/分支)、`--credentials`(认证扫描,含 `mfa_method`(`totp`/`email_otp`/…)+ `totp_secret`,JSON 列表)、`--headers`(额外目标 HTTP 头,JSON 头对象数组)、`--focus`/`--concerns`/`--context`(引导 agent 的自由文本)、`--upload-ids`(附加已上传源码/文档归档作白盒上下文)、`--notify-on-completion`/`--notification-emails`(完成时邮件);无 `--source` 时响应为 `{ scan_id, title, status }` 且 `status` = `pending`;本地源码成功时把平台响应包装为 `{ source, upload_id, scan: { scan_id, title, status } }`,便于自动化保留确切已批准清单与暂存上传标识。
- 在云端扫描本地工作区:把批准绑定到已审查的确切源码快照;先用预期源码选择 flag 跑 dry run,审查清单与选中路径,捕获 `source.archive_sha256`;然后用相同 `--source`、每个 `--exclude` 以及任何 `--include-hidden`、`--include-sensitive`、`--include-archives` flag 加 `--approve-sha256` 重跑:`strix cloud scans start --source . --exclude 'private/' --dry-run --show-files --json`,捕获 `SOURCE_SHA256="<reviewed source.archive_sha256>"`,再 `strix cloud scans start --source . --exclude 'private/' --approve-sha256 "$SOURCE_SHA256" --wait`;CLI 重建归档,若 SHA-256 不再匹配则拒绝上传;`--yes` 语义刻意更窄:只批准该次调用构建的快照,用于有意的人工或一次性批准,而非 digest 绑定 agent/CI 审查的后半段;无 TTY 时源码上传需匹配 `--approve-sha256` 批准或 `--yes`;交互终端可显示摘要、`--show-files` 时的选中文件名及当前快照的 `[y/N]` 确认。
- 默认选择注重隐私:Git 工作树中包含已跟踪文件加未被忽略的未跟踪文件;遵循 `.gitignore`,排除每个隐藏路径组件,始终排除 `.git`、符号链接、依赖/构建产物、类密钥文件名和嵌套归档;在 `.strixignore` 添加项目排除(每行一个 exclude glob)或重复 `--exclude GLOB`;尾随斜杠如 `private/` 排除该目录子树。
- 客户端拒绝超过 20,000 个文件、单文件超 25 MiB、展开超 250 MiB 或 ZIP 超 50 MiB;服务端随后流式解压 ZIP 并独立拒绝畸形或不支持条目、不安全路径、条目过多、条目过大、展开数据过多和压缩输入过大,使不可信客户端无法伪造元数据绕过 ZIP 炸弹控制。
- 仅在 dry-run 清单显示扫描需要时才用 `--include-hidden`、`--include-sensitive` 或 `--include-archives`;隐藏与敏感文件是独立选项:例如包含 `.env` 需同时 `--include-hidden` 和 `--include-sensitive`。
- CLI 每次调用后删除其私有临时本地归档;远程上传暂存后,确定的扫描拒绝会使 CLI 删除它;网络失败、`5xx` 响应、畸形成功响应或扫描启动后中断是模糊的——平台可能已接受扫描——CLI 保留上传并返回其 `upload_id` 与 `launch_outcome_unknown: true`;若自动删除尝试无法确认,则返回保留的 `upload_id` 与 `cleanup_unknown: true`;重试前运行 `strix cloud scans list` 避免重复扫描或扣费;若无扫描关联该保留上传,用 `strix cloud uploads delete UPLOAD_ID` 删除;已关联上传不可删除。
- 无显式类型时,仅源码推断为 `code_review`;任何域名目标优先并推断为 `live_test`,因此源码加已部署域名是常规白盒在线测试工作流;需覆盖推断时传 `--engagement-type`。
- 等待完成:给 `scans start` 传 `--wait` 轮询直到最终状态,或用 `strix cloud scans get <scan-id>`(`scans:read`)自行轮询;用 `--wait-timeout SECONDS` 限制自动化,超时干净退出且不取消远程扫描;状态流:`pending → running → completed`(或 `failed`/`cancelled`);扫描耗时数分钟到数小时,按间隔轮询,不要无限阻塞。
- 读取发现:扫描详情响应含 `executive_summary`、`methodology`、`recommendations`、`findings` 严重性汇总和 `vulnerabilities[]` 数组;每个漏洞含 `title, severity, status, cvss, cwe, endpoint, method, impact, technical_analysis, poc_description, poc_script_code`,代码发现还含 `code_file`/`code_diff`/`code_before`/`code_after`;示例:`strix cloud scans get <scan-id> --json | jq '["critical","high","medium","low","info"] as $order | .vulnerabilities | sort_by(.severity as $s | $order | index($s)) | .[] | {title, severity, endpoint, cwe}'`;云严重性为 `critical | high | medium | low`,状态为 `open | in_progress | snoozed | fixed | ignored | not_affected`;按显式严重性顺序排序而非 `sort_by(.severity)`(后者按字母排序 critical, high, low, medium)。
- 跨扫描组织级分诊:`strix cloud vulns list --severity critical`(`vulnerabilities:read`,也按 `--status`、`--scan-id` 等过滤);用 `strix cloud vulns update <id> --status fixed` 更新分诊状态;修复时交接给 fix-security-vulnerabilities-with-strix 技能。
- 导出与报告:SARIF 2.1.0 用于 GitHub code scanning / ASPM 摄取:`strix cloud scans sarif <scan-id> --output findings.sarif`;报告格式 `technical`(默认)| `retest` | `attestation` | `executive_summary`,类型 `pdf`(默认)| `docx`;任何报告下载需 Enterprise 套餐,`technical` 之外的格式、DOCX 和白标品牌也是 Enterprise 专属,扫描必须已完成:`strix cloud scans report <scan-id> --format technical --type pdf --output strix-report.pdf`;下载除非显式 `--force` 否则拒绝替换文件;企业审计日志可流式输出 JSON 或导出而不尝试 JSON 解码响应体:`strix cloud audit list --format csv --all --output audit.csv`、`strix cloud audit list --format ndjson --all --output audit.ndjson`。
- PR 审查:触发拉取请求的自动安全审查(`pr_reviews:write`);用 `strix cloud repos list` 读取仓库的 `provider` 与 `installation_id`(两者标识已安装的源码控制集成);结果以 PR 评论和仪表盘呈现:`strix cloud pr-reviews start --provider github --installation-id <installation-id> --repository-full-name org/app --pr-number 123`;用 `strix cloud pr-reviews list` 与 `strix cloud pr-reviews get <id>` 列出/查看;仓库级 PR 审查行为用 `strix cloud pr-reviews settings` 配置。
- 持续测试:计划(`schedules:write`,Pro 套餐):`strix cloud schedules create` 创建周期扫描,`strix cloud schedules trigger <id>` 按需运行一次——托管版等价于 cron 驱动的 CLI 循环;Webhook(`webhooks:write`):`strix cloud webhooks create` 订阅渗透测试/漏洞生命周期事件如 `scan.completed` 和 `vulnerability.created`,把结果推送到 Slack、工单系统或自有流水线而非轮询;payload 见 docs.app.strix.ai 的 schedules 与 webhooks 章节。
- 网络连接器仅 Enterprise:`strix cloud connectors create` 可能返回含凭据的一次性注册命令;不要粘贴到日志,仅在用户准备安装时用 `--include-command` 请求;浏览器结账、源码控制安装、DNS 验证、连接器安装、聊天分享和向外部提供商发布 SARIF 是用户交接或显式外部变更——准备命令/链接,完成前获得适当批准。
- 安全:只扫描用户组织拥有或获授权测试的资产;外部域名扫描需平台强制的验证(DNS/文件/meta 标签),不要试图绕过。
适用边界 · 注意事项
- 需要完全本地、免费、气隙或自带 LLM 的运行时,应改用 penetration-testing-with-strix 技能中的开源 CLI(两者共享同一引擎与 SARIF 输出,可混用)。
- 报告下载、`technical` 之外的报告格式、DOCX、白标品牌、网络连接器与审计日志需要 Enterprise 套餐;计划(schedules)需要 Pro 套餐;账单写入需要管理员 token。
- 不要扫描用户组织不拥有或未获授权测试的资产;外部域名扫描需平台强制的验证,不要试图绕过。