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

bugfix: pyTenable crashes if srcInterface or dstInterface not null #753

Merged
merged 5 commits into from
Feb 13, 2024

Conversation

saizinbud
Copy link
Contributor

Description

Addressed a bug causing a crash in when events->srcInterface or events->dstInterface was not null upon query completion. The issue was traced back to incorrect usage of the marshmallow package.

Note: In Tenable.OT version 3.17, a bug existed where events->srcInterface and dstInterface consistently returned null. Due to this behavior, the current bug did not manifest itself during that version

Additionally, added the retrieval of required nodes from dstInterface, ensuring that all necessary nodes are now properly obtained.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Run local tests and tested against a Tenable.OT machine

Test Configuration:

  • Python Version(s) Tested: 3.10.12

Addressed a bug causing a crash in when events->srcInterface or events->dstInterface was not null upon query completion.
The issue was traced back to incorrect usage of the marshmallow package.

Note: In Tenable.OT version 3.17, a bug existed where events->srcInterface and dstInterface consistently returned null.
Due to this behavior, the current bug did not manifest itself during that version

Additionally, added the retrieval of required nodes from dstInterface, ensuring that all necessary nodes are now properly obtained.
@saizinbud saizinbud requested a review from a team January 18, 2024 14:15


@dataclass
class IP:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use this class also in tenable/ot/schema/events.py line:124 (dst_ip) and on line:139 (src_ip)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@aseemsavio
Copy link
Collaborator

@saizinbud The changes look good to me. Could you also add tests?

* Add srcInterface and dstInterface fields to OT test
* Revert change of last commit - dst_ip, src_ip should remain
  IPv4Address and cannot be converted to IP class
* Change directAsset field of NetworkInterface to ID class
* Move ID, IDList classes to base.py
* Remove Lists from src_interface and dst_interface - These fields
  cannot return lists
@aseemsavio aseemsavio merged commit 3a7d379 into tenable:master Feb 13, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants