Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 851f93d

Browse files
committed
[client] Pass update to observables
1 parent 09a860d commit 851f93d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from typing import Callable, Dict, List, Optional, Union
1919

2020
import pika
21-
import stix2.utils
2221
from filigran_sseclient import SSEClient
2322
from pika.adapters.asyncio_connection import AsyncioConnection
2423
from pika.exceptions import NackError, UnroutableError

pycti/entities/opencti_stix_cyber_observable.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ def create(self, **kwargs):
659659
$objectLabel: [String],
660660
$objectOrganization: [String],
661661
$externalReferences: [String],
662+
$update: Boolean,
662663
$AutonomousSystem: AutonomousSystemAddInput,
663664
$Directory: DirectoryAddInput,
664665
$DomainName: DomainNameAddInput,
@@ -698,6 +699,7 @@ def create(self, **kwargs):
698699
createdBy: $createdBy,
699700
objectMarking: $objectMarking,
700701
objectLabel: $objectLabel,
702+
update: $update,
701703
externalReferences: $externalReferences,
702704
objectOrganization: $objectOrganization,
703705
AutonomousSystem: $AutonomousSystem,

pycti/utils/opencti_stix2.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,6 +1990,7 @@ def export_entity(
19901990
mode: str = "simple",
19911991
max_marking_definition: Dict = None,
19921992
no_custom_attributes: bool = False,
1993+
only_entity: bool = False,
19931994
) -> Dict:
19941995
max_marking_definition_entity = (
19951996
self.opencti.marking_definition.read(id=max_marking_definition)
@@ -2057,6 +2058,7 @@ def export_entity(
20572058
if entity is None:
20582059
API_LOGGER.error("Cannot export entity (not found)")
20592060
return bundle
2061+
entity_standard_id = entity["standard_id"]
20602062
stix_objects = self.prepare_export(
20612063
self.generate_export(entity, no_custom_attributes),
20622064
mode,
@@ -2065,6 +2067,10 @@ def export_entity(
20652067
)
20662068
if stix_objects is not None:
20672069
bundle["objects"].extend(stix_objects)
2070+
if only_entity:
2071+
return [e for e in bundle["objects"] if e.get("id") == entity_standard_id][
2072+
0
2073+
]
20682074
return bundle
20692075

20702076
def export_list(

0 commit comments

Comments
 (0)