Steph-ux/appsec-guardian
GitHub: Steph-ux/appsec-guardian
一个可被任意 LLM 编码助手加载的应用安全技能包,提供静态安全扫描、DRY 审查和安全错误处理等能力,帮助开发者在编码阶段自动发现安全隐患。
Stars: 0 | Forks: 0
# AppSec Guardian
AppSec Guardian 是一个便携式的“技能”(包含指令 + 脚本 + 参考资料),任何强大的基于 LLM 的编码助手都可以加载并遵循它。它教会助手:
- 运行**粗粒度的静态安全扫描**(secrets、危险函数、详细的错误信息)
- 识别**重复代码**作为重构候选
- 强制执行**安全的错误处理**(对用户显示通用信息,在内部日志中记录详细信息)
- 将**安全逻辑保留在服务端**,与 OWASP Top 10 / ASVS 保持一致
## 包含内容
```
appsec-guardian/
├── SKILL.md # The skill the assistant loads & follows
├── README.md # This file
├── references/
│ └── security_principles.md # OWASP / ASVS / CIA reference
├── templates/
│ └── secure_error_handling.md # Copy-paste secure error patterns
└── scripts/
├── common.py # Shared file-walking helper
├── security_check.py # Static scan (text + --json output)
└── code_optimizer.py # Duplication detector
```
## 安装说明
它只是一些文件。将该文件夹放在你的助手查找技能的位置,然后要求它
加载它。以下是一些你可以复制粘贴给你的助手的**简短提示**。
**克隆它:**
```
git clone https://github.com/Steph-ux/appsec-guardian.git
```
**安装提示(任选其一):**
```
Load the skill in ./appsec-guardian/SKILL.md and follow it.
```
```
Read appsec-guardian/SKILL.md, then audit this project for security issues.
```
```
Use the AppSec Guardian skill to review my error handling and find hardcoded secrets.
```
## 用法
助手会解析你环境中的技能路径,然后运行:
```
# 安全扫描(人类可读)
python3 scripts/security_check.py /path/to/project
# 安全扫描(JSON,用于 CI)
python3 scripts/security_check.py /path/to/project --json
# 重复 / DRY 检查
python3 scripts/code_optimizer.py /path/to/project
```
发现的问题按 `HIGH` / `MEDIUM` / `LOW` 进行排名,并附带文件名 + 行号。当存在 `HIGH` 发现的问题时,`security_check.py`
将以非零状态退出 —— 这在 CI 中非常实用。
### 示例输出
```
--- AppSec Guardian Audit: ./my-app ---
[HIGH] AWS Access Key -- ./my-app/config.js:12 >> AKIA....
[MEDIUM] Account enumeration message -- ./my-app/auth.py:44 >> "User not found"
```
## 环境要求
- **Python 3.7+**(仅使用标准库 —— 无其他依赖)
- 任何能够读取 Markdown 技能并运行 shell 命令的编码助手
## 许可证
MIT —— 请参阅 [LICENSE](LICENSE)。
## 贡献
欢迎提交 Issues 和 PR。这些脚本有意保持简单;如果你添加了规则,请控制好
误报情况,并保留置信度级别的输出。
标签:AI编程助手, LLM技能, Python, SAST, 应用安全审计, 弱口令爆破, 无后门, 盲注攻击, 逆向工具, 防御加固, 静态代码扫描