UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

48 lines (45 loc) 1.54 kB
import { attackBaseDomainObjectSchema } from "./chunk-63MLXW5B.js"; import { aliasesSchema, descriptionSchema, objectMarkingRefsSchema, xMitreDomainsSchema, xMitreModifiedByRefSchema, xMitrePlatformsSchema } from "./chunk-7SVTHS3K.js"; import { externalReferencesSchema, stixCreatedByRefSchema } from "./chunk-ZAIY3U5E.js"; import { createMultiStixTypeValidator } from "./chunk-E6AAF2HD.js"; // src/schemas/sdo/software.schema.ts import { z } from "zod"; var extensibleSoftwareSchema = attackBaseDomainObjectSchema.extend({ type: createMultiStixTypeValidator(["malware", "tool"]), created_by_ref: stixCreatedByRefSchema.describe( "The ID of the Source object that describes who created this object." ), description: descriptionSchema, external_references: externalReferencesSchema, object_marking_refs: objectMarkingRefsSchema, // Malware: Required // Tool: Optional x_mitre_platforms: xMitrePlatformsSchema.optional(), x_mitre_contributors: z.array(z.string()).optional(), x_mitre_aliases: aliasesSchema.describe( "Alternative names used to identify this software. The first alias must match the object's name." ).optional(), x_mitre_modified_by_ref: xMitreModifiedByRefSchema, x_mitre_domains: xMitreDomainsSchema, // Not used in ATT&CK Malware or Tool but defined in STIX aliases: aliasesSchema.optional().describe("Alternative names used to identify this software.") }); var softwareSchema = extensibleSoftwareSchema; export { extensibleSoftwareSchema, softwareSchema };