Security Scan

使用 AgentShield 扫描您的 Claude Code 配置(.claude/ 目录)是否存在安全漏洞、配置错误和注入风险。检查项包括 CLAUDE.md、settings.json、MCP 服务器、钩子(Hooks)以及智能体(Agent)定义。

2,037 stars 332 forksSecurity Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add xu-xiang/everything-claude-code-zh

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add xu-xiang/everything-claude-code-zh --skill security-scan
Manual install
git clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zh.git /tmp/everything-claude-code-zh
mkdir -p ~/.claude/skills
cp -r /tmp/everything-claude-code-zh/skills/security-scan ~/.claude/skills/security-scan

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 安全扫描技能 (Security Scan Skill)

使用 [AgentShield](https://github.com/affaan-m/agentshield) 审计您的 Claude Code 配置安全问题。

## 何时激活

- 设置新的 Claude Code 项目时
- 修改 `.claude/settings.json`、`CLAUDE.md` 或 MCP 配置后
- 提交配置更改前
- 加入具有现有 Claude Code 配置的新仓库时
- 定期的安全卫生检查

## 扫描对象

| 文件 | 检查项 |
|------|--------|
| `CLAUDE.md` | 硬编码密钥(Hardcoded secrets)、自动运行指令、提示词注入(Prompt injection)模式 |
| `settings.json` | 过度宽松的允许列表(Allow lists)、缺失的拒绝列表(Deny lists)、危险的绕过标志 |
| `mcp.json` | 风险 MCP 服务器、硬编码环境变量密钥、npx 供应链风险 |
| `hooks/` | 通过插值进行的命令注入、数据外泄、静默错误抑制 |
| `agents/*.md` | 未受限的工具访问、提示词注入攻击面、缺失模型规范 |

## 前置条件

必须安装 AgentShield。如果需要,请检查并安装:

```bash
# 检查是否已安装
npx ecc-agentshield --version

# 全局安装(推荐)
npm install -g ecc-agentshield

# 或通过 npx 直接运行(无需安装)
npx ecc-agentshield scan .
```

## 使用方法

### 基础扫描 (Basic Scan)

针对当前项目的 `.claude/` 目录运行:

```bash
# 扫描当前项目
npx ecc-agentshield scan

# 扫描特定路径
npx ecc-agentshield scan --path /path/to/.claude

# 使用最低严重程度过滤进行扫描
npx ecc-agentshield scan --min-severity medium
```

### 输出格式 (Output Formats)

```bash
# 终端输出(默认) — 带有评分的彩色报告
npx ecc-agentshield scan

# JSON — 用于 CI/CD 集成
npx ecc-agentshield scan --format json

# Markdown — 用于文档记录
npx ecc-agentshield scan --format markdown

# HTML — 独立包含的深色主题报告
npx ecc-agentshield scan --format html > security-report.html
```

### 自动修复 (Auto-Fix)

自动应用安全修复(仅针对标记为可自动修复的项):

```bash
npx ecc-agentshield scan --fix
```

此操作将:
- 将硬编码密钥替换为环境变量引用
- 将通配符权限收紧为具体范围的替代方案
- 绝不修改仅限手动建议的项

### Opus 4.6 深度分析 (Opus 4.6 Deep Analysis)
Read the full skill on GitHub

Details

Skill name
security-scan
Path
skills/security-scan/SKILL.md
License
MIT
Repo updated
5 March 2026

FAQ

What does the Security Scan skill do?

使用 AgentShield 扫描您的 Claude Code 配置(.claude/ 目录)是否存在安全漏洞、配置错误和注入风险。检查项包括 CLAUDE.md、settings.json、MCP 服务器、钩子(Hooks)以及智能体(Agent)定义。

How do I install the Security Scan skill?

Claude Code plugin: /plugin marketplace add xu-xiang/everything-claude-code-zh. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Security Scan popular?

It lives in xu-xiang/everything-claude-code-zh, which has 2,037 GitHub stars and 332 forks.

Related skills

Browse the most popular Claude skills, all security skills, or write your own with the skills generator.