Communitygithub.com

코드 보안 감사

공인된 소스 코드 보안 검토 및 Semgrep, CodeQL 패턴, 위험 API 탐지, 수정 검증을 포함한 SAST 워크플로우에 사용합니다.

코드 보안 감사란 무엇인가요?

이 스킬은 공인된 소스 코드 보안 감사와 정적 애플리케이션 보안 테스트(SAST)를 위해 설계된 AI 에이전트 스킬입니다. 주로 Semgrep, CodeQL, Bandit, gosec와 같은 도구를 활용하여 개발자가 작성한 자체 코드 로직에서 보안 취약점을 식별하고 분석합니다. 사용자는 이 스킬을 통해 화이트박스 감사, PR/차등 보안 검토, 위험 API 탐지, 인증 누락, 암호화 오용 등을 체계적으로 수행할 수 있습니다. 워크플로우는 위협 모델링 → 자동 스캔 → 수동 검증 단계로 구성되며, 최종 결과물로 발견 항목, PoC(개념 증명), 수정 권장 사항을 제공합니다. 공급망 보안 스킬과 달리 자체 코드 로직에 중점을 두며, Claude Code, Cursor, Codex 등 다양한 AI 에이전트 플랫폼에서 사용할 수 있도록 설계되었습니다. 또한, 스킬 사용 전 반드시 권한 부여 및 범위 설정을 확인해야 하며, 수동 검증 없이 스캐너 출력만을 그대로 사용하지 않도록 주의해야 합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/zhaoxuya520/reverse-skill/tree/main/skills/code-audit

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

소스 코드 보안 감사

필수 조치 (읽은 후 즉시 실행)

  1. NOW: ../field-journal/precedent-pentest.md 또는 코드 감사 권한 읽기
  2. NOW: 소스 코드/저장소 접근 확인 (소스 없는 바이너리 → RE 스킬로 전환)
  3. NOW: 언어 스택 및 범위 명확히 하기 (디렉터리/서비스/PR diff)
  4. NEXT: tool-index; semgrep 등
  5. ACT: 위협 모델링 스케치 → 자동 스캔 → 수동 검증

적용 시나리오

  • 화이트박스 감사, PR/차등 보안 검토
  • Semgrep / CodeQL / Bandit / gosec 등 SAST
  • 위험 API, 인젝션 지점, 인증 누락, 암호화 오용
  • supply-chain-security/와의 분업: 이 스킬은 자체 코드 로직에 중점, 공급망은 종속성과 파이프라인에 중점

워크플로우

1. 범위 및 위협 모델

□ 신뢰 경계: 사용자 입력, 파일, 역직렬화, SSRF, 인증 미들웨어
□ 고가치 자산: 인증, 결제, 관리자 페이지, 키 처리

2. 자동 스캔

semgrep --config auto .
# 또는 프로젝트 규칙 패키지
semgrep --config p/owasp-top-ten .

3. 수동 검증 (필수)

□ 각 SAST 적중: 접근성? 악용 가능성? 오탐?
□ 인증: IDOR/권한 상승, 검증 누락, 잘못된 멀티테넌트 격리
□ 인젝션: SQL/명령어/템플릿/LDAP
□ 암호화: 하드코딩된 키, ECB, 사용자 정의 암호화

4. 산출물

발견 항목: 위치 + 데이터 흐름 + PoC + 수정 권장 사항
선택 사항 ATT&CK / CWE 번호

도구 체인

도구언어/시나리오
Semgrep다중 언어 빠른 규칙
CodeQL깊은 데이터 흐름 (GitHub)
BanditPython
gosec / staticcheckGo
SpotBugs / FindSecBugsJava

참고 자료

  • references/sast-review-checklist.md
  • ../supply-chain-security/ ../api-security/ ../llm-security/ (Agent 코드)

라우팅 컨텍스트

상위: MASTER R26
역할: ops/role-map.md cae
하위: 종속성 취약점 → supply-chain; 런타임 검증 → pentest-tools

작업 완료 자가 점검

  • 스캐너 출력만 붙여넣지 않고 수동 검증했는가?
  • 수정 권장 사항이 포함되었는가?
  • 권한이 부여된 저장소 범위로 제한되었는가?
  • 체크리스트를 사용했는가?

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing.

apk-reverse

在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。

attack-chain

Use for authorized multi-stage attack-path planning and orchestration when a task spans reconnaissance, initial access, privilege escalation, lateral movement, or impact assessment. Route single-stage tasks directly to their specialist skill.

binary-diff

|

binary-ninja-reverse

Use for authorized binary analysis in Binary Ninja, including HLIL/MLIL/LLIL inspection, strings/imports/exports, cross-references, types, patch review, Python API automation, and optional Binary Ninja MCP or localhost HTTP integration.

browser-automation

|

browser-extension-reverse

Use for authorized reverse engineering of browser extensions (Chrome/Firefox) including manifest analysis, background workers, and extension-based credential or traffic logic recovery.

case-review

Reviews a reverse-skill case package for scope readiness, Evidence to Finding to Path traceability, work item coverage, timeline references, and optional artifact hash integrity before report handoff.

cloud-k8s

Use for authorized cloud, container, and Kubernetes security assessment including metadata SSRF, IAM misconfig, container escape paths, and cluster RBAC review.

ctf-sandbox

Thin PRIMARY for CTF / AWD / 靶场 multi-type orchestration. Hands off to the sidecar CTF-Sandbox-Orchestrator. Use when the user says CTF, AWD, 靶场, or 比赛题 and no more specific pwn/APK/IDA route already won.

database-security

Use for authorized database security assessment covering PostgreSQL/MySQL/MSSQL/Mongo/Redis exposure, authz, UDF/command paths, and misconfiguration review.

diagram-generator

generate, refine, validate, and render diagrams from natural language, notes, code snippets, schemas, tables, or existing diagram source. use for flowcharts, swimlanes, sequence diagrams, state diagrams, er diagrams, class diagrams, architecture/c4-style diagrams, dependency graphs, gantt charts, mind maps, user journeys, sankey-style flows, org charts, network graphs, and other visual models. supports mermaid by default, graphviz dot for complex graph layout, plantuml for uml-heavy engineering diagrams, and svg output when direct markup is more reliable.

digital-forensics

Use for authorized digital forensics including memory dumps, disk timelines, PCAP investigation, artifact triage, and IR evidence preservation.

docs-generator

|

dotnet-reverse

.NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp* 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy MCP。不用于纯 native 二进制(走 reverse-engineering / ida-reverse)。

edr-bypass-re

|

email-security

Use for authorized email security review including phishing analysis, header authentication (SPF/DKIM/DMARC), BEC patterns, and mailbox token abuse research.

firmware-pentest

|

ghidra-reverse

Use for free/open reverse engineering with Ghidra (headless or GUI), including decompile, cross-refs, and optional Ghidra MCP workflows when IDA is unavailable.

go-rust-reverse

Use for reverse engineering stripped Go and Rust binaries including runtime recognition, pclntab/moduel data recovery, panic strings, and idiomatic decompilation recovery.

관련 스킬