Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions examples/nessus_integration/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
from cyberwatch_api import Cyberwatch_Pyhelper
from cbw_helper import *
import sys
from cbw_helper import (
PARSE_CONFIG,
NESSUS_API,
cbw_clearNessusData,
cbw_createAirgapAsset,
cbw_retrieveSecurityIssue,
cbw_deleteSecurityIssue,
cbw_createSecurityIssue
)
import urllib3
urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequestWarning)

Expand Down Expand Up @@ -48,8 +54,8 @@
URL = '{}/scans/{}/hosts/{}/plugins/{}'.format(NESSUS_URL, SCAN["id"], HOST_ID, PLUGIN)
RESPONSE = NESSUS_API(URL)
CVE_LIST = list(set(CVE_LIST + next(ref["values"]["value"] for ref in NESSUS_API(URL).json()["info"]["plugindescription"]["pluginattributes"]["ref_information"]["ref"] if ref["name"] == "cve")))
except:
next
except Exception:
pass

#####
# If it is the first time we find the host, we save it. Otherwise, we just append the found CVEs
Expand Down
1 change: 1 addition & 0 deletions examples/remove_assets_based_on_last_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""Remove assets on a cyberwatch instance based on the number of days of the last communication.
"""

from datetime import datetime, timedelta
from cyberwatch_api import Cyberwatch_Pyhelper

def get_assets():
Expand Down