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

[Shadowserver] ERROR type object 'Vulnerability' has no attribute 'generate_id' #3104

Open
dominictory opened this issue Dec 11, 2024 · 3 comments
Assignees
Labels
bug use for describing something not working as expected

Comments

@dominictory
Copy link

Description

Since October, our Shadowserver has not done anything despite the API key confirmed working as well as connection to API. The connector "runs" but with 0 work done, and no errors. There are reports available on the API since it stopped working. We have however noticed the below error in container logs (not seen in UI?):

ERROR type object 'Vulnerability' has no attribute 'generate_id' | timestamp=2024-12-11T09:30:57.262304Z name=Shadowserver exc_info=Traceback (most recent call last):
  File "/opt/connector/lib/external_import.py", line 125, in run
    bundle_objects = self._collect_intelligence()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/main.py", line 136, in _collect_intelligence
    report_stix_objects = shadowserver_api.get_stix_report(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/shadowserver/api.py", line 181, in get_stix_report
    stix_transformation = ShadowserverStixTransformation(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/shadowserver/stix_transform.py", line 89, in __init__
    self.create_stix_objects()
  File "/opt/connector/shadowserver/stix_transform.py", line 99, in create_stix_objects
    label_list = self.map_to_stix(element)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/shadowserver/stix_transform.py", line 448, in map_to_stix
    labels_list.extend(self.get_custom_labels(element))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/shadowserver/stix_transform.py", line 505, in get_custom_labels
    self.create_vulnerability(label)
  File "/opt/connector/shadowserver/stix_transform.py", line 534, in create_vulnerability
    opencti_obj = Vulnerability(id=Vulnerability.generate_id(name), **kwargs)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Vulnerability' has no attribute 'generate_id' taskName=null

Image

Environment

6.4.0

Reproducible Steps

Configure Shadowserver connector on 6.4.0, observe nothing produced by connector other than above error

Expected Output

Connector produces data.

Actual Output

No output.

@dominictory dominictory added bug use for describing something not working as expected needs triage use to identify issue needing triage from Filigran Product team labels Dec 11, 2024
@romain-filigran romain-filigran removed the needs triage use to identify issue needing triage from Filigran Product team label Dec 12, 2024
@romain-filigran
Copy link
Member

PR which solves the problem mentioned here.
However, we do not have the means to test further whether the connector works.

@romain-filigran romain-filigran self-assigned this Dec 12, 2024
@dominictory
Copy link
Author

PR which solves the problem mentioned here. However, we do not have the means to test further whether the connector works.

Thanks, we will of course test this and report back when fix released :)

@0q1627a
Copy link

0q1627a commented Dec 12, 2024

Hello.
I've applied the proposed patch and now the error is different. I'm on 6.4.4 containers.

"level": "ERROR", "name": "Shadowserver", "message": "type object 'Vulnerability' has no attribute 'generate_id'", "exc_info": "Traceback (most recent call last):
  File "/opt/connector/lib/external_import.py", line 125, in run
    bundle_objects = self._collect_intelligence()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/main.py", line 136, in _collect_intelligence
    report_stix_objects = shadowserver_api.get_stix_report(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/shadowserver/api.py", line 181, in get_stix_report
    stix_transformation = ShadowserverStixTransformation(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/shadowserver/stix_transform.py", line 89, in __init__
    )
  File "/opt/connector/shadowserver/stix_transform.py", line 99, in create_stix_objects
    label_list = []
                    
  File "/opt/connector/shadowserver/stix_transform.py", line 448, in map_to_stix
    labels_list = self.custom_properties.get("x_opencti_labels", []).copy()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/shadowserver/stix_transform.py", line 505, in get_custom_labels
    if label.upper().startswith("CVE"):
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/connector/shadowserver/stix_transform.py", line 534, in create_vulnerability
    }
      
AttributeError: type object 'Vulnerability' has no attribute 'generate_id'", "taskName": null}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug use for describing something not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants