feat: OpenMesh 基础平台与 MD/PDF 转换技能
- 后端: coworker 智能体框架, WS API, 文件上传, 附件处理 - 前端: Open WebUI, 文件全量走 upload API (含 MD/TXT/JSON 等文本类) - 技能: md-to-office (pandoc + wkhtmltopdf) - 修复: 上传文件路径丢失, Agent 搜索浪费, 输出文件跑到 uploads/ - 打包: PyInstaller one-dir, 预打包 pandoc/wkhtmltopdf/chromium
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
---
|
||||
name: secret-scan
|
||||
description: Hunt committed secrets with gitleaks and drive safe rotation
|
||||
---
|
||||
Find committed credentials and get them rotated and removed — without ever exposing them
|
||||
further yourself.
|
||||
|
||||
ABSOLUTE RULE: never print a secret's value — not in output, notes, todo items, commits,
|
||||
or PRs. Refer to every hit as "<kind> in <file>:<line> (commit <short-sha>)".
|
||||
|
||||
1. Check the tool: `gitleaks version`. If it's missing, do NOT skip this scan and do not
|
||||
stop the review — ask for it with `request_tool("gitleaks", …)`. If the user declines,
|
||||
or no pinned build exists for their platform, fall back to step 2b and say in your
|
||||
report that the sweep was manual.
|
||||
2. Scan working tree AND history — history matters most: a secret deleted in HEAD is still
|
||||
live in every clone, and it is the hit users are most surprised by.
|
||||
a. With gitleaks:
|
||||
`gitleaks detect --source . --report-format json --report-path /tmp/gitleaks.json`
|
||||
b. Without it, do the same job by hand, and say so:
|
||||
- working tree: `git grep -nIE '(api[_-]?key|secret|token|password|BEGIN [A-Z ]*PRIVATE KEY|AKIA[0-9A-Z]{16}|sk_(live|test)_[0-9a-zA-Z]{16,}|xox[baprs]-)'`
|
||||
- history, including files deleted since: `git log -p --all -S 'AKIA' --pickaxe-all`
|
||||
and `git log --diff-filter=D --name-only --pretty=format:%h -- '*.env*' '*credential*' '*secret*'`,
|
||||
then read the removed contents with `git show <sha>^:<path>`.
|
||||
- Pipe anything you read through a redactor rather than into your transcript, e.g.
|
||||
`sed -E "s/[A-Za-z0-9_\\-]{16,}/[REDACTED]/g"` — the no-printing rule still applies.
|
||||
3. Triage each hit by reading its context:
|
||||
- Real credential, test fixture, or example placeholder? Say which and why.
|
||||
- For real ones: what does it grant access to, and is it plausibly still valid?
|
||||
4. For every real secret, in this order:
|
||||
a. ROTATE first — tell the user exactly where to revoke/rotate it (the provider's
|
||||
console page or CLI command). Rotation beats removal: history rewrite without
|
||||
rotation is false comfort.
|
||||
b. Remove it from the code: move to env vars or the project's secret store, matching
|
||||
how this codebase already handles configuration.
|
||||
c. Prevent recurrence: add/extend `.gitignore` for local secret files and offer a
|
||||
`.gitleaks.toml` baseline plus a pre-commit hook.
|
||||
d. History purge (git filter-repo/BFG) is DESTRUCTIVE and rewrites shared history —
|
||||
describe the trade-off and only proceed if the user explicitly asks.
|
||||
5. Deliver: a hit list (kind · location · verdict · rotation status), the cleanup
|
||||
branch/PR, and the prevention setup you added or recommend.
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: security-fix-pr
|
||||
description: Turn triaged security findings into focused, reviewable fix PRs
|
||||
---
|
||||
Package security fixes so a busy reviewer can approve them with confidence.
|
||||
|
||||
1. One PR per theme (e.g. "parameterize SQL in the reports module"), never a mixed
|
||||
security dump. Small diffs get reviewed; big ones get postponed.
|
||||
2. Branch naming: `security/<theme>` from the repo's default branch. Follow the repo's
|
||||
existing commit-message style.
|
||||
3. Every fix commit carries its test: add or extend one that fails without the fix,
|
||||
in the repo's existing test layout and idiom. If testing a fix isn't practical,
|
||||
say so in the PR body instead of skipping silently.
|
||||
4. PR body structure (keep it tight):
|
||||
- What was wrong, in plain language, with severity and why it matters HERE (one or
|
||||
two sentences of reachability/impact, not scanner boilerplate).
|
||||
- What the fix does, and what it deliberately does not change.
|
||||
- How it was verified (test names, commands run).
|
||||
- NEVER include secret values, exploit payloads, or step-by-step attack recipes in
|
||||
a public PR — describe the class of issue instead.
|
||||
5. If the GitHub connector is available, open the PR with it; otherwise prepare the
|
||||
branch and hand the user the exact push/PR commands.
|
||||
6. Fixing is yours; MERGING is the team's. Never merge your own security PR — deliver
|
||||
it and summarize what a reviewer should scrutinize.
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: semgrep-review
|
||||
description: Run a semgrep scan and turn findings into triaged, contextual fixes
|
||||
---
|
||||
Run a static-analysis pass with semgrep and own the findings end to end.
|
||||
|
||||
1. Check the tool: `semgrep --version`. If it's missing, ask for it with
|
||||
`request_tool("semgrep", …)` rather than skipping the pass. If the user declines,
|
||||
continue with a targeted manual review — read the routes/handlers, the auth and
|
||||
session code, every query built by string concatenation, deserialization, and
|
||||
outbound requests built from user input — and say in your report that the static
|
||||
pass was manual, so the user knows the coverage is narrower than a full scan.
|
||||
Note that community semgrep rules miss whole classes (e.g. SQL built through a
|
||||
project's own DB wrapper), so reading the code is worth doing even when it runs.
|
||||
2. Scan the repo (from its root):
|
||||
`semgrep scan --config auto --json --quiet -o /tmp/semgrep.json`
|
||||
Use `--config auto` unless the repo carries its own rules (`.semgrep.yml`,
|
||||
`semgrep.yml`) — prefer the repo's own configuration when present.
|
||||
3. Parse the JSON and triage EVERY finding — do not echo the raw report:
|
||||
- Read the flagged code and enough surrounding context to judge reachability.
|
||||
- Is the tainted input attacker-controlled or internal? Is there an upstream guard?
|
||||
- Rate: critical / high / medium / low / noise, with a one-line justification each.
|
||||
4. Fix what's real, highest severity first:
|
||||
- Match the codebase's own conventions (its validation helpers, escaping utilities,
|
||||
parameterized-query style) — read neighboring code before writing the fix.
|
||||
- Add or extend a test that fails without the fix where the test harness makes that
|
||||
reasonable.
|
||||
- Group fixes by theme (one branch per theme), never one giant mixed diff.
|
||||
5. For findings you judge noise, say WHY (e.g. constant input, dead code, framework
|
||||
already escapes) — never silently drop them, and never add ignore rules to make the
|
||||
scanner quiet without agreement.
|
||||
6. Deliver: a short findings table (severity · location · verdict · action) and the
|
||||
fix branches/PRs. If the repo has no semgrep config, offer to commit a starter
|
||||
`.semgrep.yml` pinned to the rulesets that mattered here.
|
||||
Reference in New Issue
Block a user