Skip to content

Commit 0592052

Browse files
committed
[client] implement inferred_entity & inferred_rel
1 parent 8c45e40 commit 0592052

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,15 +2645,15 @@ def apply_opencti_operation(self, item, operation):
26452645
elif operation == "rule_apply":
26462646
self.rule_apply(item=item)
26472647
elif operation == "inferred_entity":
2648-
raise ValueError(
2649-
"Not supported opencti_operation",
2650-
{"operation": operation},
2651-
)
2648+
opencti_inferred_input = self.opencti.get_attribute_in_extension("opencti_inferred_input", item)
2649+
if opencti_inferred_input is None:
2650+
opencti_inferred_input = item["opencti_inferred_input"]
2651+
self.opencti.inferred.create_inferred_entity(input=opencti_inferred_input)
26522652
elif operation == "inferred_rel":
2653-
raise ValueError(
2654-
"Not supported opencti_operation",
2655-
{"operation": operation},
2656-
)
2653+
opencti_inferred_input = self.opencti.get_attribute_in_extension("opencti_inferred_input", item)
2654+
if opencti_inferred_input is None:
2655+
opencti_inferred_input = item["opencti_inferred_input"]
2656+
self.opencti.inferred.create_inferred_rel(input=opencti_inferred_input)
26572657
elif operation == "rule_clear":
26582658
self.rule_clear(item=item)
26592659
elif operation == "rules_rescan":

0 commit comments

Comments
 (0)