opencti icon indicating copy to clipboard operation
opencti copied to clipboard

[technical] wrong extension typing in StixCyberObject

Open labo-flg opened this issue 1 year ago • 1 comments

Related to PR #6402

We found out that SCO might not have an extension STIX_EXT_OCTI_SCO once converted to stix. This caused issue in playbook, solved with proper checks.

Root issue is not addressed : we need to properly type StixCyberObject so that this extension can be undefined. Obviously this lead to a bunch of errors to handle, mostly in stix-converter.ts.

We've reviewed the work to do and it's not a trivial task taht could be done on the same PR. We need to rework how the utility functions buildStixCyberObservable and cleanObject work together.

With proper typing, we will implement proper checking everywhere (at leats in TS files) it's used and we'll probably save us some bugs in the future !

labo-flg avatar Mar 21 '24 14:03 labo-flg

@SouadHadjiat & @labo-flg I remove the needs triage here even though I cannot reproduce, since I know the original bug. I'm not able to reproduce due to my limited competences in development but trust you there.

nino-filigran avatar Mar 22 '24 08:03 nino-filigran

To be clear: this is purely a technical issue (typescript typing) that would make the code less error-prone when it comes to handling the stix extensions data. Not high priority IMO.

labo-flg avatar Sep 27 '24 07:09 labo-flg