@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
69 lines (67 loc) • 2.46 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/schemas/common/property-schemas/attack-platforms.ts
var attack_platforms_exports = {};
__export(attack_platforms_exports, {
xMitrePlatformSchema: () => xMitrePlatformSchema,
xMitrePlatformsSchema: () => xMitrePlatformsSchema
});
module.exports = __toCommonJS(attack_platforms_exports);
var import_zod = require("zod");
var supportedMitrePlatforms = [
"Field Controller/RTU/PLC/IED",
"Network Devices",
"Data Historian",
"Google Workspace",
"Office Suite",
"ESXi",
"Identity Provider",
"Containers",
"Azure AD",
"Engineering Workstation",
"Control Server",
"Human-Machine Interface",
"Windows",
"Linux",
"IaaS",
"None",
"iOS",
"PRE",
"SaaS",
"Input/Output Server",
"macOS",
"Android",
"Safety Instrumented System/Protection Relay",
"Embedded"
];
var xMitrePlatformSchema = import_zod.z.enum(supportedMitrePlatforms, {
error: () => `Platform must be one of: ${supportedMitrePlatforms.join(", ")}`
}).meta({
description: "A technology environments and/or operating system that ATT&CK techniques are applicable within."
});
var xMitrePlatformsSchema = import_zod.z.array(xMitrePlatformSchema, {
error: (issue) => issue.code === "invalid_type" ? "x_mitre_platforms must be an array of strings" : "Invalid platforms array"
}).min(1, "At least one platform is required").refine((items) => new Set(items).size === items.length, {
message: "Platforms must be unique (no duplicates allowed)."
}).meta({ description: "List of platforms that apply to the object." });
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
xMitrePlatformSchema,
xMitrePlatformsSchema
});