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

Use 'n/a' as OS node property if none of the <os> tags have a 'product' value #62

Merged
merged 12 commits into from
Nov 8, 2024

Conversation

rachkor
Copy link
Member

@rachkor rachkor commented Nov 9, 2023

Summary

Currently, if the first OS tag for a Node has no product value:

<fingerprints>
    <os certainty="0.80" family="IOS" vendor="Cisco" arch="x86_64"/>
</fingerprints>

Then the upload will crash with an error like:

bundler: failed to load command: thor (/opt/dradispro/dradispro/releases/202306171116/vendor/bundle/ruby/3.1.0/bin/thor)
/opt/dradispro/dradispro/shared/bundle/ruby/3.1.0/bundler/gems/dradis-nexpose-5febb8d166a8/lib/nexpose/node.rb:97:in `method_missing': undefined method `value' for nil:NilClass (NoMethodError)

xml_os.attributes['product'].value
^^^^^^

This PR prevents the error from appearing by selecting the first product value from the <os> tags and if none is found, use n/a

Copyright assignment

I assign all rights, including copyright, to any future Dradis work by myself to Security Roots.

@caitmich caitmich changed the title Prevent an error message when the first os tag has no product Use 'n/a' as OS node property if none of the <os> tags have a 'product' value Nov 24, 2023
lib/nexpose/node.rb Outdated Show resolved Hide resolved
lib/nexpose/node.rb Outdated Show resolved Hide resolved
lib/nexpose/node.rb Outdated Show resolved Hide resolved
@aapomm aapomm merged commit 440526c into main Nov 8, 2024
@aapomm aapomm deleted the os-no-product branch November 8, 2024 10:15
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.

4 participants