UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

32 lines (29 loc) 958 B
import { nonEmptyRequiredString } from "./chunk-GS2OERHB.js"; // src/schemas/common/property-schemas/stix-kill-chains.ts import { z } from "zod"; var killChainNameSchema = z.enum([ "mitre-attack", "mitre-mobile-attack", "mitre-ics-attack" ]); var killChainPhaseSchema = z.object({ phase_name: nonEmptyRequiredString.refine( (value) => { const isLowercase = value === value.toLowerCase(); const usesHyphens = !value.includes(" ") && !value.includes("_"); return isLowercase && usesHyphens; }, { message: "Phase name should be all lowercase and use hyphens instead of spaces or underscores." } ).meta({ description: "The name of the phase in the kill chain. The value of this property SHOULD be all lowercase and SHOULD use hyphens instead of spaces or underscores as word separators." }), kill_chain_name: killChainNameSchema }).strict(); export { killChainNameSchema, killChainPhaseSchema };