UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

58 lines (55 loc) 1.8 kB
import { attackBaseDomainObjectSchema } from "./chunk-63MLXW5B.js"; import { descriptionSchema, objectMarkingRefsSchema, xMitreContributorsSchema, xMitreDomainsSchema, xMitreModifiedByRefSchema, xMitrePlatformsSchema } 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/data-source.schema.ts import { z } from "zod"; var supportedMitreCollectionLayers = [ "Cloud Control Plane", "Host", "Report", "Container", "Device", "OSINT", "Network" ]; var xMitreCollectionLayersSchema = z.array(z.enum(supportedMitreCollectionLayers), { invalid_type_error: "x_mitre_collection_layers must be an array of supported collection layers." }).describe("List of places the data can be collected from."); var dataSourceSchema = attackBaseDomainObjectSchema.extend({ id: createStixIdValidator("x-mitre-data-source"), type: createStixTypeValidator("x-mitre-data-source"), // Optional in STIX but required in ATT&CK created_by_ref: stixCreatedByRefSchema, description: descriptionSchema, // Optional in STIX but required in ATT&CK external_references: createAttackExternalReferencesSchema("x-mitre-data-source"), // Optional in STIX but required in ATT&CK object_marking_refs: objectMarkingRefsSchema, x_mitre_platforms: xMitrePlatformsSchema.optional(), x_mitre_domains: xMitreDomainsSchema, x_mitre_modified_by_ref: xMitreModifiedByRefSchema, x_mitre_contributors: xMitreContributorsSchema.optional(), x_mitre_collection_layers: xMitreCollectionLayersSchema }).strict(); export { xMitreCollectionLayersSchema, dataSourceSchema };