Skip to content

Commit

Permalink
[backend] Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
savacano28 committed Jan 15, 2025
1 parent 09f4393 commit 3d0fb95
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions opencti-platform/opencti-graphql/src/modules/xtm/xtm-domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import {
} from '../../schema/stixDomainObject';
import conf, { logApp } from '../../config/conf';
import {
createInjectInScenario,
createInjectInScenario as obasCreateInjectInScenario,
createScenario as obasCreateScenario,
getAttackPatterns as obasGetAttackPatterns,
getKillChainPhases,
getKillChainPhases as obasGetKillChainPhases,
getScenarioResult as obasGetScenarioResult,
searchInjectorContracts
searchInjectorContracts as obasSearchInjectorContracts
} from '../../database/xtm-obas';
import { isNotEmptyField } from '../../database/utils';
import { checkEnterpriseEdition } from '../../utils/ee';
Expand Down Expand Up @@ -115,7 +114,7 @@ const generateTechnicalAttackPattern = async (obasAttackPattern, finalObasInject

const generatePlaceholder = async (externalId, platforms, architecture, scenarioId, dependsOnDuration) => {
const title = `[${externalId}] Placeholder - ${platforms.join(',')} ${architecture}`;
await createInjectInScenario(
await obasCreateInjectInScenario(
scenarioId,
'openbas_manual',
'd02e9132-b9d0-4daa-b3b1-4b9871f8472c',
Expand Down Expand Up @@ -349,7 +348,7 @@ export const generateOpenBasScenario = async (
);

// Get kill chain phases
const obasKillChainPhases = await getKillChainPhases();
const obasKillChainPhases = await obasGetKillChainPhases();
const sortedObasKillChainPhases = obasKillChainPhases.sort((a, b) => a.phase_order - b.phase_order);
const killChainPhasesListOfNames = sortedObasKillChainPhases.map((n) => n.phase_name).join(', ');
const indexedSortedObasKillChainPhase = sortedObasKillChainPhases.reduce((acc, phase) => {
Expand Down Expand Up @@ -414,7 +413,7 @@ export const generateOpenBasScenario = async (
);
dependsOnDuration += (interval * 60);
} else {
const obasInjectorContracts = await searchInjectorContracts(obasAttackPattern.attack_pattern_external_id, platforms, architecture);
const obasInjectorContracts = await obasSearchInjectorContracts(obasAttackPattern.attack_pattern_external_id, platforms, architecture);

if (obasInjectorContracts.length === 0) {
attackPatternsWithoutInjectorContracts.push(obasAttackPattern.attack_pattern_external_id);
Expand Down

0 comments on commit 3d0fb95

Please sign in to comment.