Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/generator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ const minimalTechnique: MinimalTechnique = {
external_id: 'T1234',
},
],
kill_chain_phases: [
{
kill_chain_name: 'mitre-attack',
phase_name: 'execution',
},
],
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/sdo/technique.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export const techniqueBaseSchema = attackBaseDomainObjectSchema
// Optional in STIX but required in ATT&CK
external_references: createAttackExternalReferencesSchema('attack-pattern'),

kill_chain_phases: z.array(killChainPhaseSchema).min(1).optional().meta({
kill_chain_phases: z.array(killChainPhaseSchema).min(1).meta({
description:
'Techniques are associated with Tactics through their `kill_chain_phases` property. When the `kill_chain_name` matches the domain (`mitre-attack`, `mitre-mobile-attack`, or `mitre-ics-attack`), the `phase_name` corresponds to the `x_mitre_shortname` of the associated `x-mitre-tactic` object.',
}),
Expand Down
15 changes: 15 additions & 0 deletions test/objects/stix-bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand Down Expand Up @@ -185,6 +186,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand Down Expand Up @@ -307,6 +309,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand All @@ -326,6 +329,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand Down Expand Up @@ -356,6 +360,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand All @@ -375,6 +380,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand Down Expand Up @@ -407,6 +413,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand All @@ -426,6 +433,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand Down Expand Up @@ -467,6 +475,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand All @@ -486,6 +495,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand All @@ -505,6 +515,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand All @@ -524,6 +535,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand Down Expand Up @@ -565,6 +577,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand Down Expand Up @@ -696,6 +709,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand All @@ -715,6 +729,7 @@ describe('StixBundleSchema', () => {
x_mitre_version: '1.0',
x_mitre_domains: ['enterprise-attack'],
x_mitre_is_subtechnique: false,
kill_chain_phases: [{ kill_chain_name: 'mitre-attack', phase_name: 'execution' }],
external_references: [
{
source_name: 'mitre-attack',
Expand Down
8 changes: 4 additions & 4 deletions test/objects/technique.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ describe('TechniqueSchema', () => {
testField('x_mitre_domains', 'invalid-domains');
});

describe('kill_chain_phases', () => {
testField('kill_chain_phases', [{ invalid: 'object' }]);
});

// Testing optional fields
describe('description', () => {
testField('description', 123, false);
});

describe('kill_chain_phases', () => {
testField('kill_chain_phases', [{ invalid: 'object' }], false);
});

describe('x_mitre_platforms', () => {
testField('x_mitre_platforms', 123, false);
});
Expand Down
Loading