Skip to content

Commit

Permalink
[backend] Fix OBAS email generation
Browse files Browse the repository at this point in the history
(cherry picked from commit 7b242f0)
  • Loading branch information
SamuelHassine authored and Kedae committed Jun 13, 2024
1 parent 88fedb1 commit 408f87d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion opencti-platform/opencti-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@graphql-tools/schema": "10.0.3",
"@graphql-tools/utils": "10.1.2",
"@jorgeferrero/stream-to-buffer": "2.0.6",
"@mistralai/mistralai": "0.3.0",
"@mistralai/mistralai": "0.5.0",
"@opensearch-project/opensearch": "2.8.0",
"@opentelemetry/api": "1.8.0",
"@opentelemetry/api-metrics": "0.33.0",
Expand Down
15 changes: 9 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 @@ -51,15 +51,18 @@ export const scenarioElementsDistribution = async (context, user, args) => {

export const resolveFiles = async (context, user, stixCoreObject) => {
const opts = {
first: 20,
first: 1,
prefixMimeTypes: undefined,
entity_id: stixCoreObject.id,
entity_type: stixCoreObject.entity_type
};
const importFiles = await paginatedForPathWithEnrichment(context, user, `import/${stixCoreObject.entity_type}/${stixCoreObject.id}`, stixCoreObject.id, opts);
const fileIds = importFiles.edges.map((n) => n.node.id);
if (fileIds.length === 0) {
return [];
}
const files = await elSearchFiles(context, user, {
first: 10,
first: 1,
fileIds,
connectionFormat: false,
excludeFields: [],
Expand Down Expand Up @@ -157,7 +160,7 @@ export const generateOpenBasScenario = async (context, user, stixCoreObject, att
dependsOnDuration,
{
expectations: [],
subject: responseIncidentResponseSubject.replace('Subject: ', ''),
subject: responseIncidentResponseSubject.replace('Subject: ', '').replace('"', ''),
body: responseIncidentResponse
},
[{ value: 'opencti', color: '#001bda' }, { value: 'csirt', color: '#c28b0d' }]
Expand Down Expand Up @@ -201,7 +204,7 @@ export const generateOpenBasScenario = async (context, user, stixCoreObject, att
dependsOnDuration,
{
expectations: [],
subject: responseCisoSubject.replace('Subject: ', ''),
subject: responseCisoSubject.replace('Subject: ', '').replace('"', ''),
body: responseCiso
},
[{ value: 'opencti', color: '#001bda' }, { value: 'ciso', color: '#b41313' }]
Expand Down Expand Up @@ -275,7 +278,7 @@ export const generateOpenBasScenario = async (context, user, stixCoreObject, att
'2790bd39-37d4-4e39-be7e-53f3ca783f86',
titleIncidentResponse,
dependsOnDuration,
{ expectations: [], subject: responseIncidentResponseSubject.replace('Subject: ', ''), body: responseIncidentResponse },
{ expectations: [], subject: responseIncidentResponseSubject.replace('Subject: ', '').replace('"', ''), body: responseIncidentResponse },
[{ value: 'opencti', color: '#001bda' }, { value: 'csirt', color: '#c28b0d' }]
);
dependsOnDuration += (interval * 60);
Expand Down Expand Up @@ -318,7 +321,7 @@ export const generateOpenBasScenario = async (context, user, stixCoreObject, att
'2790bd39-37d4-4e39-be7e-53f3ca783f86',
titleCiso,
dependsOnDuration,
{ expectations: [], subject: responseCisoSubject.replace('Subject: ', ''), body: responseCiso },
{ expectations: [], subject: responseCisoSubject.replace('Subject: ', '').replace('"', ''), body: responseCiso },
[{ value: 'opencti', color: '#001bda' }, { value: 'ciso', color: '#b41313' }]
);
dependsOnDuration += (interval * 60);
Expand Down
10 changes: 5 additions & 5 deletions opencti-platform/opencti-graphql/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3109,12 +3109,12 @@ __metadata:
languageName: node
linkType: hard

"@mistralai/mistralai@npm:0.3.0":
version: 0.3.0
resolution: "@mistralai/mistralai@npm:0.3.0"
"@mistralai/mistralai@npm:0.5.0":
version: 0.5.0
resolution: "@mistralai/mistralai@npm:0.5.0"
dependencies:
node-fetch: "npm:^2.6.7"
checksum: 10/082342acc86ed0c609a77af5cd21cbe7090ea47d354a04b0dac20f86f93a8d1b411505b89bf84ee3ed066d010ae699bd7457665163721fea33918f5be188ac3d
checksum: 10/788e4b6d4bb124131272beea1079081f4b279befc8608ac4fcf0efa147f524c48e4af4b68414c6f71a32704eaf0c9c6d5550634ed6be8a9bcf9cc8d15d55161a
languageName: node
linkType: hard

Expand Down Expand Up @@ -11164,7 +11164,7 @@ __metadata:
"@graphql-tools/utils": "npm:10.1.2"
"@jorgeferrero/stream-to-buffer": "npm:2.0.6"
"@luckycatfactory/esbuild-graphql-loader": "npm:3.8.1"
"@mistralai/mistralai": "npm:0.3.0"
"@mistralai/mistralai": "npm:0.5.0"
"@opensearch-project/opensearch": "npm:2.8.0"
"@opentelemetry/api": "npm:1.8.0"
"@opentelemetry/api-metrics": "npm:0.33.0"
Expand Down

0 comments on commit 408f87d

Please sign in to comment.