tm7-threat-model
Skill này làm gì
Agent này tạo các tệp mô hình mối đe dọa (.tm7) cho công cụ của Microsoft. Nó chuyển mô tả hệ thống thành sơ đồ và các mối đe dọa bảo mật, theo đúng định dạng mà công cụ hiểu.
Khi nào nên dùng
- ✓Khi bạn cần tạo một tệp mô hình mối đe dọa (.tm7).
- ✓Khi thực hiện mô hình hóa mối đe dọa STRIDE và cần một tệp .tm7.
- ✓Nếu bạn muốn tạo hoặc chỉnh sửa tệp .tm7 cho Microsoft Threat Modeling Tool.
Liên kết skill
https://github.com/github/awesome-copilot/blob/main/skills/tm7-threat-model/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
“Tạo một tệp .tm7 cho một hệ thống có một người dùng, một ứng dụng web và một cơ sở dữ liệu.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent xác định các thành phần của hệ thống (như tiến trình và cơ sở dữ liệu), gán cho chúng các mã định danh duy nhất, rồi sắp xếp mọi thứ thành một tệp XML có cấu trúc riêng. Tệp được định dạng chính xác để Microsoft Threat Modeling Tool đọc được.
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.
Microsoft Threat Modeling Tool (.tm7) Generator
You generate valid .tm7 files for the Microsoft Threat Modeling Tool (v7.3+). A .tm7
file is not generic XML — it is a WCF DataContractSerializer document with an exact
namespace and element structure. If the structure is wrong, the tool refuses to open the file
with:
"File is not an actual threat model or the threat model may be corrupted."
Your job is to translate a described system (components, data stores, external actors, data
flows, trust boundaries) into a diagram plus STRIDE threats, serialized in the exact .tm7
format described below.
Workflow
When asked to produce a .tm7 file:
- Model the system. Identify the elements:
- Processes (web apps, services, functions) →
StencilEllipse,GE.P - Data stores (databases, caches, queues, blobs) →
StencilParallelLines,GE.DS - External interactors (users, browsers, third-party systems) →
StencilRectangle,GE.EI - Trust boundaries →
BorderBoundary,GE.TB - Data flows connecting the above →
Connector,GE.DF
- Processes (web apps, services, functions) →
- Assign a unique lowercase UUID (e.g.
148ade68-5c80-40f3-8e1f-4e2cabdb5991) to every stencil and every flow. Never use human-readable ids likeusers-browser. - Lay out coordinates (
Left/Top/Width/Height) so stencils don't overlap. - Generate STRIDE threats per interaction and place them in
<ThreatInstances>. - Serialize using the structure in this guide, mirroring
assets/example-minimal.tm7. - Validate against the "Common Mistakes" checklist before returning the file.
- Write the file with no XML declaration and no pretty-print indentation (a single continuous XML stream is what the serializer emits).
Always open assets/example-minimal.tm7 first and adapt it — reuse its exact
serialization skeleton and only change stencil types, names, coordinates, flows, and threats.
CRITICAL: Serialization format
TM7 files use WCF DataContractSerializer XML, not standard XML.
The file MUST start with this exact root element — no <?xml?> declaration:
<ThreatModel xmlns="http://schemas.datacontract.org/2004/07/ThreatModeling.Model" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
NEVER use:
<?xml version="1.0" encoding="utf-8"?>— causes deserialization failure.xmlns:xsi/xmlns:xsd— these are standard XML namespaces, not DataContract namespaces.- Invented elements such as
<SecurityGaps>or<Mitigations>— they do not exist in the TM7 schema.
Note:
<MetaInformation>(with children like<Owner>,<Contributors>,<Reviewer>,<Assumptions>,<ExternalDependencies>,<HighLevelSystemDescription>,<ThreatModelName>),<Notes>, and<KnowledgeBase>are part of the real schema and are emitted by the tool — keep them (see the structure below andassets/example-minimal.tm7). Just don't invent elements that the tool never produces.
Required namespace prefixes
| Prefix | URI | Used for |
|---|---|---|
| (default) | http://schemas.datacontract.org/2004/07/ThreatModeling.Model |
Root ThreatModel |
xmlns:i |
http://www.w3.org/2001/XMLSchema-instance |
Type attributes |
xmlns:z |
http://schemas.microsoft.com/2003/10/Serialization/ |
Reference ids (z:Id) |
xmlns:a |
http://schemas.microsoft.com/2003/10/Serialization/Arrays |
Arrays / collections |
xmlns:b |
http://schemas.datacontract.org/2004/07/ThreatModeling.KnowledgeBase |
Stencil properties |
xmlns:c |
http://www.w3.org/2001/XMLSchema |
Primitive type values |
File structure (correct order)
A full tool export contains, in this order: DrawingSurfaceList, MetaInformation, Notes,
ThreatInstances, ThreatMetaData (often empty/self-closing), then the large generic
KnowledgeBase as a top-level sibling (not nested inside ThreatMetaData), and finally
Profile.
<ThreatModel xmlns="..." xmlns:i="...">
<DrawingSurfaceList>
<DrawingSurfaceModel z:Id="i1" xmlns:z="...">
<GenericTypeId xmlns="...Abstracts">DRAWINGSURFACE</GenericTypeId>
<Guid xmlns="...Abstracts">{guid}</Guid>
<Properties xmlns="...Abstracts" xmlns:a="...Arrays">...</Properties>
<TypeId xmlns="...Abstracts">DRAWINGSURFACE</TypeId>
<Borders xmlns:a="...Arrays">
<!-- Stencil elements: processes, data stores, external entities, boundaries -->
…
Câu hỏi thường gặp
Tệp .tm7 là gì?
Đây là tệp được Microsoft Threat Modeling Tool dùng để lưu và chia sẻ mô hình bảo mật của hệ thống.
STRIDE là gì?
STRIDE là phương pháp xác định các mối đe dọa bảo mật trong hệ thống, tập trung vào Spoofing (giả mạo), Tampering (sửa đổi), Repudiation (chối bỏ), Information Disclosure (lộ thông tin), Denial of Service (từ chối dịch vụ) và Elevation of Privilege (leo thang đặc quyền).
Vì sao định dạng tệp lại quan trọng?
Tệp .tm7 có cấu trúc XML rất cụ thể. Nếu sai, Microsoft Threat Modeling Tool sẽ không mở được tệp và hiển thị thông báo lỗi.
Chi tiết
Mô tả gốc của tác giả
Creates valid Microsoft Threat Modeling Tool (.tm7) files compatible with the Microsoft Threat Modeling Tool v7.3+. Use this skill whenever asked to create, generate, or modify a .tm7 threat model file, or when performing STRIDE threat modeling that should output a .tm7 file that opens cleanly in the Microsoft Threat Modeling Tool.
repo: github/awesome-copilot
Độ phổ biến
- Sao GitHub
- 40k
- Vị trí xếp hạng
- #7453
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
acquire-codebase-knowledge
40kGiúp agent của bạn hiểu và ghi tài liệu cho một dự án mã nguồn có sẵn. Hữu ích khi đón thành viên mới hoặc nắm tổng quan về kiến trúc.
acreadiness-assess
40kGiúp agent của bạn đánh giá mức độ sẵn sàng cho AI của dự án và tạo báo cáo. Hữu ích để biết dự án đã sẵn sàng dùng công cụ AI đến đâu.
acreadiness-generate-instructions
40kGiúp agent của bạn tạo hướng dẫn cho công cụ AI dựa trên kết quả đánh giá. Hữu ích để cải thiện cách AI làm việc với mã và khắc phục các khoảng trống.
acreadiness-policy
40kGiúp agent của bạn xác định hoặc áp dụng chính sách đánh giá dự án bằng AI. Hữu ích để chuẩn hóa cách đánh giá dự án và đảm bảo tuân thủ.
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.