@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
47 lines (44 loc) • 1.79 kB
JavaScript
import {
identityClassOpenVocabulary,
industrySectorOpenVocabulary
} from "./chunk-5FTVQX5U.js";
import {
attackBaseDomainObjectSchema
} from "./chunk-63MLXW5B.js";
import {
objectMarkingRefsSchema
} from "./chunk-7SVTHS3K.js";
import {
createStixIdValidator
} from "./chunk-BX5HSTNG.js";
import {
createStixTypeValidator
} from "./chunk-E6AAF2HD.js";
// src/schemas/sdo/identity.schema.ts
import { z } from "zod";
var extensibleIdentitySchema = attackBaseDomainObjectSchema.extend({
id: createStixIdValidator("identity"),
type: createStixTypeValidator("identity"),
object_marking_refs: objectMarkingRefsSchema,
identity_class: identityClassOpenVocabulary.describe(
"The type of entity that this Identity describes, e.g., an individual or organization. This is an open vocabulary and the values SHOULD come from the identity-class-ov vocabulary."
),
description: z.string().describe("A description of the object.").optional(),
// Not used in ATT&CK Identity but defined in STIX
roles: z.array(z.string(), {
invalid_type_error: "Roles must be an array of strings."
}).describe("The list of roles that this Identity performs.").optional(),
// Not used in ATT&CK Identity but defined in STIX
sectors: z.array(industrySectorOpenVocabulary).describe(
"The list of industry sectors that this Identity belongs to. This is an open vocabulary and values SHOULD come from the industry-sector-ov vocabulary."
).optional(),
// Not used in ATT&CK Identity but defined in STIX
contact_information: z.string().describe("The contact information (e-mail, phone number, etc.) for this Identity.").optional()
}).omit({
x_mitre_version: true
}).strict();
var identitySchema = extensibleIdentitySchema;
export {
extensibleIdentitySchema,
identitySchema
};