From a84a4048150e7084df8707183af00832cb701675 Mon Sep 17 00:00:00 2001 From: luijait Date: Sun, 23 Jun 2024 17:38:11 +0200 Subject: [PATCH] 1. Requirements.txt fixed, 2. Setup.py Dependencies Fixed, 3.CVESearch(base_url=) fix --- .devcontainer/docker-compose.yml | 8 ++++++++ .env | 1 + .devcontainer/Dockerfile => Dockerfile | 9 +++++++-- rvd_tools/cli.py | 13 +++++++++---- setup.py | 6 ++++-- 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .devcontainer/docker-compose.yml create mode 100644 .env rename .devcontainer/Dockerfile => Dockerfile (79%) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..4a83fa7 --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3' +services: + app: + build: + context: . + dockerfile: Dockerfile + env_file: + - ../.env \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 0000000..e8b1df0 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +GITHUB_TOKEN="ADD_YOUR_GH_TOKEN_HERE" \ No newline at end of file diff --git a/.devcontainer/Dockerfile b/Dockerfile similarity index 79% rename from .devcontainer/Dockerfile rename to Dockerfile index cc517bd..ddc6161 100644 --- a/.devcontainer/Dockerfile +++ b/Dockerfile @@ -1,12 +1,17 @@ FROM ubuntu:20.04 # [Optional] Uncomment this section to install additional OS packages. + RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends \ - net-tools python3 python3-pip python3-dev \ - curl gnupg nmap less git aarch64-linux-gnu-gcc wget + net-tools python3 python3-pip python3-dev \ + curl gnupg nmap less git gcc-aarch64-linux-gnu wget build-essential RUN pip3 install Cython + +# Copy the parent directory of the current directory into the Docker image +COPY . /workspace/RDV +WORKDIR /workspace/RDV ## SOURCE INSTALL ## Install babeltrace from sources: # diff --git a/rvd_tools/cli.py b/rvd_tools/cli.py index a09e255..5a458cb 100644 --- a/rvd_tools/cli.py +++ b/rvd_tools/cli.py @@ -580,7 +580,7 @@ def cve_validate(version, file): @click.option("--product", default=None, help="Product to research.") @click.option("--push/--no-push", default=False, help="Push to RVD in a new ticket.") @cve.command("search") -def cve_search(all, vendor, product, push): +def cve_search(all, vendor, product, push, base_url=None): """ Search CVEs and CPEs from cve-search enabled DB, import them. @@ -590,14 +590,19 @@ def cve_search(all, vendor, product, push): Makes use of the following: - https://github.com/cve-search/PyCVESearch - (indirectly) https://github.com/cve-search/cve-search + + :param base_url: The base URL for the CVE search API (required). If not provided, the default URL will be used. """ # cve = CVESearch() cyan("Searching for CVEs and CPEs with cve-search ...") from pycvesearch import CVESearch + if base_url is None: + base_url = "https://cvepremium.circl.lu/" + if all: if vendor: - cve = CVESearch() + cve = CVESearch(base_url=base_url) vendor_flaws = cve.browse(vendor) products = vendor_flaws["product"] for product in products: @@ -666,7 +671,7 @@ def cve_search(all, vendor, product, push): return if vendor and product: - cve = CVESearch() + cve = CVESearch(base_url=base_url) cyan("Searching for vendor/product: ", end="") print(vendor + "/" + product) results = cve.search(vendor + "/" + product) @@ -725,7 +730,7 @@ def cve_search(all, vendor, product, push): pusher.update_ticket(issue, new_flaw) elif vendor: - cve = CVESearch() + cve = CVESearch(base_url=base_url) cyan("Browsing for vendor: ", end="") print(vendor) # pprint.pprint(cve.browse(vendor)) diff --git a/setup.py b/setup.py index ee62511..df324a3 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ "dedupe==1.10.0", "jsonschema", "mergedeep", - "numpy", + "numpy==1.17.3", "plotly", #"pprint", "pygithub", @@ -23,13 +23,15 @@ "pyyaml==6.0", "qprompt", "retrying", + "dedupe-variable-datetime==0.1.0", "tabulate", "retrying", "vulners", "xmltodict", + "zope.index==5.2", "importlib-resources", "python-gitlab==2.0.0", - "requests==2.23.0", + "requests==2.32.0", "pycvesearch==1.0", "cvsslib@git+https://github.com/aliasrobotics/RVSS#egg=cvsslib", ],