shodan_idb: enrich CVE findings with severity and CVSS#3082
Open
shodan_idb: enrich CVE findings with severity and CVSS#3082
Conversation
Per-CVE severity and CVSS are looked up from Shodan's CVEDB and rendered inline in the FINDING description (sorted highest-CVSS first). Lookups are cached per-scan to avoid duplicate requests. Overall FINDING severity is hard-coded to INFO since shodan_idb only matches banners and does not confirm exploitability.
| finding = finding_events[0] | ||
| description = finding.data["description"] | ||
| # host appears in the description | ||
| assert "blacklanternsecurity.com" in description |
|
|
||
| # CVEDB should be hit exactly once per unique CVE; the duplicate CVE-2021-26857 | ||
| # in vulns must hit the cache rather than triggering a second request. | ||
| cvedb_requests = [r for r in module_test.httpx_mock.get_requests() if "cvedb.shodan.io" in str(r.url)] |
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary+ 1 improvement 🚀
23 unchanged ✅🔍 Significant Changes (>10%)
🐍 Python Version 3.11.15 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #3082 +/- ##
=====================================
- Coverage 91% 91% -0%
=====================================
Files 439 439
Lines 37533 37598 +65
=====================================
+ Hits 33940 33993 +53
- Misses 3593 3605 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MEDIUMand a description that listed only CVE IDs and no host. This change fetches per-CVE severity and CVSS from Shodan's CVEDB (no API key) and renders them inline in the description, sorted highest-CVSS first.INFOsince shodan_idb only matches Shodan banners and does not confirm exploitability — escalating toCRITICALbased on a banner-derived CVE list is misleading.Example FINDING (live scan against a host with 17 OpenSSH CVEs):