@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
48 lines (45 loc) • 1.58 kB
JavaScript
import {
attackBaseDomainObjectSchema
} from "./chunk-ZQ5CIHH7.js";
import {
aliasesSchema,
descriptionSchema,
objectMarkingRefsSchema,
xMitreDomainsSchema,
xMitreModifiedByRefSchema,
xMitrePlatformsSchema
} from "./chunk-Z7F5EWOT.js";
import {
externalReferencesSchema,
stixCreatedByRefSchema
} from "./chunk-QY7EQ3UO.js";
import {
createMultiStixTypeValidator
} from "./chunk-5JU73PGM.js";
// src/schemas/sdo/software.schema.ts
import { z } from "zod/v4";
var extensibleSoftwareSchema = attackBaseDomainObjectSchema.extend({
type: createMultiStixTypeValidator(["malware", "tool"]),
created_by_ref: stixCreatedByRefSchema.meta({
description: "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.optional().meta({
description: "Alternative names used to identify this software. The first alias must match the object's name."
}),
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().meta({ description: "Alternative names used to identify this software." })
});
var softwareSchema = extensibleSoftwareSchema;
export {
extensibleSoftwareSchema,
softwareSchema
};