Agent Skills › lobehub/lobehub › desktop-security-update

desktop-security-update

GitHub

通过GitHub工作流检查和执行桌面客户端的安全策略更新,包括漏洞标记、撤销及强制安全升级,支持多版本通道。

.agents/skills/desktop-security-update/SKILL.md lobehub/lobehub

Trigger Scenarios

需要检查或标记桌面客户端安全漏洞 需要撤销现有的安全限制 需要发布强制安全更新

Install

npx skills add lobehub/lobehub --skill desktop-security-update -g -y
More Options

Non-standard path

npx skills add https://github.com/lobehub/lobehub/tree/canary/.agents/skills/desktop-security-update -g -y

Use without installing

npx skills use lobehub/lobehub@desktop-security-update

指定 Agent (Claude Code)

npx skills add lobehub/lobehub --skill desktop-security-update -a claude-code -g -y

安装 repo 全部 skill

npx skills add lobehub/lobehub --all -g -y

预览 repo 内 skill

npx skills add lobehub/lobehub --list

SKILL.md

Frontmatter
{
    "name": "desktop-security-update",
    "description": "Inspect, mark, or revoke vulnerable LobeHub Desktop versions through the existing release workflow and signed R2 security policy. Use for forced security updates across Stable, Canary, Beta, and Nightly."
}

Desktop security updates

Operate .github/workflows/release-desktop-core-ota.yml using its security_policy input. This selects only the policy job; it does not build or publish Core. The policy is global across channels at <UPDATE_SERVER_URL base>/security-policy.json in the existing update bucket.

Read the policy contract for client behavior and delivery limitations. The deterministic operator is apps/desktop/scripts/desktopSecurityPolicy.mjs; it shares schema/signature validation with the client. Do not hand-sign JSON, fetch signing secrets locally, replace the whole rule set, or add a workflow.

Resolve the request

For a mark, determine the installer build channel, platforms, shell or core target, affected npm SemVer range, fixed full-installer version, and reason. An exact version is a valid range. Do not guess the affected scope from the latest release. If scope is ambiguous, inspect the current policy while asking only for the missing scope. Publish the fixed installer first: the operator checks the public feed and installer availability for every requested platform, including both macOS architectures. Beta uses the Canary installer feed.

A concrete user instruction to mark or revoke a specified scope authorizes that operation. If the user only asks to investigate or prepare, stop after inspection/preview. Do not invent a security restriction while implementing or testing this tooling. Never automatically weaken a range or minimum to make a failed preflight pass.

Inspect, preview, apply

  1. Resolve the actual repository with gh repo view --json nameWithOwner. Use the trusted canary branch after this workflow change is merged. Check that the remote workflow at the selected ref contains security_policy before dispatching; an older workflow could otherwise run an ordinary Core release. Do not dispatch unreviewed code with production signing secrets.
  2. Dispatch {"action":"inspect"}. Read the downloaded report, including storage revision, rule IDs, publicRevision, and publicError. Initial absence is revision 0. If an existing policy differs from the public endpoint, resolve that discrepancy before a mutation.
  3. Prepare one mark or revoke request with the inspected expectedRevision, a concise reason, and apply:false. Dispatch it and show the concrete before/after rules and installer checks. A preview performs no writes and uses no private key.
  4. If the requested concrete mutation is authorized, dispatch the same request with apply:true. If it is not authorized, ask for approval of this prepared change. An earlier explicit mark/revoke instruction is sufficient; do not ask again.
  5. Read the report and the exact workflow run. Success requires status: verified, with the public URL serving the exact signed policy just written. Report the new revision, affected scope (or revoked rule), and run URL. no-change means no publication occurred.

