@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
47 lines (44 loc) • 1.53 kB
JavaScript
import {
attackBaseDomainObjectSchema
} from "./chunk-ZQ5CIHH7.js";
import {
createOldMitreAttackIdSchema,
objectMarkingRefsSchema,
xMitreContributorsSchema,
xMitreDomainsSchema,
xMitreModifiedByRefSchema
} from "./chunk-Z7F5EWOT.js";
import {
createAttackExternalReferencesSchema,
stixCreatedByRefSchema
} from "./chunk-QY7EQ3UO.js";
import {
createStixIdValidator
} from "./chunk-OM2DJ5DL.js";
import {
createStixTypeValidator
} from "./chunk-5JU73PGM.js";
// src/schemas/sdo/mitigation.schema.ts
import { z } from "zod/v4";
var extensibleMitigationSchema = attackBaseDomainObjectSchema.extend({
id: createStixIdValidator("course-of-action"),
type: createStixTypeValidator("course-of-action"),
description: z.string().meta({
description: "A description that provides more details and context about the Mitigation."
}),
// Optional in STIX but required in ATT&CK
created_by_ref: stixCreatedByRefSchema,
// Optional in STIX but required in ATT&CK
external_references: createAttackExternalReferencesSchema("course-of-action"),
// Optional in STIX but required in ATT&CK
object_marking_refs: objectMarkingRefsSchema,
x_mitre_domains: xMitreDomainsSchema,
x_mitre_modified_by_ref: xMitreModifiedByRefSchema,
x_mitre_contributors: xMitreContributorsSchema.min(1).optional(),
x_mitre_old_attack_id: createOldMitreAttackIdSchema("course-of-action").optional()
}).strict();
var mitigationSchema = extensibleMitigationSchema;
export {
extensibleMitigationSchema,
mitigationSchema
};