Skip to content

Commit 85eab83

Browse files
authored
Merge pull request #58 from mitre-attack/main
Merge main into next
2 parents 0d894e5 + c06ef8e commit 85eab83

File tree

104 files changed

+5026
-26340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+5026
-26340
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
node-version: '22.x'
7171

7272
- name: Install
73-
run: npm ci --include=dev
73+
run: npm ci
7474

7575
- name: Build
7676
run: npm run build
@@ -153,15 +153,15 @@ jobs:
153153
node-version: '22.x'
154154

155155
- name: Install schema dependencies
156-
run: npm install
156+
run: npm ci
157157
working-directory: ./
158158

159-
- name: Install docusaurus dependencies
160-
run: npm install
161-
working-directory: ./docusaurus
162-
163159
- name: Generate schema documentation
164-
run: npm run gendocs
160+
run: npm run docs:schemamarkdown
161+
working-directory: ./
162+
163+
- name: Install docusaurus dependencies
164+
run: npm ci
165165
working-directory: ./docusaurus
166166

167167
- name: Build Docusaurus site
@@ -172,4 +172,4 @@ jobs:
172172
uses: peaceiris/actions-gh-pages@v3
173173
with:
174174
deploy_key: ${{ secrets.DEPLOY_KEY }}
175-
publish_dir: ./docusaurus/build
175+
publish_dir: ./docusaurus/build

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# auto-generated schema documentation
2-
docusaurus/docs/reference/schemas/
3-
41
# TypeScript artifacts
52
*.d.ts
63
*.ts.map

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright [2025] [The MITRE Corporation]
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 69 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The ATT&CK Data Model (ADM) provides a type-safe, object-oriented interface for working with MITRE ATT&CK datasets.
66
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.
77

