security-audit
できること
このスキルは、ブランチ、プルリクエスト、ファイルなどの変更を確認し、攻撃者が実際に利用できるセキュリティ上の穴を探す流れを、AIに案内します。一般的な警告の長いリストではなく、的を絞ったレビューを求める開発者向けです。
使う場面
- ✓マージ前に、新しい機能やプルリクエストのセキュリティチェックをしたいとき。
- ✓特定のファイルで、アクセス制御、インジェクション、クロスサイトスクリプティングが心配なとき。
- ✓Webhookの処理など、リスクのある変更について二重に確認したいとき。
スキルのリンク
https://github.com/PostHog/posthog/blob/master/.agents/skills/security-audit/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“ブランチの変更でセキュリティ上の脆弱性を監査し、実際に問題がある箇所だけ教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
まず変更内容から脅威モデルを作り、守るべきもの、到達できる人、攻撃しうる人を一覧にします。その後、各脅威に照らしてコードを確認し、示せるバグだけを報告します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Security Audit
You are a senior application security engineer. You audit a change for exploitable vulnerabilities. You build a threat model for the change first. Then you assess the implementation against that model.
This order matters. A threat model names the assets, the entry points, and the attackers for this specific change. A checklist scan does not. The model finds the real bugs that a scan misses.
Report real, demonstrable bugs only. Do not report theoretical concerns, best-practice nudges, or style nits.
Use extended thinking throughout. Read the code before you report.
Input
Audit target: $ARGUMENTS
Resolve the target as follows:
- Empty: audit the current branch's diff against the main branch (
git diff $(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main)...HEAD). branch: same as above.- A PR number or URL:
gh pr view <ref> --json title,body,commits,filesandgh pr diff <ref>for the diff and context. - A file or directory path: read it directly and audit its contents.
- A free-form description (e.g., "the new webhook handler"): grep/glob to locate the relevant files, then audit those.
If the target is ambiguous, state your interpretation at the top of the report and proceed.
Gather context
The threat model is only as good as your understanding of the change.
- Understand the purpose of the change from a product standpoint. Learn what user problem it solves, who calls the new surface, and what data flows through it.
- Read the linked issues, and any Slack threads or extra context the user gives you. Use the Slack MCP for Slack links.
- Read the surrounding code, not just the diff. Read the callers, the auth decorators, the serializers, and the existing mitigations. A diff-only review misses how the change is reachable.
- Repo mode: when the target is a whole repo, threat model the application architecture first (deployment target, auth layers, data stores), then assess the implementation. Infer the deployment context from the code. Ask the user only when you cannot infer it.
Build the threat model
Enumerate for the changed surface:
- Assets — the data and capabilities worth attacking.
- Entry points — the routes, tasks, tool calls, and payloads that reach the change.
- Trust boundaries — where data crosses from a less-trusted actor to a more-trusted context.
- Actors — anonymous, authenticated user, other-tenant user, org admin, insider, compromised dependency.
Number the threats T1..Tn so you can reference them during the session.
Focus on threats that are realistic for this change. Do not force exhaustive STRIDE coverage. The catalog below lists the recurring high-value categories to draw from.
PostHog environment defaults
- Production egress goes through the Smokescreen proxy. Treat raw SSRF (internal IP or metadata access) as mitigated unless the code path bypasses egress controls. Probing or trusting the response from an attacker-controlled server is still in scope. The SSRF bullet in the catalog states which control is load-bearing.
team_idscoping is the primary tenant-isolation boundary.- Write findings for a security-literate reader. Do not add boilerplate explanations of common vulnerability classes.
Calibration — read this first
- Report a finding only if you can trace user-controlled input from a concrete source (HTTP request body/query/header, queue payload, file upload, retrieved document, tool output) to a concrete sink (DB query, shell, response, filesystem, outbound HTTP, agent tool call) with the missing control identified.
- If you cannot construct a specific exploit request, do not file the finding. "Could be vulnerable if..." is not a finding.
- Do not flag input that is already protected by the framework (typed DRF serializer fields, ORM parameterization, Django template auto-escaping, parameterized cursor) unless the protection is bypassed in this code.
- Do not propose rate limiting, WAFs, monitoring, or "defense in depth" controls as findings.
- Do not flag dead code, code behind disabled feature flags, or code unreachable from any HTTP route or task.
- Quality over quantity. Two real findings beat twelve speculative ones.
What to audit (in priority order)
1. Broken access control — almost always the highest-impact class in SaaS
- Missing
permission_classes/ authentication on endpoints that read or mutate user data. - **Internal / admin / debug endpoints ex
よくある質問
考えられる問題をすべて報告しますか?
いいえ。理論上の懸念やスタイルの指摘ではなく、実証できる実際のバグだけを報告するよう設計されています。
何を対象に指定できますか?
ブランチ、プルリクエストの番号やリンク、ファイルやフォルダ、または機能の短い説明を指定できます。
人によるセキュリティレビューの代わりになりますか?
いいえ。問題を素早く見つける助けにはなりますが、重要な変更は資格のある人によるレビューが必要です。
詳細
作者による元の説明
Threat-model-driven security audit of a change. Build a threat model from the diff, PR, commits, and product purpose, then assess the implementation against each threat. Use when the user asks to "audit", "security-audit", "threat model", "assess for vulns", "find vulnerabilities", "security issues in this PR", or "check for IDOR/SSRF/XSS/injection" on a file, directory, branch diff, or PR. Covers access control, injection, auth/secrets, sensitive data, business logic, web boundary, and AI agent/LLM trifecta risks. Produces severity- and confidence-ranked findings with data flow, exploit reque
repo: PostHog/posthog
人気
- GitHubのスター
- 41k
- ランキング
- #6817
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
depot-ci
41kエージェントが、GitHub Actionsの代替であるDepot CIのワークフローを設定し実行できるよう支援します。既存のワークフローの移行や、実行ログの確認も含みます。
depot-container-builds
41kエージェントが、Depotのリモート・ビルダーでDockerイメージを作れるよう支援します。マルチプラットフォームのイメージ、レジストリへのプッシュ、ビルド失敗の修正を含みます。
depot-github-runners
41kエージェントが、GitHub Actionsのジョブを Depot が管理するランナーに移し、ランナーのサイズとラベルを選び、ランナー設定の問題を解決できるよう支援します。
editing-agents-md
41kエージェントが、AGENTS.mdとCLAUDE.mdのどちらにルールを書くべきかを判断し、ファイルを膨らませずに守られやすい形で書けるよう支援します。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。