From 7a9dafeaaa5a4f18d4a241e9549a14682c31b8ff Mon Sep 17 00:00:00 2001 From: Param Constructor <132086448+ParamConstructor@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:25:24 -0400 Subject: [PATCH] Fixing name to asset_name to match change on opencti branch --- examples/create_observable_financial_asset.py | 2 +- pycti/entities/opencti_stix_core_object.py | 4 ++-- pycti/entities/opencti_stix_cyber_observable.py | 2 +- .../opencti_stix_cyber_observable_properties.py | 4 ++-- pycti/utils/constants.py | 3 ++- pycti/utils/opencti_stix2_utils.py | 1 + 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/create_observable_financial_asset.py b/examples/create_observable_financial_asset.py index cac9e886..0b82118d 100644 --- a/examples/create_observable_financial_asset.py +++ b/examples/create_observable_financial_asset.py @@ -12,7 +12,7 @@ process = opencti_api_client.stix_cyber_observable.create( observableData={ "type": "Financial-Asset", - "name": "Joe's Big Boat", + "asset_name": "Joe's Big Boat", "asset_type": "boat", "asset_value": 12000000, "currency_code": "belarusian_ruble_(byr)", diff --git a/pycti/entities/opencti_stix_core_object.py b/pycti/entities/opencti_stix_core_object.py index 25079267..222d2014 100644 --- a/pycti/entities/opencti_stix_core_object.py +++ b/pycti/entities/opencti_stix_core_object.py @@ -644,7 +644,7 @@ def __init__(self, opencti, file): currency_code } ... on FinancialAsset { - name + asset_name asset_type asset_value currency_code @@ -1313,7 +1313,7 @@ def __init__(self, opencti, file): currency_code } ... on FinancialAsset { - name + asset_name asset_type asset_value currency_code diff --git a/pycti/entities/opencti_stix_cyber_observable.py b/pycti/entities/opencti_stix_cyber_observable.py index c05864ab..b0cd4e97 100644 --- a/pycti/entities/opencti_stix_cyber_observable.py +++ b/pycti/entities/opencti_stix_cyber_observable.py @@ -1038,7 +1038,7 @@ def create(self, **kwargs): type == "Financial-Asset" or type.lower() == "x-opencti-financial-asset" ): input_variables["FinancialAsset"] = { - "name": observable_data.get("name"), + "asset_name": observable_data.get("asset_name"), "asset_type": observable_data.get("asset_type"), "asset_value": observable_data.get("asset_value"), "currency_code": observable_data.get("currency_code"), diff --git a/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py b/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py index ae152c6a..c8f39af9 100644 --- a/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py +++ b/pycti/entities/stix_cyber_observable/opencti_stix_cyber_observable_properties.py @@ -289,7 +289,7 @@ currency_code } ... on FinancialAsset { - name + asset_name asset_type asset_value currency_code @@ -613,7 +613,7 @@ currency_code } ... on FinancialAsset { - name + asset_name asset_type asset_value currency_code diff --git a/pycti/utils/constants.py b/pycti/utils/constants.py index be7b9e01..525bea2c 100644 --- a/pycti/utils/constants.py +++ b/pycti/utils/constants.py @@ -43,6 +43,7 @@ class StixCyberObservableTypes(Enum): FINANCIAL_TRANSACTION = "Financial-Transaction" TEXT = "Text" USER_AGENT = "User-Agent" + # BANK_ACCOUNT = "Bank-Account" PHONE_NUMBER = "Phone-Number" CREDENTIAL = "Credential" TRACKING_NUMBER = "Tracking-Number" @@ -439,7 +440,7 @@ class CustomObservableFinancialAccount: @CustomObservable( "financial-asset", [ - ("name", StringProperty()), + ("asset_name", StringProperty()), ("asset_type", StringProperty()), ("asset_value", StringProperty()), ("currency_code", StringProperty()), diff --git a/pycti/utils/opencti_stix2_utils.py b/pycti/utils/opencti_stix2_utils.py index f79af1cd..78a6d21d 100644 --- a/pycti/utils/opencti_stix2_utils.py +++ b/pycti/utils/opencti_stix2_utils.py @@ -63,6 +63,7 @@ "Windows-Registry-Key": ["key"], "Windows-Registry-Value-Type": ["name"], "Hostname": ["value"], + # "Bank-Account": ["iban"], "Phone-Number": ["value"], "Payment-Card": ["card_number"], "Tracking-Number": ["value"],