diff --git a/opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts b/opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts index 88d1cbf246ae..665001d02562 100644 --- a/opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts +++ b/opencti-platform/opencti-graphql/src/modules/playbook/playbook-components.ts @@ -1257,13 +1257,13 @@ const PLAYBOOK_CREATE_OBSERVABLE_COMPONENT: PlaybookComponent; - description: string; - score: number; - created_by_ref: StixId | undefined; - external_references: Array; + extension_type? : 'property-extension'; + labels?: Array; + description?: string; + score?: number; + created_by_ref?: StixId; + external_references?: Array; } interface StixCyberObject extends StixObject { @@ -119,7 +119,7 @@ interface StixCyberObject extends StixObject { x_opencti_score?: number; // optional extensions: { [STIX_EXT_OCTI]: StixOpenctiExtension; - [STIX_EXT_OCTI_SCO]: CyberObjectExtension + [STIX_EXT_OCTI_SCO]?: CyberObjectExtension }; } diff --git a/opencti-platform/opencti-graphql/src/types/stix-sco.d.ts b/opencti-platform/opencti-graphql/src/types/stix-sco.d.ts index 9bebafa1bd68..f493d4ebfd6e 100644 --- a/opencti-platform/opencti-graphql/src/types/stix-sco.d.ts +++ b/opencti-platform/opencti-graphql/src/types/stix-sco.d.ts @@ -390,7 +390,7 @@ export interface StixNetworkTraffic extends StixCyberObject { encapsulated_by_ref: StixId | undefined; // optional extensions: { [STIX_EXT_OCTI]: StixOpenctiExtension - [STIX_EXT_OCTI_SCO]: CyberObjectExtension + [STIX_EXT_OCTI_SCO]?: CyberObjectExtension // HTTP Request Extension 'http-request-ext'?: { request_method: string; @@ -445,7 +445,7 @@ export interface StixProcess extends StixCyberObject { child_refs: Array; // optional extensions: { [STIX_EXT_OCTI]: StixOpenctiExtension - [STIX_EXT_OCTI_SCO]: CyberObjectExtension + [STIX_EXT_OCTI_SCO]?: CyberObjectExtension // Windows™ Process Extension 'windows-process-ext': { aslr_enabled: boolean; // optional @@ -510,7 +510,7 @@ export interface StixUserAccount extends StixCyberObject { account_last_login: StixDate; // optional extensions: { [STIX_EXT_OCTI]: StixOpenctiExtension - [STIX_EXT_OCTI_SCO]: CyberObjectExtension + [STIX_EXT_OCTI_SCO]?: CyberObjectExtension // UNIX™ Account Extension 'unix-account-ext'?: { gid: number; // optional diff --git a/opencti-platform/opencti-graphql/tests/02-integration/05-parser/csv-parser-test.ts b/opencti-platform/opencti-graphql/tests/02-integration/05-parser/csv-parser-test.ts index f94b43e6a573..e8da04ee051d 100644 --- a/opencti-platform/opencti-graphql/tests/02-integration/05-parser/csv-parser-test.ts +++ b/opencti-platform/opencti-graphql/tests/02-integration/05-parser/csv-parser-test.ts @@ -184,9 +184,9 @@ describe('CSV-PARSER with dynamic mapping (aka different entity on one file)', ( expect(firstIdentity.name).toBe('AlienVault'); expect(firstIp.value).toBe('91.200.148.232'); - expect(firstIp.extensions[STIX_EXT_OCTI_SCO].score).toBe(41); + expect(firstIp.extensions[STIX_EXT_OCTI_SCO]?.score).toBe(41); expect(firstUrl.value).toBe('http://requestrepo.com/r/2yxp98b3'); - expect(firstUrl.extensions[STIX_EXT_OCTI_SCO].score).toBe(22); + expect(firstUrl.extensions[STIX_EXT_OCTI_SCO]?.score).toBe(22); expect(firstIdentity.name).toBe('AlienVault'); expect(firstIdentity.identity_class).toBe('individual'); });