Skip to content

Commit

Permalink
Qualysv2: added start date to the test-module (demisto#34026)
Browse files Browse the repository at this point in the history
* added start date to the test-module

* added rn

* improvements

* update docker
  • Loading branch information
moishce authored Apr 22, 2024
1 parent 5981297 commit d4a52cc
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
41 changes: 23 additions & 18 deletions Packs/qualys/Integrations/Qualysv2/Qualysv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
ASSETS_FETCH_FROM = '90 days'
MIN_ASSETS_INTERVAL = 59
HOST_LIMIT = 1000
TEST_FROM_DATE = 'one day'

ASSETS_DATE_FORMAT = '%Y-%m-%d'
DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ" # ISO8601 format with UTC, default in XSOAR
Expand Down Expand Up @@ -1304,7 +1305,7 @@
"qualys-virtual-host-manage": {
"args": ["action", "ip", "network_id", "port", "fqdn"],
},
"test-module": {"args": []},
"test-module": {"args": ["launched_after_datetime"]},
"qualys-host-list-detection": {
"args": [
"ids",
Expand Down Expand Up @@ -3048,23 +3049,27 @@ def test_module(client: Client, params: dict[str, Any], first_fetch_time: str) -
Returns:
str: 'ok' if test passed, anything else will raise an exception and will fail the test.
"""
build_args_dict(None, COMMANDS_ARGS_DATA["test-module"], False)
client.command_http_request(COMMANDS_API_DATA["test-module"])

if params.get('isFetchEvents'):
fetch_events(
client=client,
last_run={},
first_fetch_time=first_fetch_time,
max_fetch=1,
fetch_function=get_activity_logs_events,
newest_event_field=ACTIVITY_LOGS_NEWEST_EVENT_DATETIME,
next_page_field=ACTIVITY_LOGS_NEXT_PAGE,
previous_run_time_field=ACTIVITY_LOGS_SINCE_DATETIME_PREV_RUN,
)
if params.get('isFetchAssets'):
since_datetime = arg_to_datetime('3 days').strftime(ASSETS_DATE_FORMAT) # type: ignore[union-attr]
fetch_assets(client=client, since_datetime=since_datetime)
is_fetch_events = params.get('isFetchEvents') or False
is_fetch_assets = params.get('isFetchAssets') or False

if is_fetch_assets or is_fetch_events:
if is_fetch_events:
fetch_events(
client=client,
last_run={},
first_fetch_time=first_fetch_time,
max_fetch=1,
fetch_function=get_activity_logs_events,
newest_event_field=ACTIVITY_LOGS_NEWEST_EVENT_DATETIME,
next_page_field=ACTIVITY_LOGS_NEXT_PAGE,
previous_run_time_field=ACTIVITY_LOGS_SINCE_DATETIME_PREV_RUN,
)
if is_fetch_assets:
since_datetime = arg_to_datetime('3 days').strftime(ASSETS_DATE_FORMAT) # type: ignore[union-attr]
fetch_assets(client=client, since_datetime=since_datetime)
else:
build_args_dict({'launched_after_datetime': TEST_FROM_DATE}, COMMANDS_ARGS_DATA["test-module"], False)
client.command_http_request(COMMANDS_API_DATA["test-module"])

return 'ok'

Expand Down
2 changes: 1 addition & 1 deletion Packs/qualys/Integrations/Qualysv2/Qualysv2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,7 @@ script:
required: true
description: Gets assets from Qualys.
name: qualys-get-assets
dockerimage: demisto/python3:3.10.14.90585
dockerimage: demisto/python3:3.10.14.92207
isfetchevents: true
isfetchassets: true
runonce: false
Expand Down
5 changes: 5 additions & 0 deletions Packs/qualys/ReleaseNotes/3_0_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

#### Integrations
##### Qualys VMDR
- Fixed an issue where **test** failed on timeout.
- Updated the Docker image to: *demisto/python3:3.10.14.92207*.
2 changes: 1 addition & 1 deletion Packs/qualys/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Qualys",
"description": "Qualys Vulnerability Management let's you create, run, fetch and manage reports, launch and manage vulnerability and compliance scans, and manage the host assets you want to scan for vulnerabilities and compliance",
"support": "xsoar",
"currentVersion": "3.0.0",
"currentVersion": "3.0.1",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down

0 comments on commit d4a52cc

Please sign in to comment.