Mark example (replace the illustrative values with the user's scope):

{
  "action": "mark",
  "apply": false,
  "expectedRevision": 7,
  "reason": "Security fix in the full installer",
  "rule": {
    "channel": "stable",
    "platforms": ["darwin", "win32", "linux"],
    "target": "shell",
    "affectedVersions": ">=2.2.0 <2.2.20",
    "minimumInstallerVersion": "2.2.20"
  }
}

Revoke request: {"action":"revoke","expectedRevision":8,"apply":false,"reason":"Restriction withdrawn","ruleId":"<64-character ID from inspect>"}. Revocation publishes a newer signed revision; never delete the policy or restore an older revision. Marking the same scope updates its minimum; changing its scope creates another rule, so revoke the old rule separately when that is intended.

Dispatch and collect evidence

Write JSON to a temporary file. Pass it with gh workflow run --json via stdin; never interpolate user text into shell commands. Use a fresh UUID as security_policy_request_id for each dispatch. The workflow title includes it, so unrelated concurrent runs cannot be mistaken for this operation.

POLICY_REQUEST_ID=$(uuidgen)
jq --arg id "$POLICY_REQUEST_ID" \
  '{channel:"canary",security_policy:tojson,security_policy_request_id:$id}' \
  /tmp/security-policy-request.json > /tmp/security-policy-dispatch.json
gh workflow run release-desktop-core-ota.yml --repo "$POLICY_REPO" --ref canary \
  --json < /tmp/security-policy-dispatch.json

Here channel:canary satisfies the existing workflow input; the policy request determines the actual affected channels. Locate the run by exact displayTitle == "Desktop security policy (<UUID>)", event == workflow_dispatch, and headBranch == canary using gh run list --workflow release-desktop-core-ota.yml --repo "$POLICY_REPO" --json databaseId,displayTitle,event,headBranch,headSha,url,status,conclusion. Poll for at most two minutes to locate it; do not redispatch just because run discovery is delayed. Watch that run and download desktop-security-policy-<run-id> using gh run download <run-id> --repo "$POLICY_REPO" --name ... --dir <unique-temp-directory>. Inspect logs if no report was produced.

The publisher checks expectedRevision, preserves unrelated rules, signs in Actions, archives the signed revision, conditionally replaces the R2 object using its ETag, and verifies the ordinary public URL. R2 credentials and the OTA signing pair reuse existing workflow secrets.

On a revision/precondition conflict, stop that mutation and inspect again; do not blindly rerun a stale request. On published-unverified, the write already succeeded: inspect storage and public delivery, investigate caching, and do not bump revision just to retry. Ambiguous network failures after a write also require inspection. Keep reports/logs as evidence, but never treat a green job, archived object, or preview as proof that clients can fetch the new policy.

Version History

  • aace12f Current 2026-10-20 06:05

Same Skill Collection

.agents/skills/add-model-provider/SKILL.md
.agents/skills/add-provider-doc/SKILL.md
.agents/skills/add-setting-env/SKILL.md
.agents/skills/agent-runtime-hooks/SKILL.md
.agents/skills/agent-signal/SKILL.md
.agents/skills/agent-testing-bot/SKILL.md
.agents/skills/agent-tracing/SKILL.md
.agents/skills/agent-work/SKILL.md
.agents/skills/alint-ruleset/SKILL.md
.agents/skills/builtin-tool/SKILL.md
.agents/skills/chat-sdk/SKILL.md
.agents/skills/cleanup-git-worktrees/SKILL.md
.agents/skills/cli/SKILL.md
.agents/skills/compose-atoms/SKILL.md
.agents/skills/data-fetching-architecture/SKILL.md
.agents/skills/db-migrations/SKILL.md
.agents/skills/debug-frontend-with-browser/SKILL.md
.agents/skills/debug-package/SKILL.md
.agents/skills/deep-review/SKILL.md
.agents/skills/design-prototype/SKILL.md
.agents/skills/desktop/SKILL.md
.agents/skills/docs-changelog/SKILL.md
.agents/skills/drizzle/SKILL.md
.agents/skills/full-text-search/SKILL.md
.agents/skills/heterogeneous-agent/SKILL.md
.agents/skills/hotkey/SKILL.md
.agents/skills/i18n/SKILL.md
.agents/skills/linear/SKILL.md
.agents/skills/llm-generation/SKILL.md
.agents/skills/modal/SKILL.md
.agents/skills/model-bank-metadata/SKILL.md
.agents/skills/product-design/SKILL.md
.agents/skills/project-overview/SKILL.md
.agents/skills/react/SKILL.md
.agents/skills/response-compliance/SKILL.md
.agents/skills/run-eval-harbor/SKILL.md
.agents/skills/skills-audit/SKILL.md
.agents/skills/source-layout/SKILL.md
.agents/skills/spa-routes/SKILL.md
.agents/skills/split-large-file/SKILL.md
.agents/skills/split-micro-app/SKILL.md
.agents/skills/store-data-structures/SKILL.md
.agents/skills/testing-heterogeneous-agents/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/trpc-router/SKILL.md
.agents/skills/typescript/SKILL.md
.agents/skills/upstash-workflow/SKILL.md
.agents/skills/ux-audit/SKILL.md
.agents/skills/ux/SKILL.md

Metadata

Files
0
Version
aace12f
Hash
5ae6a613
Indexed
2026-10-20 06:05

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-24 15:05
浙ICP备14020137号-1