Skip to content

Translated the removed vpr_v2_score export filter to vpr_score - #1055

Merged
SteveMcGrath merged 4 commits into
tenable:mainfrom
lanz:RDC-25401-vpr-v2-score
Nov 6, 2026
Merged

SteveMcGrath merged 4 commits into
tenable:mainfrom
lanz:RDC-25401-vpr-v2-score

Conversation

@lanz

@lanz lanz commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description

Tenable removed the vpr_v2_score filter from the vulnerability and Web App Scanning export APIs on 2026-10-01. tio.exports.vulns(vpr_v2_score=...) and tio.exports.was(vpr_v2_score=...) still sent it, so every export that used it failed with 400 BAD_REQUEST_UNKNOWN_PROPERTY.

Evidence:

Source What it says
Vulnerability Priority Rating: Transition to VPR Version 2 (2026-04-17) vpr_v2_score will be deprecated. Use vpr_score, which reflects the updated VPR model from July 1, 2026.
Reminder: Vulnerability Priority Rating (VPR) Version 2 Transition on July 1 (2026-06-24) A reminder of the transition.
Final Reminder: vpr_v2 Fields Removed from Exports on October 1 (2026-09-10) vpr_v2_score and plugin.vpr_v2 are removed from both exports on 2026-10-01, and vpr_score reflects the enhanced VPR model.
Export vulnerabilities and Export findings These reference pages no longer list vpr_v2_score, and they carry a caution note that it was removed.
Live API vpr_v2_score returns 400 BAD_REQUEST_UNKNOWN_PROPERTY on both exports, and vpr_score is accepted.

The fix: translate and warn. vpr_score now uses the same VPR v2 model, so the vpr_v2_score argument is kept, and existing scripts keep working:

  • Translation: exports.vulns() and exports.was() send a vpr_v2_score value as vpr_score, with a warning that says to use vpr_score and that vpr_v2_score will be removed from pyTenable in the 2027.03 releases. stacklevel=2 points the warning at the caller.
  • Both arguments: passing vpr_score and vpr_v2_score together raises ValueError before any request is sent.
  • Filter models: the vpr_v2_score field is removed from VulnerabilityExportFiltersV1 and WASExportFiltersV1. The translation happens in the two methods.
  • Docstrings: both methods now document vpr_v2_score as deprecated, with its removal release. Before, it wasn't documented at all.

Calls without vpr_v2_score send exactly the same request as before. No new dependencies. CHANGELOG.md and tenable/version.py are untouched.

Release note: exports.vulns() and exports.was() now send a vpr_v2_score filter as vpr_score, with a warning, because Tenable removed vpr_v2_score from the export APIs on 2026-10-01.

Fixes #1054

Internal tracking: RDC-25401.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Passing both vpr_score and vpr_v2_score now raises locally. Before, the API rejected that request with 400 anyway, so this isn't a breaking change.

How Has This Been Tested?

Unit tests. They use responses and assert the request body.

  • Translation: exports.vulns(vpr_v2_score=...) and exports.was(vpr_v2_score=...) emit the deprecation warning and send filters.vpr_score, with no vpr_v2_score key.
  • No warning for vpr_score: exports.vulns(vpr_score=...) emits no warning. The test treats any warning as an error.
  • Both arguments: passing both raises ValueError with no request sent, for both methods.
  • Fail on main: all 4 new tests for vpr_v2_score fail against main. The vpr_score-only test passes there too, as expected.
  • Lint and suite: ruff check tenable is clean, and ruff format reports no changes in exports/api.py or exports/models.py. The full suite passes on 3.11, 3.12, 3.13 and 3.14: 2303 passed, 0 failed, 95.6–95.8% coverage.
  • Bandit: bandit -ll results are unchanged from main.
  • Docs: the Sphinx build is unchanged from main (the same 6 warnings), and the deprecated argument renders in both docstrings.

Live API tests. These ran against three Tenable Vulnerability Management test environments, using small export jobs cleaned up afterward. All 10 checks passed in each environment. After the review changes, the vulnerability and WAS checks were repeated in one environment: both exports finished, the status echoed vpr_score, and each call emitted one warning.

  • Accepted: with vpr_v2_score, both export types were accepted and finished.
  • One warning: each call emitted exactly one warning, attributed to the calling code.
  • Translated: the export status echoed vpr_score, not vpr_v2_score.
  • Same findings: each export returned exactly the same findings as the equivalent vpr_score export (13, 149 and 1,439 vulnerability findings; 5, 0 and 22 WAS findings).
  • Both arguments: passing both was rejected locally, and no export job was created.

Test Configuration:

  • Python Version(s) Tested: 3.11.16, 3.12.14, 3.13.15, 3.14.7 (Windows 11)
  • Tenable.sc version (if necessary): N/A

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules (none required)

…5401)

Tenable removed the vpr_v2_score filter from the vulnerability and WAS
export APIs on 2026-10-01, as announced in the 2026-09-10 changelog
"Final Reminder: vpr_v2 Fields Removed from Exports on October 1". The
API now rejects it with 400 BAD_REQUEST_UNKNOWN_PROPERTY, but
exports.vulns() and exports.was() still sent it.

vpr_score now uses the same VPR v2 model, so the vpr_v2_score argument
is kept for backward compatibility: its value is sent as vpr_score and a
DeprecationWarning is emitted. Passing both raises UnexpectedValueError.
The export filter models translate it the same way, because they ignore
unknown fields and would otherwise drop the filter silently.
@lanz
lanz requested a review from a team as a code owner October 29, 2026 04:42
Resolved the conflict in tests/io/exports/test_api.py, where this branch's vpr_v2_score tests and tenable#1051's cve_id tests were both appended at the end of the file. Both sets are kept.
@lanz

lanz commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Resolved the merge conflict in the tests.

Comment thread tenable/io/exports/models.py Resolved
Comment thread tenable/io/exports/models.py Resolved
Comment thread tenable/io/exports/models.py Resolved
Comment thread tenable/io/exports/api.py Resolved
Comment thread tenable/io/exports/api.py Resolved
Comment thread tenable/io/exports/api.py Resolved
@lanz lanz changed the title Translated the removed vpr_v2_score export filter to vpr_score (RDC-2… Translated the removed vpr_v2_score export filter to vpr_score Nov 6, 2026
@lanz
lanz requested a review from SteveMcGrath November 6, 2026 20:32
@SteveMcGrath
SteveMcGrath merged commit 0c6a9f9 into tenable:main Nov 6, 2026
9 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.

Bug: exports.vulns() and exports.was() still send the vpr_v2_score filter, which the API removed on 2026-10-01

2 participants