Agent Skillsphuc-nt/my-translator › ck:security-scan

ck:security-scan

GitHub

轻量级安全扫描技能,利用AI推理与Shell工具检测代码库中的硬编码密钥、依赖漏洞及OWASP安全风险。支持全量扫描或按类别筛选,自动识别项目类型并生成详细的安全报告。

.opencode/skills/security-scan/SKILL.md phuc-nt/my-translator

Trigger Scenarios

请求进行安全扫描 检查是否存在硬编码密钥 执行安全审计 重大版本发布前安全检查

Install

npx skills add phuc-nt/my-translator --skill ck:security-scan -g -y
More Options

Non-standard path

npx skills add https://github.com/phuc-nt/my-translator/tree/main/.opencode/skills/security-scan -g -y

Use without installing

npx skills use phuc-nt/my-translator@ck:security-scan

指定 Agent (Claude Code)

npx skills add phuc-nt/my-translator --skill ck:security-scan -a claude-code -g -y

安装 repo 全部 skill

npx skills add phuc-nt/my-translator --all -g -y

预览 repo 内 skill

npx skills add phuc-nt/my-translator --list

SKILL.md

Frontmatter
{
    "name": "ck:security-scan",
    "metadata": {
        "author": "claudekit",
        "version": "1.0.0"
    },
    "description": "Scan codebase for security vulnerabilities, hardcoded secrets, dependency issues, and OWASP patterns. Use when asked to 'security scan', 'check for secrets', 'audit security', or before major releases.",
    "argument-hint": "[scope] [--secrets-only] [--deps-only] [--full]"
}

Security Scan

Lightweight security scanner using Claude's reasoning + shell tools. No external dependencies required.

Usage

/ck:security-scan              # Full scan of current project
/ck:security-scan --secrets-only   # Only secret/credential detection
/ck:security-scan --deps-only      # Only dependency audit
/ck:security-scan src/api/         # Scan specific directory

Scan Categories

Category Method Speed Reference
Secrets Grep regex patterns Fast references/secret-patterns.md
Dependencies npm audit / pip audit Medium Built-in
Code patterns Grep + Claude analysis Medium references/vulnerability-patterns.md

Workflow

1. Detect Project Type

- Check for package.json → Node.js
- Check for requirements.txt / pyproject.toml → Python
- Check for go.mod → Go
- Check for Cargo.toml → Rust

2. Secret Scanning (Always runs first)

Load references/secret-patterns.md for regex patterns.

Use Grep tool to search for each pattern category:

  • API keys and tokens (AWS, GitHub, Stripe, etc.)
  • Private keys and certificates
  • Database connection strings with credentials
  • Hardcoded passwords in code

Exclude: .env.example, test fixtures, documentation, node_modules/, dist/

For each match:

  • Verify it's a real secret (not a placeholder like YOUR_API_KEY)
  • Rate severity: CRITICAL (exposed prod key), HIGH (real credential), MEDIUM (possible credential)

3. Dependency Audit (If applicable)

Run the appropriate command:

# Node.js
npm audit --json 2>/dev/null || echo '{"error":"npm audit failed"}'

# Python (if pip-audit available)
pip audit --format json 2>/dev/null || echo '{"error":"pip audit unavailable"}'

Parse output, categorize by severity (critical/high/moderate/low).

4. Code Pattern Analysis

Load references/vulnerability-patterns.md for patterns.

Use Grep tool to search for dangerous patterns:

  • SQL injection (string concatenation in queries)
  • XSS (innerHTML, dangerouslySetInnerHTML without sanitization)
  • Command injection (exec/spawn with unsanitized input)
  • Path traversal (user input in file paths)
  • Insecure randomness (Math.random for security)
  • eval() / Function() with dynamic input

For each match:

  • Read surrounding code context (5-10 lines)
  • Use Claude reasoning to determine if it's a real vulnerability or false positive
  • Rate severity and suggest fix

5. .env Exposure Check

# Check if .env files are tracked by git
git ls-files --error-unmatch .env .env.local .env.production 2>/dev/null
# Check .gitignore for .env patterns
grep -n "\.env" .gitignore 2>/dev/null

