You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-17Lines changed: 20 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
# MITRE ATT&CK® Data Model
2
2
3
-
The ATT&CK Data Model (ADM) is a TypeScript library that provides a structured way to interact with MITRE ATT&CK datasets. It uses Zod schemas, TypeScript types, and ES6 classes to create a type-safe, object-oriented interface for navigating the ATT&CK data model. This library is designed to parse, validate, and serialize STIX 2.1 formatted content, making it easy to work with ATT&CK-related data in a programmatic and intuitive way.
3
+
**A TypeScript library for working with MITRE ATT&CK data using STIX 2.1**
4
4
5
-
You can browse the ATT&CK schemas in a user-friendly interface at:
5
+
The ATT&CK Data Model (ADM) provides a type-safe, object-oriented interface for working with MITRE ATT&CK datasets.
6
+
Built on STIX 2.1 compliance, it uses Zod schemas and TypeScript types to ensure data integrity while providing intuitive relationship navigation between ATT&CK objects.
**[CLICK HERE](https://mitre-attack.github.io/attack-data-model) <sup>[1](#footnotes)</sup>** to browse the ATT&CK schemas in a user-friendly interface.
8
9
9
-
This site is dynamically generated from the contents of the `@latest` distribution channel / `main` branch. Please note that we do not currently maintain separate documentation for previous releases.
10
-
11
-
## Features
10
+
## Key Features
12
11
13
12
-**Type-Safe Data Parsing**: ADM validates STIX 2.1 bundles using Zod schemas, ensuring data model compliance and type safety.
14
13
-**Easy Relationship Navigation**: Each object instance contains pointers to related objects, simplifying the process of navigating between techniques, tactics, and other ATT&CK elements.
// Type hinting is supported for all object properties
162
161
if (technique.x_mitre_is_subtechnique) {
163
-
162
+
164
163
// Access related objects with helpful getter methods
165
164
console.log(technique.getParentTechnique());
166
165
}
@@ -231,20 +230,24 @@ For more detailed examples, please refer to the [examples](./examples/README.md)
231
230
232
231
## Compatibility Matrix
233
232
234
-
Our [COMPATIBILITY.md](./docs/COMPATIBILITY.md) document tracks the compatibility between versions of the ATT&CK Data Model (ADM) TypeScript API (`@mitre-attack/attack-data-model`) and versions of the MITRE ATT&CK® dataset (`mitre-attack/attack-stix-data`).
233
+
Our [Compatibility documentation](https://mitre-attack.github.io/attack-data-model/principles/versioning-philosophy)tracks the compatibility between versions of the ATT&CK Data Model (ADM) TypeScript API (`@mitre-attack/attack-data-model`) and versions of the MITRE ATT&CK dataset (`mitre-attack/attack-stix-data`).
235
234
236
235
## Contributing
237
236
238
237
We welcome contributions! Please see our [CONTRIBUTING.md](./docs/CONTRIBUTING.md) file for details on how to contribute to this project.
239
238
239
+
## Footnotes
240
+
241
+
<sup>1</sup> The [schemas site](https://mitre-attack.github.io/attack-data-model) is dynamically generated from the contents of the `@latest` distribution channel / `main` branch. We do not currently maintain separate documentation for previous releases, though we hope to in the future.
242
+
240
243
## License
241
244
242
245
This project is licensed under the Apache 2.0 License.
243
246
244
-
## Notice
247
+
## Notice
245
248
246
249
Copyright 2020-2025 The MITRE Corporation.
247
250
248
-
This project makes use of ATT&CK®
251
+
This project makes use of ATT&CK
249
252
250
-
[ATT&CK Terms of Use](https://attack.mitre.org/resources/terms-of-use/)
253
+
[ATT&CK Terms of Use](https://attack.mitre.org/resources/terms-of-use/)
Copy file name to clipboardExpand all lines: docs/CONTRIBUTING.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,9 +61,21 @@ When submitting a pull request:
61
61
5. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
62
62
6. Include a description of your changes and why they're necessary.
63
63
64
+
## Developer Setup
65
+
66
+
### Requirements
67
+
68
+
-[Node.js](https://nodejs.org/) v18.20
69
+
70
+
### Install dependences
71
+
72
+
```bash
73
+
npm install
74
+
```
75
+
64
76
## Developer Workflow
65
77
66
-
To maintain code quality and consistency, we use **ESLint**, **Prettier**, and **Husky** as part of the development workflow. Below is an overview of how each tool is configured and how it affects the contribution process:
78
+
To maintain code quality and consistency, we use **ESLint**, **Prettier**, and **Husky** as part of the development workflow. These tools are installed and configured by the [Developer Setup](#developer-setup) steps above. Below is an overview of how each tool is configured and how it affects the contribution process:
Copy file name to clipboardExpand all lines: docs/SPEC.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
> [!IMPORTANT]
2
2
> **Documentation Notice**
3
-
>
3
+
>
4
4
> This document is **not the source of truth** for the ATT&CK specification. The authoritative source is the **ATT&CK Data Model (ADM) TypeScript library**.
> While maintained to the best of our ability, this documentation may drift from the ADM library. If you find discrepancies, please [open a GitHub Issue](https://github.com/mitre-attack/attack-data-model/issues).
9
9
10
10
# The ATT&CK Specification
@@ -60,8 +60,7 @@ There are three general ways that ATT&CK extends the STIX 2.1 specification:
60
60
|`x_mitre_domains`| string[]| Identifies the domains the object is found in. See [domains](#domains) for more information.<br>Not found on objects of type `relationship`, `identity`, or `marking-definition`. |
61
61
|`x_mitre_attack_spec_version`<sup>1</sup> | string | The version of the ATT&CK specification used by the object. Consuming software can use this field to determine if the data format is supported. Current version is 3.3.0. |
62
62
63
-
64
-
- New relationship types. Unlike custom object types and extended fields, custom relationship types are **not** prefixed with `x_mitre_`. You can find a full list of relationship types in the [Relationships](#Relationships) section, which also mentions whether the type is a default STIX type.
63
+
- New relationship types. Unlike custom object types and extended fields, custom relationship types are **not** prefixed with `x_mitre_`. You can find a full list of relationship types in the [Relationships](#relationships) section, which also mentions whether the type is a default STIX type.
65
64
66
65
Please see also the STIX documentation on [customizing STIX](https://docs.oasis-open.org/cti/stix/v2.0/csprd01/part1-stix-core/stix-v2.0-csprd01-part1-stix-core.html#_Toc476227365).
67
66
@@ -93,7 +92,7 @@ The `x_mitre_domains` (string array) field identifies the "domain" to which the
93
92
|`mobile-attack`| Mobile |
94
93
|`ics-attack`| ATT&CK for ICS |
95
94
96
-
Most objects in ATT&CK belong in a single technology domain, but an object _may_ be included in multiple domains.
95
+
Most objects in ATT&CK belong in a single technology domain, but an object _may_ be included in multiple domains.
97
96
98
97
`x_mitre_domains` is supported on all ATT&CK object types except the following:
99
98
@@ -127,6 +126,7 @@ ATT&CK IDs are human-readable identifiers commonly used for referencing objects
127
126
|[Log Source](#log-sources)|`LSxxxx`|
128
127
129
128
**Important limitations:**
129
+
130
130
- ATT&CK IDs are not guaranteed to be unique (see [Collisions with Technique ATT&CK IDs](#collisions-with-technique-attck-ids))
131
131
- Matrices within the same domain share identical ATT&CK IDs
132
132
- Relationship objects do not have ATT&CK IDs
@@ -213,6 +213,7 @@ Sub-techniques are specialized implementations of parent techniques, providing m
213
213
Procedures describe specific instances of technique implementation by adversaries. Unlike other ATT&CK concepts, procedures are not represented by dedicated STIX objects. Instead, they are modeled as `uses` relationships where the `target_ref` points to a technique (`attack-pattern`).
214
214
215
215
**Procedure relationships:**
216
+
216
217
-**Source objects:** Groups (`intrusion-set`) or software (`malware`/`tool`)
-**Content:** Procedure details are captured in the relationship's `description` field
@@ -250,6 +251,7 @@ Software represents tools and malicious code used by adversaries to accomplish t
250
251
Data sources and data components define the telemetry and observational data that security teams can use to detect adversary techniques. This hierarchical model provides granular mapping between detection capabilities and techniques.
251
252
252
253
**Structural relationships:**
254
+
253
255
- Data components are nested within data sources but maintain separate STIX objects
254
256
- Each data component has exactly one parent data source
255
257
- Data sources can contain multiple data components
@@ -364,6 +366,7 @@ Detection strategies define high-level approaches for detecting specific adversa
364
366
|`x_mitre_analytic_refs`| string[]| Array of STIX IDs referencing `x-mitre-analytic` objects that implement this detection strategy. |
365
367
366
368
**Key characteristics:**
369
+
367
370
- Each detection strategy has a one-to-one relationship with a specific ATT&CK technique
368
371
- Detection strategies typically reference 1-3 analytics (one for each supported platform)
369
372
- Uses soft relationships (STIX ID references) to analytics for flexibility
@@ -497,4 +500,4 @@ Relationship objects frequently include `description` fields that provide contex
497
500
498
501
### Collections
499
502
500
-
See our [collections document](https://github.com/center-for-threat-informed-defense/attack-workbench-frontend/blob/master/docs/collections.md) for more information about the design and intention of collection objects.
503
+
See our [collections document](https://github.com/center-for-threat-informed-defense/attack-workbench-frontend/blob/master/docs/collections.md) for more information about the design and intention of collection objects.
Notably, there are two versions of each ATT&CK type available:
115
-
116
-
* One "extensible" schema (denoted by its `extensible` prefix) that returns a `ZodType`
117
-
* One "standard" schema that returns a `ZodEffect`
118
-
119
-
The extensible schemas (e.g., `extensibleCampaignSchema`) return a `ZodType` by intentionally omitting all Zod refinements. You should use these schemas if you are looking to extend or modify the baseline schema behaviors.
120
-
121
-
For example, let's say you wish to augment ATT&CK campaigns with your own custom fields—you can do this with the `extensibleCampaignSchema` as follows:
122
-
123
-
```typescript
124
-
// Using the extensible schema for type definition or extension
Many of the ATT&CK schemas use Zod refinements. We leverage refinements to execute advanced validation checks (e.g., validating that the first reference in `external_references` contains a valid ATT&CK ID).
128
116
129
-
This would not work for the "standard" `campaignSchema`.
117
+
Unfortunately, in current versions of Zod, if a schema is modified with one of the object methods (`pick`, `omit`, `extend`), the refinements will be discarded.
130
118
131
-
`campaignSchema` returns a `ZodEffect` by nature of employing Zod refinements. We leverage refinements to execute advanced validation checks (e.g., validating that the first reference in `external_references` contains a valid ATT&CK ID). You can use the refined schemas like you would any other Zod schema, with the added disclaimer that they are less extensible than their aforementioned counterparts:
119
+
For example, let's say you wish to augment ATT&CK campaigns with your own custom fields:
And don't worry—you can still use these refinements with your custom schemas. Each ATT&CK refinement is decoupled so they can be used modularly. They are exported as factory functions in the `refinements` sub-package:
126
+
`myCustomCampaignSchema` would not be valid, as it is missing the refinements that were originally present in `campaignSchema`.
140
127
141
-
```typescript
142
-
// Step 1 - import the refinements you want to use
You can still use the original refinements in your custom schemas, it will just take an extra step. Each ATT&CK refinement is decoupled so they can be used modularly. They are exported as factory functions in the `refinements` sub-package:
//Apply a single refinement that combines the imported refinements
135
+
const myCustomCampaignSchema =campaignSchema
151
136
.extend({ /* additional fields */ })
152
-
.superRefine((val, ctx) => {
153
-
validateFirstAlias(val, ctx);
154
-
validateCitations(val, ctx);
137
+
.check((ctx) => {
138
+
createFirstAliasRefinement()(ctx);
139
+
createCitationsRefinement()(ctx);
155
140
});
156
141
```
157
142
158
-
Notably, all ATT&CK schemas export only one TypeScript type, named in accordance with the refined schema, but inferred from the extensible schema. Since the refinements only add validation rules (rejected values) without changing the shape of valid data, a single type definition is sufficient:
159
-
160
-
```typescript
161
-
// An extensible schema for customizing or augmenting ATT&CK campaigns
You will have to look in the original schema file, in this case [/src/schemas/sdo/campaign.schema.ts](/src/schemas/sdo/campaign.schema.ts) to see which refinements, if any, should be applied to the ATT&CK schema that you wish to extend.
166
144
167
-
// One type definition for *all* ATT&CK campaigns (custom or otherwise)
This [GitHub issue](https://github.com/colinhacks/zod/issues/4874) and [pull request](https://github.com/colinhacks/zod/pull/4865) describe the behavior and an upcoming `safeExtend` method that will allow you to extend the ATT&CK schemas without having to reapply the refinements.
0 commit comments