Chuyển đến nội dung
Skillpedia
Bảo mật40k · #7453

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.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/tm7-threat-model/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

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:

  1. 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
  2. Assign a unique lowercase UUID (e.g. 148ade68-5c80-40f3-8e1f-4e2cabdb5991) to every stencil and every flow. Never use human-readable ids like users-browser.
  3. Lay out coordinates (Left/Top/Width/Height) so stencils don't overlap.
  4. Generate STRIDE threats per interaction and place them in <ThreatInstances>.
  5. Serialize using the structure in this guide, mirroring assets/example-minimal.tm7.
  6. Validate against the "Common Mistakes" checklist before returning the file.
  7. 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 and assets/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

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự