Skill Safety Auditor
Overview
The skill-safety-auditor skill performs comprehensive security audits on skills to identify vulnerabilities, unsafe code patterns, permission issues, and compliance violations. It helps ensure skills meet security standards before release or deployment.
When to Use
- - During skill development for early issue detection
- Before releasing a new skill to production
- As part of the release approval process
- When the user asks to "audit" or "security check" a skill
- During periodic security reviews
- When reviewing third-party skills
Core Concepts
Audit Types
| Type | Description | Speed |
|---|
| INLINECODE1 | Fast surface-level check | ~1s |
| INLINECODE2 |
Comprehensive analysis | ~5-10s |
|
report | Full audit with JSON output | ~10s |
Vulnerability Categories
| Category | Checks For | Severity |
|---|
| INLINECODE4 | Hardcoded API keys, passwords, tokens | Critical |
| INLINECODE5 |
Command injection, path traversal | High |
|
permissions | Unsafe file permissions | Medium |
|
dependencies | Known vulnerable dependencies | High |
|
network | Insecure HTTP connections | Low |
Severity Levels
- - Critical: Immediate security risk, must fix before release
- High: Significant risk, strongly recommended to fix
- Medium: Moderate risk, should address
- Low: Minor issue, consider fixing
- Info: Informational, optional to address
Input
Accepts:
- - Path to skill directory
- Audit type specification
- Output format preference
- Vulnerability type filters
Output
Produces:
- - Console output with findings
- JSON audit reports
- Summary statistics
- Pass/fail status
Workflow
Quick Security Check
- 1. Run quick-scan on target skill
- Review any immediate issues
- Address critical/high findings
Comprehensive Audit
- 1. Run full audit with verbose output
- Review all findings by severity
- Generate JSON report for records
- Address findings in priority order
- Re-run audit to verify fixes
Pre-Release Audit
- 1. Audit skill with all checks enabled
- Generate formal report
- Review with team
- Fix all critical/high issues
- Document accepted low-risk items
Commands
Quick Scan
CODEBLOCK0
Full Audit
CODEBLOCK1
Generate Report
CODEBLOCK2
Filter by Type
CODEBLOCK3
List Past Audits
CODEBLOCK4
Output Format
Console Output
CODEBLOCK5
JSON Report
CODEBLOCK6
Audit Checks
Secrets Detection
- - API keys and tokens
- Database passwords
- Private keys
- Access credentials
- Environment variable patterns
Code Safety
- - eval() usage
- Function constructor
- setTimeout/setInterval with strings
- Child process execution
- Dynamic code execution
File Permissions
- - World-writable files
- Executable permissions on data files
- Sensitive file accessibility
Dependencies
- - Known CVE vulnerabilities
- Deprecated packages
- Potentially dangerous packages
Network Security
- - HTTP vs HTTPS URLs
- Insecure API endpoints
- Missing certificate validation
Quality Rules
- - Always run before releasing skills
- Fix all critical/high findings
- Document accepted risks
- Re-audit after fixes
- Keep audit history
Good Trigger Examples
- - "Audit this skill for security issues"
- "Security check before release"
- "Scan for hardcoded secrets"
- "Check for injection vulnerabilities"
- "Run security audit on skill X"
Limitations
- - Static analysis only; cannot detect runtime vulnerabilities
- May produce false positives for legitimate patterns
- Cannot verify external service security
- Does not test actual runtime behavior
- Limited to known vulnerability patterns
Resources
scripts/
- -
audit-skill.sh - Full security audit - INLINECODE10 - Fast security check
- INLINECODE11 - View audit history
- INLINECODE12 - Test skill functionality
references/
- - Security best practices
- Common vulnerability patterns
- OWASP guidelines reference
技能安全审计器
概述
skill-safety-auditor技能对技能进行全面的安全审计,以识别漏洞、不安全的代码模式、权限问题和合规性违规。它有助于确保技能在发布或部署前符合安全标准。
使用场景
- - 在技能开发过程中进行早期问题检测
- 在将新技能发布到生产环境之前
- 作为发布审批流程的一部分
- 当用户要求审计或安全检查某个技能时
- 在定期安全审查期间
- 审查第三方技能时
核心概念
审计类型
| 类型 | 描述 | 速度 |
|---|
| quick-scan | 快速表面检查 | ~1秒 |
| audit |
全面分析 | ~5-10秒 |
| report | 带JSON输出的完整审计 | ~10秒 |
漏洞类别
| 类别 | 检查内容 | 严重程度 |
|---|
| secrets | 硬编码的API密钥、密码、令牌 | 严重 |
| injection |
命令注入、路径遍历 | 高 |
| permissions | 不安全的文件权限 | 中 |
| dependencies | 已知的易受攻击依赖项 | 高 |
| network | 不安全的HTTP连接 | 低 |
严重程度级别
- - 严重: 即时安全风险,发布前必须修复
- 高: 重大风险,强烈建议修复
- 中: 中等风险,应予以处理
- 低: 次要问题,考虑修复
- 信息: 仅供参考,可选择性处理
输入
接受:
- - 技能目录路径
- 审计类型指定
- 输出格式偏好
- 漏洞类型过滤器
输出
生成:
- - 带发现结果的控制台输出
- JSON格式的审计报告
- 汇总统计信息
- 通过/失败状态
工作流程
快速安全检查
- 1. 对目标技能运行快速扫描
- 审查任何即时问题
- 处理严重/高严重性发现
全面审计
- 1. 运行带详细输出的完整审计
- 按严重程度审查所有发现
- 生成JSON报告用于记录
- 按优先级顺序处理发现
- 重新运行审计以验证修复
发布前审计
- 1. 启用所有检查项审计技能
- 生成正式报告
- 与团队一起审查
- 修复所有严重/高严重性问题
- 记录已接受的低风险项
命令
快速扫描
bash
./scripts/quick-scan.sh /path/to/skill
完整审计
bash
./scripts/audit-skill.sh /path/to/skill --verbose
生成报告
bash
./scripts/audit-skill.sh /path/to/skill --output report.json
按类型过滤
bash
./scripts/audit-skill.sh /path/to/skill --types secrets,injection
列出历史审计
bash
./scripts/list-audits.sh [--skill
] [--since 2024-01-01]
输出格式
控制台输出
🔍 开始安全审计:my-skill
================================
✅ SKILL.md 存在
正在扫描密钥...
正在扫描注入漏洞...
[高] 注入:检测到 eval()
文件:src/utils.js:15
建议:避免使用 eval(),改用更安全的方法
================================
验证完成:
错误:0
警告:1
❌ 验证失败
JSON报告
json
{
audit_id: AUDIT-20240313-001,
skill: my-skill,
timestamp: 2024-03-13T10:30:00Z,
summary: {
critical: 0,
high: 1,
medium: 2,
low: 3,
info: 1
},
findings: [
{
id: SEC-001,
severity: high,
type: injection,
file: src/utils.js,
line: 15,
description: 检测到 eval() - 潜在的代码注入,
recommendation: 避免使用 eval(),改用更安全的方法
}
],
passed: false,
recommendations: [
从 src/utils.js:15 移除 eval(),
为所有用户输入添加输入验证
]
}
审计检查项
密钥检测
- - API密钥和令牌
- 数据库密码
- 私钥
- 访问凭证
- 环境变量模式
代码安全
- - eval() 使用
- 函数构造器
- 带字符串的 setTimeout/setInterval
- 子进程执行
- 动态代码执行
文件权限
- - 全局可写文件
- 数据文件上的可执行权限
- 敏感文件的可访问性
依赖项
网络安全
- - HTTP与HTTPS URL
- 不安全的API端点
- 缺少证书验证
质量规则
- - 发布技能前始终运行
- 修复所有严重/高严重性发现
- 记录已接受的风险
- 修复后重新审计
- 保留审计历史
良好触发示例
- - 审计此技能的安全问题
- 发布前安全检查
- 扫描硬编码的密钥
- 检查注入漏洞
- 对技能X运行安全审计
局限性
- - 仅限静态分析;无法检测运行时漏洞
- 可能对合法模式产生误报
- 无法验证外部服务安全性
- 不测试实际运行时行为
- 仅限于已知的漏洞模式
资源
scripts/
- - audit-skill.sh - 完整安全审计
- quick-scan.sh - 快速安全检查
- list-audits.sh - 查看审计历史
- test.sh - 测试技能功能
references/