6. Generate Report

Output a markdown report directly in chat:

# Security Scan Report

**Project:** {name}
**Scanned:** {date}
**Files checked:** {count}

## Summary
| Category | Critical | High | Medium | Low |
|----------|----------|------|--------|-----|
| Secrets  | X | X | X | - |
| Deps     | X | X | X | X |
| Code     | X | X | X | - |

## Findings

### CRITICAL
1. **[SECRET]** Hardcoded AWS key in `src/config.js:42`
   - Pattern: `AKIA[0-9A-Z]{16}`
   - Fix: Move to environment variable

### HIGH
...

## Recommendations
1. ...

If --auto mode active in cook workflow: save report to {CK_REPORTS_PATH} or plans/reports/security-scan-{date}.md.

Scope Declaration

This skill handles: Secret detection, dependency auditing, common vulnerability patterns. This skill does NOT handle: Penetration testing, runtime security analysis, infrastructure security, compliance audits.

Security Policy

  • NEVER output actual secret values in reports — redact to first 4 + last 2 chars
  • NEVER execute secrets or credentials found during scanning
  • NEVER modify code automatically — only report findings with fix suggestions
  • If a real credential is found, recommend immediate rotation

Version History

  • 3495f99 Current 2026-07-25 07:20

Same Skill Collection

.opencode/skills/agent-browser/SKILL.md
.opencode/skills/ai-artist/SKILL.md
.opencode/skills/ai-multimodal/SKILL.md
.opencode/skills/ask/SKILL.md
.opencode/skills/backend-development/SKILL.md
.opencode/skills/better-auth/SKILL.md
.opencode/skills/bootstrap/SKILL.md
.opencode/skills/brainstorm/SKILL.md
.opencode/skills/chrome-devtools/SKILL.md
.opencode/skills/ck-autoresearch/SKILL.md
.opencode/skills/ck-debug/SKILL.md
.opencode/skills/ck-loop/SKILL.md
.opencode/skills/ck-plan/SKILL.md
.opencode/skills/ck-predict/SKILL.md
.opencode/skills/ck-scenario/SKILL.md
.opencode/skills/ck-security/SKILL.md
.opencode/skills/code-review/SKILL.md
.opencode/skills/coding-level/SKILL.md
.opencode/skills/context-engineering/SKILL.md
.opencode/skills/cook/SKILL.md
.opencode/skills/copywriting/SKILL.md
.opencode/skills/databases/SKILL.md
.opencode/skills/deploy/SKILL.md
.opencode/skills/devops/SKILL.md
.opencode/skills/docs-seeker/SKILL.md
.opencode/skills/docs/SKILL.md
.opencode/skills/fix/SKILL.md
.opencode/skills/frontend-design/SKILL.md
.opencode/skills/frontend-development/SKILL.md
.opencode/skills/git/SKILL.md
.opencode/skills/gkg/SKILL.md
.opencode/skills/google-adk-python/SKILL.md
.opencode/skills/journal/SKILL.md
.opencode/skills/kanban/SKILL.md
.opencode/skills/llms/SKILL.md
.opencode/skills/markdown-novel-viewer/SKILL.md
.opencode/skills/mcp-builder/SKILL.md
.opencode/skills/mcp-management/SKILL.md
.opencode/skills/media-processing/SKILL.md
.opencode/skills/mermaidjs-v11/SKILL.md
.opencode/skills/mobile-development/SKILL.md
.opencode/skills/payment-integration/SKILL.md
.opencode/skills/plans-kanban/SKILL.md
.opencode/skills/preview/SKILL.md
.opencode/skills/problem-solving/SKILL.md
.opencode/skills/project-management/SKILL.md
.opencode/skills/project-organization/SKILL.md
.opencode/skills/react-best-practices/SKILL.md
.opencode/skills/remotion/SKILL.md
.opencode/skills/repomix/SKILL.md

Metadata

Files
0
Version
3495f99
Hash
bef38e69
Indexed
2026-07-25 07:20

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 22:29
浙ICP备14020137号-1 $mapa de visitantes$