Qualys filter: CONTAINS instead of EQUALS for tag

This commit is contained in:
Pierre & Lumière 2026-04-14 14:48:29 +02:00
parent a331d16a12
commit a19281a771

View File

@ -546,7 +546,7 @@ def refresh_all_agents(db):
try: try:
r = requests.post( r = requests.post(
f"{qualys_url}/qps/rest/2.0/search/am/hostasset", f"{qualys_url}/qps/rest/2.0/search/am/hostasset",
json={"ServiceRequest": {"preferences": {"limitResults": 1000}, "filters": {"Criteria": [{"field": "tags.name", "operator": "EQUALS", "value": "server"}]}}}, json={"ServiceRequest": {"preferences": {"limitResults": 1000}, "filters": {"Criteria": [{"field": "tags.name", "operator": "CONTAINS", "value": "server"}]}}},
auth=(qualys_user, qualys_pass), auth=(qualys_user, qualys_pass),
verify=False, timeout=120, proxies=proxies, verify=False, timeout=120, proxies=proxies,
headers={"X-Requested-With": "PatchCenter", "Content-Type": "application/json"}) headers={"X-Requested-With": "PatchCenter", "Content-Type": "application/json"})