@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
48 lines (45 loc) • 1.55 kB
JavaScript
import {
attackBaseDomainObjectSchema
} from "./chunk-63MLXW5B.js";
import {
descriptionSchema,
objectMarkingRefsSchema,
xMitreDomainsSchema,
xMitreModifiedByRefSchema
} from "./chunk-7SVTHS3K.js";
import {
externalReferencesSchema,
stixCreatedByRefSchema
} from "./chunk-ZAIY3U5E.js";
import {
createStixIdValidator
} from "./chunk-BX5HSTNG.js";
import {
createStixTypeValidator
} from "./chunk-E6AAF2HD.js";
// src/schemas/sdo/matrix.schema.ts
import { z } from "zod";
var xMitreTacticRefsSchema = z.array(createStixIdValidator("x-mitre-tactic")).describe(
"An ordered list of x-mitre-tactic STIX IDs corresponding to the tactics of the matrix. The order determines the appearance within the matrix."
);
var extensibleMatrixSchema = attackBaseDomainObjectSchema.extend({
id: createStixIdValidator("x-mitre-matrix"),
type: createStixTypeValidator("x-mitre-matrix"),
// Optional in STIX but required in ATT&CK
created_by_ref: stixCreatedByRefSchema,
description: descriptionSchema,
// Optional in STIX but required in ATT&CK
external_references: externalReferencesSchema,
// TODO check that first ext ref is "enterprise-attack" linked to attack website
// Optional in STIX but required in ATT&CK
object_marking_refs: objectMarkingRefsSchema,
x_mitre_domains: xMitreDomainsSchema,
x_mitre_modified_by_ref: xMitreModifiedByRefSchema,
tactic_refs: xMitreTacticRefsSchema
}).strict();
var matrixSchema = extensibleMatrixSchema;
export {
xMitreTacticRefsSchema,
extensibleMatrixSchema,
matrixSchema
};