Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/schemas/sdo/analytic.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,22 @@ export type MutableElement = z.infer<typeof xMitreMutableElementSchema>;
//
//==============================================================================

export const xMitreMutableElementsSchema = z.array(xMitreMutableElementSchema).min(1).meta({
description:
'Environment-specific tuning knobs like TimeWindow, UserContext, or PortRange, so defenders can adapt without changing core behavior.',
});
export const xMitreMutableElementsSchema = z
.array(xMitreMutableElementSchema)
.min(1)
.check((ctx) => {
// Validate no duplicate mutable elements using composite key validation
// Each (field, description) tuple must be unique
validateNoDuplicates(
[],
['field', 'description'],
'Duplicate mutable element found: each (field, description) tuple must be unique',
)(ctx);
})
.meta({
description:
'Environment-specific tuning knobs like TimeWindow, UserContext, or PortRange, so defenders can adapt without changing core behavior.',
});

export type MutableElements = z.infer<typeof xMitreMutableElementsSchema>;

Expand Down
Loading