qualys_vmdr: make QDS parameter opt-out - #20438
Conversation
|
💚 CLA has been signed |
ReviewersBuildkite won't run for external contributors automatically; you need to add a comment:
NOTE: https://github.com/elastic/integrations/blob/main/.buildkite/pull-requests.json contains all those details. |
c386665 to
6cb3fb8
Compare
asset_host_detection hardcoded show_qds=1 and show_qds_factors=1 on every
Host List Detection request. Qualys rejects both parameters with error 1901
("Unrecognized parameter(s)") when they are not available to the subscription
or API user, failing the whole request rather than degrading, so no detections
are ingested.
Neither parameter appears in the allowed-parameter list returned with the 1901
response, so they must be omitted entirely - sending show_qds=0 fails the same
way.
Add a show_qds variable (bool, default true) and include both parameters only
when it is enabled. Defaulting to true keeps existing policies behaving exactly
as 6.19.1. The ingest pipeline already null-guards vulnerability.QDS and
vulnerability.QDS_FACTORS, so no pipeline changes are needed when absent.
Qualys doc: https://docs.qualys.com/en/vm/qweb-all-api/appendix/appendix_d.htm
6cb3fb8 to
c93d678
Compare
|
/test |
The asset_host_detection system tests only exercised requests that carry show_qds=1 and show_qds_factors=1 - every rule in the mock service config matches on both - so the disabled path added in 6.19.2 had no coverage. Add test-ahd-no-qds-config.yml (show_qds: false, ids=9, hit_count: 2) and a matching mock rule whose query params omit both parameters, returning a host whose detections have no QDS or QDS_FACTORS elements. This reproduces the request shape that an affected subscription rejects with error 1901. The rule is keyed on ids=9 so it cannot be confused with the existing ids=1,2,3 and id_min=77777777 rules, and its detections use QIDs 102 and 103 so the existing knowledge base rule for ids=102,103 serves the follow-up request without new fixtures.
| }).with( | ||
| // Qualys rejects show_qds and show_qds_factors with error 1901 | ||
| // when they are not available in the subscription, | ||
| // so they must be omitted entirely rather than sent as 0. | ||
| state.?show_qds.orValue(true) ? | ||
| { | ||
| "show_qds": ["1"], | ||
| "show_qds_factors": ["1"], | ||
| } | ||
| : | ||
| {} | ||
| ).format_query() |
There was a problem hiding this comment.
Instead of doing this, set them in the object with:
?"show_qds": state.show_qds ? optional.of(["1"]) : optional.none(),
?"show_qds": state.show_qds ? optional.of(["1"]) : optional.none(),
Note that you do not need to use optional type access for state.show_qds since it's always set by the config, and making it optional would allow a regression to silently change the behaviour rather than crash.
fb9ffa5 to
11cfca6
Compare
11cfca6 to
c2ffacd
Compare
2462863 to
d989230
Compare
|
/test |
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
|
|
Tick the box to add this pull request to the merge queue (same as
|
|
Package qualys_vmdr - 6.19.3 containing this change is available at https://epr.elastic.co/package/qualys_vmdr/6.19.3/ |
Type of change: bug
Proposed commit message
qualys_vmdr: make QDS parameter opt-out
asset_host_detection hardcoded show_qds=1 and show_qds_factors=1 on every Host List Detection request. Qualys rejects both parameters with error 1901 ("Unrecognized parameter(s)") when they are not available to the subscription or API user.
Add a show_qds variable (bool, default true) and send the two parameters only when it is enabled omitting them entirely,
Defaulting to true keeps existing policies behaving exactly as 6.19.1.
Qualys doc: https://docs.qualys.com/en/vm/qweb-all-api/appendix/appendix_d.htm
Checklist
changelog.ymlfile.Author's Checklist
show_qdsdefaults totrue, so existing policies keep sending bothparameters and QDS field population is unchanged on upgrade.
rather than sent as
0— Qualys does not accept them at any value on anaffected subscription.
How to test this PR locally
Related issues
N/A
Screenshots
Error observed on Qualys API: