Skip to content

Fix Docker Install and setup.py dependencies #3349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2024
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
8 changes: 8 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
env_file:
- ../.env
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN="ADD_YOUR_GH_TOKEN_HERE"
9 changes: 7 additions & 2 deletions .devcontainer/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -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:
#
Expand Down
13 changes: 9 additions & 4 deletions rvd_tools/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dedupe==1.10.0",
"jsonschema",
"mergedeep",
"numpy",
"numpy==1.17.3",
"plotly",
#"pprint",
"pygithub",
Expand All @@ -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",
],
Expand Down