Repository navigation
Added plugin output, potential software vulnerability, and zero-day options to vulnerability exports - #1037
Merged
Conversation
- exports.vulns() accepts include_plugin_output, sent as a top-level boolean to POST /vulns/export. Setting it to False leaves the output property out of each exported finding. Omitting it keeps the previous payload. - Added the field to VulnerabilityExportV1. - Added tests for True, False, omitted, and invalid values.
…ts (RDC-25168) - exports.vulns() accepts include_software_vulns (top-level), plus the software_vulns_potential and software_vulns_potential_reasons filters. - software_vulns_potential_reasons accepts the six documented values in any casing and normalizes them, since the API matches them case-sensitively and silently returns no results for other casings. Empty lists and unknown values are rejected. - Combining software_vulns_potential=False with reasons raises a validation error before the request, instead of the API's 400 response. - Omitting the new arguments keeps the previous payload.
- exports.vulns() accepts the zero_day boolean filter. Omitting it keeps the previous payload. - The docstring explains that zero-day status comes from the CVEs on each finding's plugin, so True and False are not complements: in live testing on three tenants, findings whose plugin has no CVEs matched neither value, and findings whose plugin has several CVEs could match both. - Added tests for True, False, omitted, and invalid values.
SteveMcGrath
approved these changes
Oct 13, 2026
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.
Description
This adds five documented
POST /vulns/exportoptions totio.exports.vulns(). Today the method can't send them: it takes only explicit keyword arguments, and the export models useextra='forbid'. The implementation follows #1027 and #1033. Every new argument defaults toNoneand is left out of the request when unset, so existing calls send exactly the same payload as before.There's one commit per changelog feature, so each can be reviewed or reverted independently.
include_plugin_outputinclude_software_vulns;software_vulns_potential,software_vulns_potential_reasonsfilterszero_dayfiltersTwo behaviors found in live testing shaped the second commit:
software_vulns_potential_reasonsis case-sensitive on the server. The API accepts any casing without an error, but returns no results unless each value exactly matches the documented spelling (Managed,Component,Config Required,Low Fidelity,Incomplete Version,Backported). The model normalizes any casing to the documented spelling and rejects unknown values and empty lists, following the existingto_lower/to_uppervalidator pattern inmodels.py.software_vulns_potential=Falsecombined with reasons. It returns400 BAD_REQUEST_INVALID_VALUE, but only after the export is requested. A model validator raises aValidationErrorbefore any request is made.The
zero_daydocstring describes what the API actually does. Zero-day status comes from the CVEs on each finding's plugin, soTrueandFalsearen't complements: findings whose plugin has no CVEs match neither value, and findings whose plugin has several CVEs can match both.No new dependencies.
CHANGELOG.mdandtenable/version.pyare untouched.Fixes #1036
Internal tracking: RDC-25168.
Type of change
How Has This Been Tested?
Unit tests. They use
responsesand add no cassettes.include_plugin_output:TrueandFalseare sent at the top level, the key is left out when omitted, and invalid values raiseValidationError.exports.vulns()sends;software_vulns_potential=Falsewith reasons raises before the request is sent.zero_day:TrueandFalseare sent underfilters, the key is left out when omitted, and invalid values raiseValidationError.main, except the ones that check the payload is unchanged when an option is omitted. With normalization disabled, all four normalization tests fail.ruff check tenableis clean, and the full suite passes on 3.11, 3.12, 3.13 and 3.14: 2197 passed, 0 failed, 95.6–95.8% coverage.bandit -llreports no medium or high issues.main(exit 0, the same 3 intersphinx network warnings), and the new docstrings and examples render.Live API tests. These used the patched
exports.vulns()and its iterator against three Tenable Vulnerability Management environments, with ten-year export windows. All export jobs finished. The environment with software vulnerability data had 5180 findings.include_plugin_output=Falseremovedoutputfrom every finding in each environment (5180 and 558 findings).Truekept it.include_software_vulns=Trueaddedsoftware_vulnsto 648 findings.software_vulns_potential=Truereturned only findings whose software vulnerability entries are all potential (5).Falsereturned only confirmed ones (5175). The two exactly partition the 5180 findings.include_software_vulnsis omitted,FalseorTrue; onlyTrueincludes thesoftware_vulnsdata.software_vulns_potential_reasons=['managed']was normalized to['Managed']and returned the 5 matching findings; sent raw in lowercase, the API returned 0.software_vulns_potential=Falsewith reasons raisedValidationError, and no export job was created.zero_daywas accepted, echoed in the export status, and narrowed the results (True: 541,False: 1371 of 5180). Across three environments, every plugin's findings landed in the same result set. Plugins with no CVEs matched neither value in every case, and plugins matching both values always had two or more CVEs.Test Configuration:
Checklist: