用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ForceInjection/domain-driven-design-skills --skill review-security命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Conduct deep academic research for philosophy, neuroscience, cognitive science, and theoretical computer science (computability, complexity, AI theory, logic). Use when user asks to: research academic topics, find scholarly papers, conduct literature reviews, analyze citations, synthesize research findings, explore philosophical arguments, investigate consciousness/cognition, study computability/decidability/Turing machines, or analyze academic debates. Triggers on: 'research papers', 'literature review', 'academic sources', 'scholarly articles', 'philosophy of mind', 'computability theory', 'neuroscience studies', 'find papers on', 'what does the research say'.
Create clear action plans with steps, success criteria, and risk awareness. Use before implementing features, making changes, starting projects, or anytime you need a roadmap to success. Triggers on "plan this", "how should we approach", "what's the strategy", "steps to complete", or when facing complex multi-step work.
Add keyboard navigation to a feature using CommandRegistryService. Use when implementing keyboard shortcuts, vim-style navigation, or hotkeys for a page or component.
基于 SOC 职业分类
正在显示 SKILL.md
| name | review-security |
| description | 보안 관점에서 코드를 검토합니다. OWASP Top 10, credential 노출, injection 공격 등을 체크합니다. |
코드 변경사항을 보안 관점에서 체크하는 전문 리뷰 스킬입니다.
사용자 요청에 따라 적절한 워크플로우 선택:
변경된 파일만 리뷰 (기본, 가장 일반적)
특정 파일/디렉토리 리뷰
전체 프로젝트 스캔
가장 일반적인 워크플로우입니다.
변경 파일 확인
git diff --name-only HEAD
파일 타입 필터링
.js, .ts, .py, .rb, .go, .java, .php 등.env, .yml, .json, .xml각 파일 보안 체크
리포트 생성
대상 확인
파일 읽기 및 체크
리포트 생성
프로젝트 구조 파악
find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" \) | head -50
우선순위 결정
auth*, login*, session*routes/, controllers/, api/models/, db/, database/.env*, config/순차 리뷰
종합 리포트
각 파일을 읽을 때 다음 항목들을 체크합니다.
검색 패턴:
(password|passwd|pwd|secret|token|api[_-]?key|private[_-]?key)\s*=\s*['"]\w+['"]
예시:
// ❌ Critical
const API_KEY = "sk-1234567890abcdef"
const password = "admin123"
// ✅ Good
const API_KEY = process.env.API_KEY
수정 제안:
.env 파일 + .gitignore)검색 패턴:
(execute|query|exec)\s*\([^)]*\+[^)]*\)
(execute|query|exec)\s*\([^)]*\$\{[^}]*\}[^)]*\)
예시:
// ❌ Critical - String concatenation
db.query("SELECT * FROM users WHERE id = " + userId)
db.query(`SELECT * FROM users WHERE name = '${userName}'`)
// ✅ Good - Parameterized query
db.query("SELECT * FROM users WHERE id = ?", [userId])
db.query("SELECT * FROM users WHERE name = $1", [userName])
수정 제안:
검색 패턴:
innerHTML\s*=
dangerouslySetInnerHTML
eval\(
\.html\([^)]*\+
예시:
// ❌ Critical
element.innerHTML = userInput
element.innerHTML = `<div>${data}</div>`
// ✅ Good
element.textContent = userInput
// React
<div>{data}</div> // Auto-escaped
수정 제안:
textContent 사용 (HTML이 아닌 경우)검색 패턴:
(console\.log|logger\.|print|echo)\s*\([^)]*\b(password|token|secret|key|credential)\b
예시:
// ❌ Critical
console.log("User login:", { username, password })
logger.info("API Token:", apiToken)
// ✅ Good
console.log("User login:", { username })
logger.info("API Token:", "[REDACTED]")
수정 제안:
*** 또는 [REDACTED])검색 패턴:
(app\.|router\.|@)(get|post|put|delete|patch)\s*\(['"]/
체크 사항:
auth, authenticate, requireAuth)authorize, can, checkPermission)예시:
// ❌ Critical - 인증 없음
app.get('/api/users/:id', async (req, res) => {
const user = await User.findById(req.params.id)
res.json(user)
})
// ✅ Good
app.get('/api/users/:id', authenticateJWT, async (req, res) => {
if (req.user.id !== req.params.id && !req.user.isAdmin) {
return res.status(403).json({ error: 'Forbidden' })
}
const user = await User.findById(req.params.id)
res.json(user)
})
검색 패턴:
(readFile|writeFile|open|fs\.)\s*\([^)]*\+
path\.join\([^)]*req\.(query|params|body)
예시:
// ❌ Critical
const filePath = path.join(__dirname, req.query.file)
fs.readFile(filePath) // ../../../etc/passwd
// ✅ Good
const fileName = path.basename(req.query.file) // Only filename
const filePath = path.join(__dirname, 'uploads', fileName)
if (!filePath.startsWith(path.join(__dirname, 'uploads'))) {
throw new Error('Invalid path')
}
체크 사항:
예시:
// ✅ Good
app.use(csrf())
app.post('/api/transfer', csrfProtection, handler)
// Cookie 설정
res.cookie('token', value, {
httpOnly: true,
sameSite: 'strict'
})
검색 패턴:
(multer|upload|file)\s*\(
req\.(file|files)
체크 사항:
예시:
// ❌ High
app.post('/upload', upload.single('file'), (req, res) => {
fs.writeFile(req.file.originalname, req.file.buffer)
})
// ✅ Good
const upload = multer({
limits: { fileSize: 5 * 1024 * 1024 }, // 5MB
fileFilter: (req, file, cb) => {
const allowedTypes = ['image/jpeg', 'image/png', 'application/pdf']
if (!allowedTypes.includes(file.mimetype)) {
return cb(new Error('Invalid file type'))
}
cb(null, true)
}
})
검색 패턴:
(pickle\.loads|yaml\.load|JSON\.parse|eval|unserialize)
예시:
# ❌ High
data = pickle.loads(user_input)
# ✅ Good
data = json.loads(user_input) # JSON only
# Or use safe_load for YAML
data = yaml.safe_load(user_input)
검색 패턴:
\b(md5|sha1|des)\b
예시:
// ❌ High
const hash = crypto.createHash('md5').update(password).digest('hex')
// ✅ Good
const hash = await bcrypt.hash(password, 10)
// Or
const hash = crypto.pbkdf2Sync(password, salt, 100000, 64, 'sha512')
검색 패턴:
DEBUG\s*=\s*(true|1|"true")
app\.set\(['"]env['"],\s*['"]development['"]
체크 사항:
검색 패턴:
http\.createServer
app\.listen
체크 사항:
검색 패턴:
catch.*console\.log
res\.(json|send)\(.*error\.
예시:
// ❌ Medium
catch (error) {
res.status(500).json({ error: error.stack })
}
// ✅ Good
catch (error) {
logger.error(error) // 서버 로그
res.status(500).json({ error: 'Internal server error' }) // 클라이언트
}
체크 사항:
예시:
// ✅ Good
const rateLimit = require('express-rate-limit')
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100 // limit each IP to 100 requests per windowMs
})
app.use('/api/', limiter)
체크 사항:
Access-Control-Allow-Origin: * 사용 중?체크 사항:
리뷰 완료 후 다음 형식으로 리포트 생성:
# Security Review Report
**Date:** YYYY-MM-DD
**Reviewed Files:** N files
**Issues Found:** X Critical, Y High, Z Medium, W Low
---
## Critical Issues (Immediate Action Required)
### 1. Hardcoded API Key
**File:** `src/config/api.ts:12`
**Severity:** Critical
**Description:** API key is hardcoded in source code
**Code:**
\`\`\`typescript
const API_KEY = "sk-1234567890abcdef"
\`\`\`
**Recommendation:**
- Move to environment variable
- Add `.env` to `.gitignore`
- Rotate the exposed key immediately
**Reference:** [OWASP: Use of Hard-coded Credentials](https://owasp.org/www-community/vulnerabilities/Use_of_hard-coded_password)
---
## High Issues
[...]
## Medium Issues
[...]
## Summary
- ✅ Good practices found: [list]
- ⚠️ Areas needing attention: [list]
- 📚 Recommended reading: [OWASP resources]
심각한 보안 이슈를 발견한 경우 living-docs에 기록 제안:
💡 Consider documenting this in living-docs:
- **Decision:** Why we chose X over Y for security
- **Knowledge:** Security best practices for this project
- **TODO:** Remaining security improvements
User: "보안 리뷰해줘"
Assistant:
1. git diff --name-only HEAD
2. 변경된 파일 3개 확인: auth.ts, api.ts, db.ts
3. 각 파일 Read 및 체크
4. "Security Review Report:
- Critical: 1 issue (hardcoded password in auth.ts:45)
- High: 2 issues (SQL injection in db.ts:120, CSRF missing)
- Medium: 1 issue (detailed error exposure)
즉시 수정이 필요한 Critical 이슈부터 처리하시겠습니까?"
User: "src/auth/ 디렉토리 보안 체크해줘"
Assistant:
1. Glob ~/project/src/auth/**/*.ts
2. 파일 5개 발견
3. 각 파일 보안 체크
4. 리포트 생성 및 제시
User: "프로젝트 전체 보안 스캔"
Assistant:
1. "전체 프로젝트 스캔은 시간이 걸립니다. 계속할까요?"
User: "응"
Assistant:
2. 프로젝트 구조 파악
3. 우선순위 디렉토리 결정 (auth/, api/, config/)
4. 순차 스캔
5. 종합 리포트:
"총 150개 파일 스캔 완료
- Critical: 3 issues
- High: 7 issues
- Medium: 12 issues
가장 시급한 이슈 3개부터 보여드릴까요?"
OWASP Top 10 (2021) 참조: