@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
91 lines (88 loc) • 2.44 kB
JavaScript
import {
attackBaseDomainObjectSchema
} from "./chunk-63MLXW5B.js";
import {
descriptionSchema,
objectMarkingRefsSchema,
xMitreContributorsSchema,
xMitreDomainsSchema,
xMitreModifiedByRefSchema
} from "./chunk-7SVTHS3K.js";
import {
createAttackExternalReferencesSchema,
stixCreatedByRefSchema
} from "./chunk-ZAIY3U5E.js";
import {
createStixIdValidator
} from "./chunk-BX5HSTNG.js";
import {
createStixTypeValidator
} from "./chunk-E6AAF2HD.js";
// src/schemas/sdo/tactic.schema.ts
import { z } from "zod";
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).describe(
"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
created_by_ref: stixCreatedByRefSchema,
// Optional in STIX but required in ATT&CK
external_references: createAttackExternalReferencesSchema("x-mitre-tactic"),
// Optional in STIX but required in ATT&CK
object_marking_refs: objectMarkingRefsSchema,
x_mitre_domains: xMitreDomainsSchema,
x_mitre_shortname: xMitreShortNameSchema,
x_mitre_modified_by_ref: xMitreModifiedByRefSchema,
x_mitre_contributors: xMitreContributorsSchema.optional()
}).strict();
var tacticSchema = extensibleTacticSchema;
export {
xMitreShortNameSchema,
extensibleTacticSchema,
tacticSchema
};