Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opencti/issue/7763 #704

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/pycti/pycti.rst
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,15 @@ Classes
- :py:class:`CustomObservableUserAgent`:
User-Agent observable.

- :py:class:`CustomObservableFinancialAccount`:
Financial Account observable.

- :py:class:`CustomObservableFinancialAsset`:
Financial Asset observable.

- :py:class:`CustomObservableFinancialTransaction`:
Financial Transaction observable.

- :py:class:`CustomObservableCryptocurrencyWallet`:
Cryptocurrency wallet observable.

Expand Down Expand Up @@ -590,6 +599,27 @@ Classes
.. inheritance-diagram:: CustomObservableUserAgent
:parts: 1

.. autoclass:: CustomObservableFinancialAccount
:members:

.. rubric:: Inheritance
.. inheritance-diagram:: CustomObservableFinancialAccount
:parts: 1

.. autoclass:: CustomObservableFinancialAsset
:members:

.. rubric:: Inheritance
.. inheritance-diagram:: CustomObservableFinancialAsset
:parts: 1

.. autoclass:: CustomObservableFinancialTransaction
:members:

.. rubric:: Inheritance
.. inheritance-diagram:: CustomObservableFinancialTransaction
:parts: 1

.. autoclass:: CustomObservableCryptocurrencyWallet
:members:

Expand Down
25 changes: 25 additions & 0 deletions examples/create_observable_financial_account.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# coding: utf-8

from pycti import OpenCTIApiClient

# Variables
api_url = "http://localhost:4000"
api_token = "6C2C9EAE-6FF5-4421-B118-74A3CA5AAC20"

# OpenCTI initialization
opencti_api_client = OpenCTIApiClient(api_url, api_token)

process = opencti_api_client.stix_cyber_observable.create(
observableData={
"type": "Financial-Account",
"account_number": "123-45-9988",
"account_status": "active",
"account_type": "credit_credit_card",
"x_opencti_score": 90,
"iban": "55667",
"bic": "009998877",
"currency_code": "bahraini_dinar_(bhd)",
}
)

print(process)
22 changes: 22 additions & 0 deletions examples/create_observable_financial_asset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# coding: utf-8

from pycti import OpenCTIApiClient

# Variables
api_url = "http://localhost:4000"
api_token = "6C2C9EAE-6FF5-4421-B118-74A3CA5AAC20"

# OpenCTI initialization
opencti_api_client = OpenCTIApiClient(api_url, api_token)

process = opencti_api_client.stix_cyber_observable.create(
observableData={
"type": "Financial-Asset",
"asset_name": "Joe's Big Boat",
"asset_type": "boat",
"asset_value": 12000000,
"currency_code": "belarusian_ruble_(byr)",
}
)

print(process)
25 changes: 25 additions & 0 deletions examples/create_observable_financial_transaction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# coding: utf-8
from dateutil.parser import parse

from pycti import OpenCTIApiClient

# Variables
api_url = "http://localhost:4000"
api_token = "6C2C9EAE-6FF5-4421-B118-74A3CA5AAC20"

# OpenCTI initialization
opencti_api_client = OpenCTIApiClient(api_url, api_token)

# Define the date
date = parse("2019-02-06").strftime("%Y-%m-%dT%H:%M:%SZ")

process = opencti_api_client.stix_cyber_observable.create(
observableData={
"type": "Financial-Transaction",
"transaction_date": date,
"transaction_value": 62000000,
"currency_code": "belarusian_ruble_(byr)",
}
)

print(process)
13 changes: 8 additions & 5 deletions pycti/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@
CustomObjectCaseIncident,
CustomObjectChannel,
CustomObjectTask,
CustomObservableBankAccount,
CustomObservableCredential,
CustomObservableCryptocurrencyWallet,
CustomObservableFinancialAccount,
CustomObservableFinancialAsset,
CustomObservableFinancialTransaction,
CustomObservableHostname,
CustomObservableMediaContent,
CustomObservablePaymentCard,
Expand Down Expand Up @@ -137,17 +139,18 @@
"CustomObjectCaseIncident",
"CustomObjectTask",
"CustomObjectChannel",
"StixCyberObservableTypes",
"CustomObservableCredential",
"CustomObservableHostname",
"CustomObservableUserAgent",
"CustomObservableBankAccount",
"CustomObservableFinancialAccount",
"CustomObservableFinancialAsset",
"CustomObservableFinancialTransaction",
"CustomObservableCryptocurrencyWallet",
"CustomObservableHostname",
"CustomObservablePaymentCard",
"CustomObservablePhoneNumber",
"CustomObservableTrackingNumber",
"CustomObservableText",
"CustomObservableMediaContent",
"CustomObservableUserAgent",
"STIX_EXT_MITRE",
"STIX_EXT_OCTI_SCO",
"STIX_EXT_OCTI",
Expand Down
48 changes: 38 additions & 10 deletions pycti/entities/opencti_stix_core_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,6 @@ def __init__(self, opencti, file):
... on UserAgent {
value
}
... on BankAccount {
iban
bic
account_number
}
... on PhoneNumber {
value
}
Expand All @@ -643,6 +638,25 @@ def __init__(self, opencti, file):
url
publication_date
}
... on FinancialAccount {
account_number
account_status
account_type
iban
bic
currency_code
}
... on FinancialAsset {
asset_name
asset_type
asset_value
currency_code
}
... on FinancialTransaction {
transaction_date
transaction_value
currency_code
}
"""
self.properties_with_files = """
id
Expand Down Expand Up @@ -1280,11 +1294,6 @@ def __init__(self, opencti, file):
... on UserAgent {
value
}
... on BankAccount {
iban
bic
account_number
}
... on PhoneNumber {
value
}
Expand All @@ -1301,6 +1310,25 @@ def __init__(self, opencti, file):
url
publication_date
}
... on FinancialAccount {
account_number
account_status
account_type
iban
bic
currency_code
}
... on FinancialAsset {
asset_name
asset_type
asset_value
currency_code
}
... on FinancialTransaction {
transaction_date
transaction_value
currency_code
}
"""

"""
Expand Down
Loading