muchdogesec / arango_cti_processor

A small script that creates relationships between common CTI knowledge-bases in STIX 2.1 format.
https://www.dogesec.com/
Apache License 2.0
3 stars 0 forks source link

Issue with creating relationships with CWE mode #13

Closed himynamesdave closed 3 months ago

himynamesdave commented 3 months ago

e.g. capec-cwe mode run below.

also affects cve-cwe, cwe-capec

Seems need to include addcustom flag to relationship generation

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 134, in relate_capec_to_cwe
    rel = parse_relation_object(
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 92, in parse_relation_object
    Relationship(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/v21/sro.py", line 59, in __init__
    super(Relationship, self).__init__(**kwargs)
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 203, in __init__
    temp_custom = self._check_property(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 58, in _check_property
    raise InvalidValueError(
stix2.exceptions.InvalidValueError: Invalid value for Relationship 'target_ref': reference to custom object type: weakness
[2024-07-31 - 11:03:36] ERROR - Invalid value for Relationship 'target_ref': reference to custom object type: weakness
Traceback (most recent call last):
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 50, in _check_property
    kwargs[prop_name], has_custom = prop.clean(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/properties.py", line 610, in clean
    raise CustomContentError(
stix2.exceptions.CustomContentError: reference to custom object type: weakness

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 134, in relate_capec_to_cwe
    rel = parse_relation_object(
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 92, in parse_relation_object
    Relationship(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/v21/sro.py", line 59, in __init__
    super(Relationship, self).__init__(**kwargs)
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 203, in __init__
    temp_custom = self._check_property(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 58, in _check_property
    raise InvalidValueError(
stix2.exceptions.InvalidValueError: Invalid value for Relationship 'target_ref': reference to custom object type: weakness
 99%|█████████████████████████████████████▋| 1495/1508 [00:03<00:00, 579.95it/s][2024-07-31 - 11:03:36] ERROR - Invalid value for Relationship 'target_ref': reference to custom object type: weakness
Traceback (most recent call last):
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 50, in _check_property
    kwargs[prop_name], has_custom = prop.clean(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/properties.py", line 610, in clean
    raise CustomContentError(
stix2.exceptions.CustomContentError: reference to custom object type: weakness

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 134, in relate_capec_to_cwe
    rel = parse_relation_object(
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 92, in parse_relation_object
    Relationship(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/v21/sro.py", line 59, in __init__
    super(Relationship, self).__init__(**kwargs)
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 203, in __init__
    temp_custom = self._check_property(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 58, in _check_property
    raise InvalidValueError(
stix2.exceptions.InvalidValueError: Invalid value for Relationship 'target_ref': reference to custom object type: weakness
[2024-07-31 - 11:03:36] ERROR - Invalid value for Relationship 'target_ref': reference to custom object type: weakness
Traceback (most recent call last):
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 50, in _check_property
    kwargs[prop_name], has_custom = prop.clean(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/properties.py", line 610, in clean
    raise CustomContentError(
stix2.exceptions.CustomContentError: reference to custom object type: weakness

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 134, in relate_capec_to_cwe
    rel = parse_relation_object(
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 92, in parse_relation_object
    Relationship(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/v21/sro.py", line 59, in __init__
    super(Relationship, self).__init__(**kwargs)
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 203, in __init__
    temp_custom = self._check_property(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 58, in _check_property
    raise InvalidValueError(
stix2.exceptions.InvalidValueError: Invalid value for Relationship 'target_ref': reference to custom object type: weakness
[2024-07-31 - 11:03:36] ERROR - Invalid value for Relationship 'target_ref': reference to custom object type: weakness
Traceback (most recent call last):
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 50, in _check_property
    kwargs[prop_name], has_custom = prop.clean(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/properties.py", line 610, in clean
    raise CustomContentError(
stix2.exceptions.CustomContentError: reference to custom object type: weakness

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 134, in relate_capec_to_cwe
    rel = parse_relation_object(
  File "/Users/dgreenwood/Documents/repos/dogesec/arango_cti_processor/arango_cti_processor/utils.py", line 92, in parse_relation_object
    Relationship(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/v21/sro.py", line 59, in __init__
    super(Relationship, self).__init__(**kwargs)
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 203, in __init__
    temp_custom = self._check_property(
  File "/Users/dgreenwood/.pyenv/versions/3.10.9/lib/python3.10/site-packages/stix2/base.py", line 58, in _check_property
    raise InvalidValueError(
stix2.exceptions.InvalidValueError: Invalid value for Relationship 'target_ref': reference to custom object type: weakness