UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

100 lines (97 loc) 2.94 kB
import { attackBaseDomainObjectSchema } from "./chunk-ZHQVMLOZ.js"; import { descriptionSchema } from "./chunk-DNIVZ2SM.js"; import { createAttackExternalReferencesSchema } from "./chunk-UP3ZMB5U.js"; import { xMitreContributorsSchema, xMitreModifiedByRefSchema } from "./chunk-U55YRJAX.js"; import { createStixIdValidator } from "./chunk-E3OY6DRE.js"; import { createStixTypeValidator } from "./chunk-PFSYT437.js"; import { xMitreDomainsSchema } from "./chunk-ZEHAFUHO.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 tacticSchema = 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() }).meta({ description: "Tactics represent the adversary's tactical goals during an attack and are defined by `x-mitre-tactic` objects. As custom STIX types, they extend the generic STIX Domain Object pattern." }).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().meta({ description: ` Tactics represent the adversary's tactical goals during an attack and are defined by \`x-mitre-tactic\` objects. As custom STIX types, they extend the generic [STIX Domain Object pattern](https://docs.oasis-open.org/cti/stix/v2.0/csprd01/part2-stix-objects/stix-v2.0-csprd01-part2-stix-objects.html#_Toc476230920). `.trim() }); export { xMitreShortNameSchema, tacticSchema };