8-
**[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+
**[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.
99

1010
## Key Features
1111

@@ -51,10 +51,10 @@ If you're unsure which version of ATT&CK data you have:
5151
1. **From a STIX bundle file**: Look for the `x_mitre_attack_spec_version` field in the collection object
5252
```json
5353
{
54-
"type": "x-mitre-collection",
55-
"id": "x-mitre-collection--1f5f1533-f617-4ca8-9ab4-6a02367fa019",
56-
"name": "Enterprise ATT&CK",
57-
"x_mitre_attack_spec_version": "3.2.0",
54+
"type": "x-mitre-collection",
55+
"id": "x-mitre-collection--1f5f1533-f617-4ca8-9ab4-6a02367fa019",
56+
"name": "Enterprise ATT&CK",
57+
"x_mitre_attack_spec_version": "3.2.0"
5858
}
5959
```
6060
1. **Check the compatibility matrix**: Check which spec version your STIX bundle or object is supported by in the [Compatibility Guide](./COMPATIBILITY.md)
@@ -77,37 +77,44 @@ npm install @mitre-attack/attack-data-model@~4.0.0
7777
### Version Mismatch Warnings
7878

7979
The ADM will validate that your data matches the expected ATT&CK Specification version. If there's a mismatch, you may encounter:
80+
8081
- **Validation errors**: When the data structure doesn't match what the ADM expects
8182
- **Missing properties**: When using older data with a newer ADM version
8283
- **Unrecognized fields**: When using newer data with an older ADM version
8384

8485
### Recommended Approach
8586

8687
For most users, we recommend:
88+
8789
1. **Use the latest ADM version** (`npm install @mitre-attack/attack-data-model`)
8890
2. **Load current ATT&CK data** directly from the official repository (the ADM can do this automatically)
8991
3. **Keep both updated** regularly to access new techniques, updates, and features
9092

9193
Example of loading the latest ATT&CK data:
94+
9295
```javascript
93-
import { registerDataSource, loadDataModel, DataSourceRegistration } from '@mitre-attack/attack-data-model';
96+
import {
97+
registerDataSource,
98+
loadDataModel,
99+
DataSourceRegistration,
100+
} from '@mitre-attack/attack-data-model';
94101

95102
const dataSource = new DataSourceRegistration({
96-
source: 'attack',
97-
domain: 'enterprise-attack',
98-
version: '17.1',
99-
parsingMode: 'strict'
103+
source: 'attack',
104+
domain: 'enterprise-attack',
105+
version: '17.1',
106+
parsingMode: 'strict',
100107
});
101108

102109
const dataSource = await registerDataSource(dataSource);
103110
const attackEnterpriseLatest = loadDataModel(dataSource);
104111
```
105112

106-
For more details on version compatibility, see the [Compatibility Guide](./COMPATIBILITY.md).
113+
For more details on version compatibility, see the [Compatibility Guide](https://mitre-attack.github.io/attack-data-model/docs/principles/attack-versioning).
107114

108115
## ATT&CK Specification
109116

110-
The ADM is built upon the [MITRE ATT&CK® Specification](./docs/SPEC.md), which formally defines the structure, properties, and relationships of ATT&CK objects. The ATT&CK Specification serves as the authoritative source for how ATT&CK data should be represented and interacted with.
117+
The ADM is built upon the [MITRE ATT&CK® Specification](https://mitre-attack.github.io/attack-data-model/schemas/), which formally defines the structure, properties, and relationships of ATT&CK objects. The ATT&CK Specification serves as the authoritative source for how ATT&CK data should be represented and interacted with.
111118

112119
The ADM provides a codified expression of the ATT&CK Specification using Zod schemas and TypeScript types. By implementing the specification in code, the ADM ensures that all data parsed and manipulated through the library adheres to the defined standards of the ATT&CK data model. This includes strict validation of object structures, types, and required properties, providing developers with confidence in the integrity and consistency of the data they work with.
113120

@@ -121,9 +128,9 @@ By maintaining separate versioning, the ADM can evolve as a software library whi
121128

122129
## Documentation
123130

124-
For detailed API documentation and usage examples, please refer to the [ATT&CK Data Model TypeScript API Documentation](docs/USAGE.md).
131+
For detailed API documentation and usage examples, please refer to the [ATT&CK Data Model TypeScript API Documentation](USAGE.md).
125132

126-
For additional context about the ATT&CK specification, please refer to the [ATT&CK Specification Guide](./docs/SPEC.md).
133+
For additional context about the ATT&CK specification, please refer to the [ATT&CK Specification Guide](https://mitre-attack.github.io/attack-data-model/schemas/).
127134

128135
## Basic Usage
129136

@@ -132,83 +139,85 @@ For additional context about the ATT&CK specification, please refer to the [ATT&
132139
Here's an example script that demonstrates how to use the ADM library to load ATT&CK data from the official MITRE ATT&CK GitHub repository:
133140

134141
```typescript
135-
import { registerDataSource, loadDataModel, DataSourceRegistration } from '@mitre-attack/attack-data-model';
142+
import {
143+
registerDataSource,
144+
loadDataModel,
145+
DataSourceRegistration,
146+
} from '@mitre-attack/attack-data-model';
136147

137148
(async () => {
138-
139-
// Instantiating a DataSourceRegistration object will validate that the data source is accessible and readable
140-
const dataSource = new DataSourceRegistration({
141-
source: 'attack', // Built-in index to retrieve ATT&CK content from the official MITRE ATT&CK STIX 2.1 GitHub repository
142-
domain: 'enterprise-attack',
143-
version: '15.1', // Omitting 'version' will default to the latest version available in the repository
144-
parsingMode: 'relaxed' // 'strict' or 'relaxed' - 'relaxed' mode will attempt to parse and serialize data even if it contains errors or warnings
145-
});
146-
147-
try {
148-
// Register the data source and retrieve the unique ID
149-
const uuid = await registerDataSource(dataSource);
150-
if (uuid) {
151-
// Load the dataset using the unique ID
152-
const attackEnterpriseLatest = loadDataModel(uuid);
153-
154-
// Access ATT&CK objects by type using object properties
155-
const techniques = attackEnterpriseLatest.techniques;
156-
const tactics = attackEnterpriseLatest.tactics;
157-
158-
const technique = techniques[0];
159-
160-
// Type hinting is supported for all object properties
161-
if (technique.x_mitre_is_subtechnique) {
162-
163-
// Access related objects with helpful getter methods
164-
console.log(technique.getParentTechnique());
165-
}
166-
}
167-
} catch (error) {
168-
console.error(error);
149+
// Instantiating a DataSourceRegistration object will validate that the data source is accessible and readable
150+
const dataSource = new DataSourceRegistration({
151+
source: 'attack', // Built-in index to retrieve ATT&CK content from the official MITRE ATT&CK STIX 2.1 GitHub repository
152+
domain: 'enterprise-attack',
153+
version: '15.1', // Omitting 'version' will default to the latest version available in the repository
154+
parsingMode: 'relaxed', // 'strict' or 'relaxed' - 'relaxed' mode will attempt to parse and serialize data even if it contains errors or warnings
155+
});
156+
157+
try {
158+
// Register the data source and retrieve the unique ID
159+
const uuid = await registerDataSource(dataSource);
160+
if (uuid) {
161+
// Load the dataset using the unique ID
162+
const attackEnterpriseLatest = loadDataModel(uuid);
163+
164+
// Access ATT&CK objects by type using object properties
165+
const techniques = attackEnterpriseLatest.techniques;
166+
const tactics = attackEnterpriseLatest.tactics;
167+
168+
const technique = techniques[0];
169+
170+
// Type hinting is supported for all object properties
171+
if (technique.x_mitre_is_subtechnique) {
172+
// Access related objects with helpful getter methods
173+
console.log(technique.getParentTechnique());
174+
}
169175
}
176+
} catch (error) {
177+
console.error(error);
178+
}
170179
})();
171180
```
172181

173182
### Parsing and Validating a Tactic
174183

175184
```typescript
176-
import { tacticSchema } from "@mitre-attack/attack-data-model";
185+
import { tacticSchema } from '@mitre-attack/attack-data-model';
177186

178187
const validTactic = {
179-
id: "x-mitre-tactic--4ca45d45-df4d-4613-8980-bac22d278fa5",
180-
type: "x-mitre-tactic",
181-
name: "Execution",
182-
description: "The adversary is trying to run malicious code.",
183-
x_mitre_shortname: "execution",
188+
id: 'x-mitre-tactic--4ca45d45-df4d-4613-8980-bac22d278fa5',
189+
type: 'x-mitre-tactic',
190+
name: 'Execution',
191+
description: 'The adversary is trying to run malicious code.',
192+
x_mitre_shortname: 'execution',
184193
// ... other required fields
185194
};
186195

187196
try {
188197
const parsedTactic = tacticSchema.parse(validTactic);
189-
console.log("Tactic parsed successfully:", parsedTactic.name);
198+
console.log('Tactic parsed successfully:', parsedTactic.name);
190199
} catch (error) {
191-
console.error("Validation error:", error);
200+
console.error('Validation error:', error);
192201
}
193202
```
194203

195204
### Handling Invalid Data
196205

197206
```typescript
198-
import { tacticSchema } from "@mitre-attack/attack-data-model";
199-
import { z } from "zod";
207+
import { tacticSchema } from '@mitre-attack/attack-data-model';
208+
import { z } from 'zod';
200209

201210
const invalidTactic = {
202211
// Missing required fields
203-
id: "x-mitre-tactic--4ca45d45-df4d-4613-8980-bac22d278fa5",
204-
type: "x-mitre-tactic",
212+
id: 'x-mitre-tactic--4ca45d45-df4d-4613-8980-bac22d278fa5',
213+
type: 'x-mitre-tactic',
205214
};
206215

207216
try {
208217
tacticSchema.parse(invalidTactic);
209218
} catch (error) {
210219
if (error instanceof z.ZodError) {
211-
console.log("Validation errors:", error.errors);
220+
console.log('Validation errors:', error.errors);
212221
}
213222
}
214223
```
@@ -234,7 +243,7 @@ Our [Compatibility documentation](https://mitre-attack.github.io/attack-data-mod
234243

235244
## Contributing
236245

237-
We welcome contributions! Please see our [CONTRIBUTING.md](./docs/CONTRIBUTING.md) file for details on how to contribute to this project.
246+
We welcome contributions! Please see our contributor guide for more information: <https://mitre-attack.github.io/attack-data-model/docs/contributing/>
238247

239248
## Footnotes
240249

SPEC.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
> [!IMPORTANT]
2+
> **Documentation Notice**
3+
>
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**.
5+
>
6+
> 📖 **Browse ATT&CK schemas:** <https://mitre-attack.github.io/attack-data-model/schemas/>
7+
8+
# The ATT&CK Specification
File renamed without changes.

0 commit comments

Comments
 (0)