Communitygithub.com

code-audit

許可されたソースコードのセキュリティレビューと、Semgrep、CodeQLパターン、危険なAPIのハンティング、修正確認を含むSASTワークフローに使用します。

code-audit とは?

このスキルは、ホワイトボックス監査、PR差分のセキュリティレビュー、およびSASTツール(Semgrep、CodeQL、Bandit、gosecなど)を用いた自動スキャンを支援します。開発者が自身のコードロジックに潜む注入、認可欠如、暗号化の誤用などの脆弱性を発見し、修正提案までを一貫して行えるよう設計されています。主なワークフローは、スコープと脅威モデルの策定、自動スキャンの実行、各検出結果に対する到達可能性と悪用可能性の手動検証、そして最終的なフィンディングレポートの作成です。このスキルはサプライチェーンセキュリティとは明確に役割分担されており、あくまで自社開発コードの論理的な問題に焦点を当てます。Semgrepの多言語ルールやCodeQLの深いデータフロー解析を活用し、CWEやATT&CKに準拠したレポート出力が可能です。

対応~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差分)
  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. 成果物

Finding:位置 + データフロー + 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.

関連スキル