Skip to main content

mk-security-scan

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.

Source facts

Repository
phuc-nt/kiro-agent-kit
Last source activity
September 6, 2026 at 10:01
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
3 files

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
mk-security-scan
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.
category
utilities
keywords
["security","secrets","vulnerabilities","OWASP"]
argument-hint
[scope] [--secrets-only] [--deps-only] [--full]
metadata
{"author":"my-kit","version":"1.0.0"}
# Security Scan Lightweight security scanner using Claude's reasoning + shell tools. No external dependencies required. ## Usage ``` /mk-security-scan # Full scan of current project /mk-security-scan --secrets-only # Only secret/credential detection /mk-security-scan --deps-only # Only dependency audit /mk-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: ```bash # 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 ```bash # 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: ```markdown # 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 `{MK_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
View on GitHub