Skip to content

Commit

Permalink
Merge pull request #3349 from luijait/fix_installs_23_06_24
Browse files Browse the repository at this point in the history
Fix Docker Install and setup.py dependencies
  • Loading branch information
vmayoral authored Jun 24, 2024
2 parents 80721f3 + a84a404 commit e3d2424
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
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

0 comments on commit e3d2424

Please sign in to comment.