安全审计
- 作者仓库星标 327
- 作者更新于 实时读取
- 作者仓库 harness
- 领域
- 安全
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 83 / 100 · 社区维护
- 作者 / 版本 / 许可
- @xwtro0tk1t-cloud · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。;检出高风险片段:pipe_curl_to_shell
---
name: skills-audit
description: Audit AI Agent skills for security vulnerabilities including malicious code, remote execution, c…
category: 安全
runtime: Python
---
# skills-audit 输出预览
## PART A: 任务判断
- 适用问题:安全审计、密钥扫描、权限检查或风险分析。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Task / Execution Steps / Scan Modes”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于安全审计、密钥扫描、权限检查或风险分析,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Task / Execution Steps / Scan Modes”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/skills-audit`、`/path` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Task / Execution Steps / Scan Modes”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: skills-audit
description: Audit AI Agent skills for security vulnerabilities including malicious code, remote execution, c…
category: 安全
source: xwtro0tk1t-cloud/harness
---
# skills-audit
## 什么时候使用
- 用于审阅代码、文档或方案并给出可执行反馈 适合处理安全审计、密钥扫描、权限检查和风险分析,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要额外 A…
- 面向安全审计、密钥扫描、权限检查或风险分析,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Task / Execution Steps / Scan Modes」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "skills-audit" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Task / Execution Steps / Scan Modes
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Security Audit for AI Agent Skills
You are conducting a security audit of an AI Agent skill. This skill executes a comprehensive analysis to detect malicious code, security vulnerabilities, and suspicious patterns.
Task
Audit the skill at path: $ARGUMENTS
Execution Steps
Run static security scan Execute the Python audit tool for static analysis:
# Auto-detect skills-audit installation path AUDIT_SCRIPT="" for candidate in \ ~/.claude/skills/skills-audit/skill_audit/cli_wrapper.py \ ~/.claude/skills/skill-audit/skill_audit/cli_wrapper.py \ "${SKILL_AUDIT_HOME:-}""/skill_audit/cli_wrapper.py"; do if [ -f "$candidate" ]; then AUDIT_SCRIPT="$candidate" break fi done if [ -z "$AUDIT_SCRIPT" ]; then echo "Error: Cannot find skills-audit installation" echo "Set SKILL_AUDIT_HOME environment variable to your skills-audit directory" exit 1 fi python3 "$AUDIT_SCRIPT" "$ARGUMENTS"This will:
- Extract skill artifacts (code, prompts, permissions)
- Run static pattern matching (regex-based detection)
- Check for obvious malicious patterns
- Generate initial findings
Perform AI semantic analysis (if enabled)
If the scan mode includes AI analysis (standard/deep/expert), perform deep semantic security analysis:
a. Read the skill code files from the target path
b. Analyze for security vulnerabilities:
- Remote Code Execution:
eval(),exec(),subprocess,curl | bash - Credential Leaks: Hardcoded API keys, passwords, tokens, .env files
- Data Exfiltration: Suspicious network requests, file uploads
- Prompt Injection: "Ignore previous instructions", role manipulation
- Supply Chain Risks: Obfuscated code, dynamic imports, base64 encoding
- Privilege Escalation: sudo, setuid, file permission changes
- Persistence Mechanisms: cron jobs, shell profile modifications
c. Assess each finding:
- Severity: CRITICAL / HIGH / MEDIUM / LOW
- Attack scenario: How can this be exploited?
- Impact: What damage could be done? (CIA triad)
- Remediation: How to fix it?
d. Filter false positives:
- Exclude findings from skills-audit's own detection patterns (patterns.py regex)
- Downgrade benign file operations (e.g. deleting old output before regeneration)
- Verify env var access patterns (using dotenv is recommended, not a vulnerability)
e. Output your analysis in this format:
AI SEMANTIC ANALYSIS FINDINGS: 1. [SEVERITY] Finding Title - Location: file.py:line - Pattern: describe what you found - Risk: explain the security risk - Scenario: how an attacker could exploit this - Impact: potential damage - Recommendation: how to fix 2. [SEVERITY] Finding Title ...f. Integrate AI findings into the report (CRITICAL STEP)
After completing your AI analysis, integrate your findings into the audit report by running:
# Use the detected AUDIT_SCRIPT path from step 1 INTEGRATE_SCRIPT="$(dirname "$AUDIT_SCRIPT")/integrate_ai_findings.py" python3 "$INTEGRATE_SCRIPT" \ "<report_path>" \ '<ai_findings_json>'Where:
<report_path>: The path to the JSON report file (shown in step 1 output as "Detailed report saved to: ...")<ai_findings_json>: Your AI analysis findings formatted as JSON array
JSON Format for ai_findings:
[ { "title": "Base64-Obfuscated Remote Code Execution", "severity": "CRITICAL", "category": "unsafe_execution", "description": "Base64-encoded command that downloads and executes arbitrary code", "location": "skill.md:28", "code_snippet": "echo 'L2Jpbi9iYXNoIC1jIC...' | base64 -D | bash", "risk": "Remote code execution with complete system compromise", "scenario": "User follows installation instructions, base64 decodes to malicious payload, executes with shell privileges", "impact": { "confidentiality": "CRITICAL", "integrity": "CRITICAL", "availability": "CRITICAL" }, "impact_description": "Full system compromise, data theft, ransomware deployment", "recommendation": "BLOCK this skill entirely. Never execute obfuscated commands.", "cwe_ids": ["CWE-78", "CWE-94", "CWE-506"] } ]Important:
- Convert ALL your AI analysis findings from step 2e into this JSON format
- Include severity (CRITICAL/HIGH/MEDIUM/LOW), location, code snippets, risk, scenario, impact, and recommendations
- This step MERGES your AI findings with static analysis findings and recalculates the overall risk score
- Webhook is NOT sent during this step -- it will be sent after your comprehensive analysis
- Remote Code Execution:
Send final webhook notification (optional, if notifications are configured) After completing comprehensive analysis (including false positive filtering), send the webhook:
# Auto-detect skills-audit path AUDIT_DIR="$(dirname "$(dirname "$AUDIT_SCRIPT")")" python3 -c " import sys; sys.path.insert(0, '$AUDIT_DIR') from skill_audit.integrations import send_final_webhook send_final_webhook(report_path='<report_path>') "This ensures the webhook contains the final, accurate results after your analysis.
Present comprehensive results to user
- Summarize the overall risk level and score (from integrated report)
- List key findings with severity levels
- Clearly mark any false positives that were filtered
- For critical findings, include:
- Title and severity
- Evidence location and code snippet
- Attack scenario and impact
- Remediation recommendation
- Provide the final decision recommendation
- Reference the detailed JSON report path for full analysis
If high-risk issues are found:
- Explain the security implications
- Suggest concrete remediation steps
- Recommend whether to BLOCK, REVIEW, or ALLOW the skill
- Warn about potential damage if the skill is executed
Scan Modes
Deep Mode (Default)
- Speed: ~2-5 minutes
- Coverage: Full Claude AI analysis + static patterns + deep code understanding
- Use: Recommended for all skills
- Command:
/skills-audit /path/to/skill(default) or/skills-audit /path/to/skill --mode deep - Note: Includes comprehensive AI analysis by Claude
Fast Mode
- Speed: ~1-2 seconds
- Coverage: Static pattern matching only
- Use: Quick check for obvious vulnerabilities
- Command:
/skills-audit /path/to/skill --mode fast
Standard Mode
- Speed: ~30 seconds - 2 minutes (depends on code size)
- Coverage: Claude AI semantic analysis + static patterns
- Use: Balanced speed and coverage
- Command:
/skills-audit /path/to/skill --mode standard - Note: Claude (you) will perform semantic analysis
Expert Mode
- Speed: ~5-10 minutes
- Coverage: Complete analysis with all phases
- Use: Critical security reviews
- Command:
/skills-audit /path/to/skill --mode expert - Note: Maximum depth analysis performed by Claude
Detection Capabilities
This audit detects:
- Remote Code Execution:
curl | bash,eval(),exec() - Credential Leaks: Hardcoded API keys, passwords, .env files
- Network Exfiltration: Suspicious HTTP/Socket connections
- Supply Chain Risks: Obfuscation, dynamic imports
- Prompt Injection: "Ignore previous instructions"
- System Manipulation: File deletion, permission changes
Configuration
Edit config/config.yml (relative to skills-audit installation directory) to customize:
Key Configuration Options
# Report save location
claude_code:
# Options: cwd (current directory), skill_dir (skill directory), temp (temp directory), custom
report_location: custom
custom_report_dir: ~/.claude/audit-reports
# Custom report naming
output:
report_filename: "audit-{skill_name}-{timestamp}.json"
Scan Mode Customization
scan_modes:
fast:
enable_ai_analysis: false
enable_static_analysis: true
enable_deep_analysis: false
enable_tip_check: false
standard:
enable_ai_analysis: true
enable_static_analysis: true
enable_deep_analysis: false
enable_tip_check: false
deep:
enable_ai_analysis: true
enable_static_analysis: true
enable_deep_analysis: true
enable_tip_check: true
Notes
- Default mode is deep (includes AI + Static + Deep analysis by Claude)
- For quick scans, use
--mode fast(static analysis only, 1-2 seconds) - AI analysis in standard/deep/expert modes is performed by Claude directly (no API calls)
- Reports saved to ~/.claude/audit-reports/ by default (configurable)
- Use
--modeflag to override scan mode (the--modeparameter is authoritative) - Config file location:
config/config.ymlrelative to skills-audit installation directory - Webhook is deferred until after Claude's comprehensive analysis (false positive filtering)
- skills-audit itself is excluded from scanning to avoid self-referential false positives
- Works offline: Static analysis works without internet; AI analysis uses current Claude session
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核