mcpField
C
cyber-audit

cyber-audit

github.com/davidondrej安全4.2k112 次安装今天更新
代码仓库

关于 cyber-audit

cyber-audit 是根据安全公告检查系统的只读技能。它选择相关检查,将具体结果写入带日期的 Markdown 报告,并给出结论;除审计目录外不修改文件。

主要功能

  1. 01识别公告涉及范围
  2. 02并行执行相关检查
  3. 03以表格记录具体结果
  4. 04生成带日期的 Markdown 报告
  5. 05给出结论及缓解情况

适用场景

  1. 01检查系统是否受安全公告影响
  2. 02审计已安装的软件包和二进制文件
  3. 03留存审计结果记录

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/davidondrej/skills --skill cyber-audit

安装后在 Claude Code 中输入/cyber-audit确认已加载。

附带文件agents/openai.yaml

详细介绍

网络安全审计

硬性规则

  • 只读。 不得安装、移除、升级、重启、发起网络调用,也不得修改 ~/Documents/security-audits/ 之外的文件。
  • 绝不使用 sudo。
  • 每次调用生成一份报告。 始终以写入 .md 文件结束(即使结论是“未受影响”也一样——审计记录很重要)。
  • 如果某项检查需要执行会改变状态的命令,跳过该检查,并在表格中注明“未检查(需要改变状态)”。不要运行该命令。

工作流

  1. 确定范围。 从安全公告中提取:软件包/二进制文件名称、受影响版本、平台(macOS/Linux/Windows)、攻击途径(供应链/RCE/本地/网络)。
  2. 并行运行检查(Bash 工具,在一条消息中发起多次调用)。根据安全公告类型选择相关检查——不要全部运行。
  3. 逐步填写表格。 每行对应一项检查及具体结果(版本号、路径、“无”或“不适用”)。
  4. 编写报告并保存到 ~/Documents/security-audits/YYYY-MM-DD-<short-kebab-slug>.md。使用环境标头中的当天日期。
  5. 告知用户一行结论及报告路径。

检查菜单(选择相关项目)

# --- Node / npm ecosystem (supply-chain advisories) ---
which npm pnpm yarn; npm root -g; pnpm root -g 2>/dev/null
ls /opt/homebrew/lib/node_modules                                  # global npm
find ~ -maxdepth 8 -type d -name "<pkg>" 2>/dev/null \
  | grep -v -E "(Library/Caches|\.Trash)"                          # installed copies
find ~/Documents ~/Desktop ~/Downloads -maxdepth 8 -type f \
  \( -name "package.json" -o -name "package-lock.json" \
     -o -name "pnpm-lock.yaml" -o -name "yarn.lock" \) 2>/dev/null \
  | xargs grep -l "<pkg>" 2>/dev/null                              # direct + transitive

# --- Python ecosystem ---
which python3 pip pipx uv
pip list 2>/dev/null | grep -i "<pkg>"
find ~/Documents -maxdepth 6 -name "requirements*.txt" -o -name "pyproject.toml" \
  -o -name "poetry.lock" -o -name "uv.lock" 2>/dev/null | xargs grep -l "<pkg>" 2>/dev/null

# --- Homebrew / system binaries ---
brew list --versions <formula> 2>/dev/null
which <binary>; <binary> --version 2>/dev/null

# --- Running processes / listeners (for RCE / network CVEs) ---
pgrep -lf "<binary>"
lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep "<port>"

# --- LaunchAgents / LaunchDaemons (persistence / autostart) ---
ls ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons 2>/dev/null \
  | grep -i "<vendor>"

# --- Env vars that change exposure (e.g. OLLAMA_HOST, listening addr) ---
launchctl getenv <VAR>; grep -r "<VAR>" ~/.zshrc ~/.zprofile ~/.config 2>/dev/null

# --- VS Code / browser extensions (for IDE-targeted advisories) ---
ls ~/.vscode/extensions 2>/dev/null | grep -i "<ext>"

如果安全公告提及上述范围之外的生态系统(Rust cargo、Go modules、Ruby gems、Docker 镜像等),采用相同模式:全局安装路径 + 清单文件 grep + 运行中的进程。

报告模板

文件:~/Documents/security-audits/YYYY-MM-DD-<short-kebab-slug>.md

# <Subject> — Audit

**Date:** YYYY-MM-DD
**Host:** the user's MacBook Pro

## <CVEs | Advisory> in scope

- **<ID or source> "<Name>"** — <one-line description>. <Affected versions or scope>.

## Audit results

| Check | Result |
|---|---|
| <Check 1> | <Result> |
| <Check 2> | <Result> |

## Verdict

**<Not affected. | Affected. | Partially affected.>**

- <Rationale bullet 1>
- <Rationale bullet 2>

## Action taken

None — diagnostic only, no files modified, no <packages installed/removed | services started/stopped | firewall rules changed>.

## Follow-ups

- <Actionable item, or "None" if truly nothing>

参照 ~/Documents/security-audits/ 中现有报告的语气——简洁、客观、使用项目符号,不含模棱两可的表述。

结论用语

  • 未受影响。 — 软件包/二进制文件不存在,或已安装但已修补,或未运行且未暴露。
  • 受影响。 — 存在易受攻击的版本,且可通过该攻击途径触达。
  • 部分受影响。 — 存在但已采取缓解措施(例如,已安装二进制文件但服务未运行,或监听器仅绑定到回环地址)。请在项目符号中说明缓解措施。

何时打破只读规则

绝不要自行打破。如果结论为“受影响”,请在后续事项中列出修复命令,然后停止。由用户执行。

参考

~/Documents/security-audits/ 中的现有报告展示了预期格式:

  • 一份长篇基线审计报告(格式不同,不要仿照)
  • 按日期命名的 YYYY-MM-DD-*.md 安全公告报告(请遵循此格式)

评论

支持 Markdown