UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

43 lines (40 loc) 1.32 kB
import { attackBaseDomainObjectSchema } from "./chunk-ZQ5CIHH7.js"; import { descriptionSchema, xMitreDomainsSchema, xMitreModifiedByRefSchema } from "./chunk-Z7F5EWOT.js"; import { createStixIdValidator } from "./chunk-OM2DJ5DL.js"; import { createStixTypeValidator } from "./chunk-5JU73PGM.js"; // src/schemas/sdo/matrix.schema.ts import { z } from "zod/v4"; var xMitreTacticRefsSchema = z.array(createStixIdValidator("x-mitre-tactic")).meta({ description: "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"), description: descriptionSchema, x_mitre_domains: xMitreDomainsSchema, x_mitre_modified_by_ref: xMitreModifiedByRefSchema, tactic_refs: xMitreTacticRefsSchema }).required({ created_by_ref: true, // Optional in STIX but required in ATT&CK external_references: true, // Optional in STIX but required in ATT&CK object_marking_refs: true // Optional in STIX but required in ATT&CK }).strict(); var matrixSchema = extensibleMatrixSchema; export { xMitreTacticRefsSchema, extensibleMatrixSchema, matrixSchema };