Skip to content

Commit

Permalink
qualys_vmdr: use correct time format for last_modified_after parameter (
Browse files Browse the repository at this point in the history
#10759)

According to the Qualys documentation, the time format for query parameters
does not include sub-second resolution:

 The date/time is specified in YYYY-MM-DD[THH:MM:SSZ] format (UTC/GMT).

https://cdn2.qualys.com/docs/qualys-api-vmpc-user-guide.pdf
  • Loading branch information
efd6 authored Aug 12, 2024
1 parent 384b5c2 commit 09700b1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/qualys_vmdr/_dev/deploy/docker/files/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ rules:
methods: ['GET']
query_params:
ids: 123
last_modified_after: '{last_modified_after:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}}Z'
responses:
- status_code: 200
body: |-
Expand Down Expand Up @@ -302,6 +303,7 @@ rules:
- path: /api/2.0/fo/knowledge_base/vuln/
methods: ['GET']
query_params:
last_modified_after: '{last_modified_after:\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}}Z'
responses:
- status_code: 200
body: |-
Expand Down
5 changes: 5 additions & 0 deletions packages/qualys_vmdr/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "4.2.2"
changes:
- description: Ensure last_modified_after query parameter is in the correct format.
type: bugfix
link: https://github.com/elastic/integrations/pull/10759
- version: "4.2.1"
changes:
- description: Fix CEL access to unset state.params in knowledge_base.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ program: |
request("GET", state.url.trim_right("/") + "/api/2.0/fo/knowledge_base/vuln/?" +
state.?params.orValue("").parse_query().with({
"action": ["list"],
"last_modified_after": [state.?cursor.last_modified.orValue(string(now - duration(state.initial_interval)))],
"last_modified_after": [state.?cursor.last_modified.orValue((now - duration(state.initial_interval)).format(time_layout.RFC3339))],
}).format_query()
).with({
"Header":{
Expand Down
2 changes: 1 addition & 1 deletion packages/qualys_vmdr/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: "3.0.2"
name: qualys_vmdr
title: Qualys VMDR
version: "4.2.1"
version: "4.2.2"
description: Collect data from Qualys VMDR platform with Elastic Agent.
type: integration
categories:
Expand Down

0 comments on commit 09700b1

Please sign in to comment.