From c54c29504d98b2e2ee6a0fd807fda1974f372185 Mon Sep 17 00:00:00 2001 From: Paco Date: Mon, 15 Feb 2021 11:42:55 +0100 Subject: [PATCH 1/2] Update insert_vulnerability to meet new constrains --- deps/wazuh_testing/wazuh_testing/vulnerability_detector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deps/wazuh_testing/wazuh_testing/vulnerability_detector.py b/deps/wazuh_testing/wazuh_testing/vulnerability_detector.py index 5e059c11e0..1f902ab0bc 100644 --- a/deps/wazuh_testing/wazuh_testing/vulnerability_detector.py +++ b/deps/wazuh_testing/wazuh_testing/vulnerability_detector.py @@ -242,12 +242,12 @@ def update_last_scan(last_scan=0, agent="000"): def insert_hotfix(agent="000", scan_id=int(time()), scan_time=datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S"), - hotfix="000000"): + hotfix="000000", checksum="dummychecksum"): path = os.path.join(DB_PATH, f"{agent}.db") query_string = f'''INSERT INTO sys_hotfixes - (scan_id, scan_time, hotfix) + (scan_id, scan_time, hotfix, checksum) VALUES - ({scan_id}, "{scan_time}", "{hotfix}") + ({scan_id}, "{scan_time}", "{hotfix}", "checksum") ''' update_last_scan() metadata_query_string = f'update vuln_metadata set HOTFIX_SCAN_ID="{scan_id}"' From 99a08d917a2a08f62a6a9e1949e0c97fa3f10a89 Mon Sep 17 00:00:00 2001 From: Francisco Navarro Date: Mon, 15 Feb 2021 15:28:38 +0100 Subject: [PATCH 2/2] Fix typo in sqlite query Co-authored-by: Jonathan --- deps/wazuh_testing/wazuh_testing/vulnerability_detector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/wazuh_testing/wazuh_testing/vulnerability_detector.py b/deps/wazuh_testing/wazuh_testing/vulnerability_detector.py index 1f902ab0bc..a259a1b91e 100644 --- a/deps/wazuh_testing/wazuh_testing/vulnerability_detector.py +++ b/deps/wazuh_testing/wazuh_testing/vulnerability_detector.py @@ -247,7 +247,7 @@ def insert_hotfix(agent="000", scan_id=int(time()), scan_time=datetime.datetime. query_string = f'''INSERT INTO sys_hotfixes (scan_id, scan_time, hotfix, checksum) VALUES - ({scan_id}, "{scan_time}", "{hotfix}", "checksum") + ({scan_id}, "{scan_time}", "{hotfix}", "{checksum}") ''' update_last_scan() metadata_query_string = f'update vuln_metadata set HOTFIX_SCAN_ID="{scan_id}"'