Skip to content

Commit d4a52cc

Browse files
authored
Qualysv2: added start date to the test-module (demisto#34026)
* added start date to the test-module * added rn * improvements * update docker
1 parent 5981297 commit d4a52cc

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

Packs/qualys/Integrations/Qualysv2/Qualysv2.py

+23-18
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
ASSETS_FETCH_FROM = '90 days'
3131
MIN_ASSETS_INTERVAL = 59
3232
HOST_LIMIT = 1000
33+
TEST_FROM_DATE = 'one day'
3334

3435
ASSETS_DATE_FORMAT = '%Y-%m-%d'
3536
DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ" # ISO8601 format with UTC, default in XSOAR
@@ -1304,7 +1305,7 @@
13041305
"qualys-virtual-host-manage": {
13051306
"args": ["action", "ip", "network_id", "port", "fqdn"],
13061307
},
1307-
"test-module": {"args": []},
1308+
"test-module": {"args": ["launched_after_datetime"]},
13081309
"qualys-host-list-detection": {
13091310
"args": [
13101311
"ids",
@@ -3048,23 +3049,27 @@ def test_module(client: Client, params: dict[str, Any], first_fetch_time: str) -
30483049
Returns:
30493050
str: 'ok' if test passed, anything else will raise an exception and will fail the test.
30503051
"""
3051-
build_args_dict(None, COMMANDS_ARGS_DATA["test-module"], False)
3052-
client.command_http_request(COMMANDS_API_DATA["test-module"])
3053-
3054-
if params.get('isFetchEvents'):
3055-
fetch_events(
3056-
client=client,
3057-
last_run={},
3058-
first_fetch_time=first_fetch_time,
3059-
max_fetch=1,
3060-
fetch_function=get_activity_logs_events,
3061-
newest_event_field=ACTIVITY_LOGS_NEWEST_EVENT_DATETIME,
3062-
next_page_field=ACTIVITY_LOGS_NEXT_PAGE,
3063-
previous_run_time_field=ACTIVITY_LOGS_SINCE_DATETIME_PREV_RUN,
3064-
)
3065-
if params.get('isFetchAssets'):
3066-
since_datetime = arg_to_datetime('3 days').strftime(ASSETS_DATE_FORMAT) # type: ignore[union-attr]
3067-
fetch_assets(client=client, since_datetime=since_datetime)
3052+
is_fetch_events = params.get('isFetchEvents') or False
3053+
is_fetch_assets = params.get('isFetchAssets') or False
3054+
3055+
if is_fetch_assets or is_fetch_events:
3056+
if is_fetch_events:
3057+
fetch_events(
3058+
client=client,
3059+
last_run={},
3060+
first_fetch_time=first_fetch_time,
3061+
max_fetch=1,
3062+
fetch_function=get_activity_logs_events,
3063+
newest_event_field=ACTIVITY_LOGS_NEWEST_EVENT_DATETIME,
3064+
next_page_field=ACTIVITY_LOGS_NEXT_PAGE,
3065+
previous_run_time_field=ACTIVITY_LOGS_SINCE_DATETIME_PREV_RUN,
3066+
)
3067+
if is_fetch_assets:
3068+
since_datetime = arg_to_datetime('3 days').strftime(ASSETS_DATE_FORMAT) # type: ignore[union-attr]
3069+
fetch_assets(client=client, since_datetime=since_datetime)
3070+
else:
3071+
build_args_dict({'launched_after_datetime': TEST_FROM_DATE}, COMMANDS_ARGS_DATA["test-module"], False)
3072+
client.command_http_request(COMMANDS_API_DATA["test-module"])
30683073

30693074
return 'ok'
30703075

Packs/qualys/Integrations/Qualysv2/Qualysv2.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2821,7 +2821,7 @@ script:
28212821
required: true
28222822
description: Gets assets from Qualys.
28232823
name: qualys-get-assets
2824-
dockerimage: demisto/python3:3.10.14.90585
2824+
dockerimage: demisto/python3:3.10.14.92207
28252825
isfetchevents: true
28262826
isfetchassets: true
28272827
runonce: false

Packs/qualys/ReleaseNotes/3_0_1.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
#### Integrations
3+
##### Qualys VMDR
4+
- Fixed an issue where **test** failed on timeout.
5+
- Updated the Docker image to: *demisto/python3:3.10.14.92207*.

Packs/qualys/pack_metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Qualys",
33
"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",
44
"support": "xsoar",
5-
"currentVersion": "3.0.0",
5+
"currentVersion": "3.0.1",
66
"author": "Cortex XSOAR",
77
"url": "https://www.paloaltonetworks.com/cortex",
88
"email": "",

0 commit comments

Comments
 (0)