UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

90 lines (87 loc) 2.38 kB
import { attackBaseDomainObjectSchema } from "./chunk-ZQ5CIHH7.js"; import { descriptionSchema, xMitreContributorsSchema, xMitreDomainsSchema, xMitreModifiedByRefSchema } from "./chunk-Z7F5EWOT.js"; import { createAttackExternalReferencesSchema } from "./chunk-QY7EQ3UO.js"; import { createStixIdValidator } from "./chunk-OM2DJ5DL.js"; import { createStixTypeValidator } from "./chunk-5JU73PGM.js"; // src/schemas/sdo/tactic.schema.ts import { z } from "zod/v4"; var supportedMitreShortNames = [ "credential-access", "execution", "impact", "persistence", "privilege-escalation", "lateral-movement", "defense-evasion", "exfiltration", "discovery", "collection", "resource-development", "reconnaissance", "command-and-control", "initial-access", "inhibit-response-function", "privilege-escalation", "lateral-movement", "discovery", "initial-access", "impact", "persistence", "execution", "command-and-control", "collection", "evasion", "impair-process-control", "initial-access", "exfiltration", "persistence", "privilege-escalation", "command-and-control", "execution", "impact", "credential-access", "collection", "lateral-movement", "defense-evasion", "network-effects", "discovery", "remote-service-effects" ]; var xMitreShortNameSchema = z.enum(supportedMitreShortNames).meta({ description: "The x_mitre_shortname of the tactic is used for mapping techniques into the tactic. It corresponds to kill_chain_phases.phase_name of the techniques in the tactic." }); var extensibleTacticSchema = attackBaseDomainObjectSchema.extend({ id: createStixIdValidator("x-mitre-tactic"), type: createStixTypeValidator("x-mitre-tactic"), description: descriptionSchema, // Optional in STIX but required in ATT&CK external_references: createAttackExternalReferencesSchema("x-mitre-tactic"), x_mitre_domains: xMitreDomainsSchema, x_mitre_shortname: xMitreShortNameSchema, x_mitre_modified_by_ref: xMitreModifiedByRefSchema, x_mitre_contributors: xMitreContributorsSchema.optional() }).required({ created_by_ref: true, // Optional in STIX but required in ATT&CK object_marking_refs: true // Optional in STIX but required in ATT&CK }).strict(); var tacticSchema = extensibleTacticSchema; export { xMitreShortNameSchema, extensibleTacticSchema, tacticSchema };