security-audit
Skill này làm gì
Skill này kiểm tra một thay đổi, chẳng hạn một nhánh, pull request hoặc file, để tìm lỗ hổng bảo mật mà kẻ tấn công thực sự có thể dùng. Nó dành cho lập trình viên muốn một đợt rà soát tập trung thay vì một danh sách cảnh báo chung chung dài dằng dặc.
Khi nào nên dùng
- ✓Khi bạn muốn kiểm tra bảo mật một tính năng mới hoặc pull request trước khi gộp.
- ✓Khi bạn lo ngại về kiểm soát truy cập, injection hoặc cross-site scripting trong một file cụ thể.
- ✓Khi bạn muốn xem lại một thay đổi rủi ro, chẳng hạn một trình xử lý webhook mới.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/.agents/skills/security-audit/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Rà soát các thay đổi trên nhánh của tôi để tìm lỗ hổng bảo mật, và chỉ cho tôi những vấn đề thực sự.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Trước tiên, skill xây dựng mô hình mối đe dọa từ thay đổi, liệt kê những gì cần bảo vệ, ai có thể truy cập và ai có thể tấn công. Sau đó, skill kiểm tra mã theo từng mối đe dọa và chỉ báo cáo các lỗi mà nó có thể chứng minh.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Skill có báo cáo mọi vấn đề có thể xảy ra không?
Không. Skill được thiết kế để chỉ báo cáo các lỗi thực tế, có thể chứng minh, không báo cáo những lo ngại lý thuyết hay ghi chú về phong cách.
Tôi có thể chỉ cho skill xem những gì?
Bạn có thể đưa cho nó một nhánh, số hoặc liên kết pull request, một file hoặc thư mục, hoặc mô tả ngắn về tính năng.
Skill này có thay thế được đánh giá bảo mật của con người không?
Không. Skill giúp tìm nhanh các lỗi có khả năng xảy ra, nhưng những thay đổi quan trọng vẫn cần một người có chuyên môn xem xét.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6817
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
depot-ci
41kGiúp agent của bạn thiết lập và chạy quy trình Depot CI, một lựa chọn thay thế GitHub Actions, gồm chuyển các quy trình hiện có và đọc nhật ký chạy.
depot-container-builds
41kGiúp agent của bạn build image Docker trên các builder từ xa của Depot, gồm image đa nền tảng, đẩy lên registry và sửa lỗi build.
depot-github-runners
41kGiúp agent của bạn chuyển các job GitHub Actions sang runner do Depot quản lý, chọn kích thước và nhãn runner, và xử lý lỗi thiết lập runner.
editing-agents-md
41kGiúp agent của bạn quyết định một quy tắc nên nằm trong file AGENTS.md hay CLAUDE.md, và viết sao cho quy tắc được tuân thủ mà file không bị phình to.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.