Skip to content

Commit f6ddb32

Browse files
authored
Merge branch 'main' into parallel-importer
2 parents 1cbcd09 + 8e8624b commit f6ddb32

File tree

97 files changed

+11130
-6383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+11130
-6383
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@ Pipfile
102102
.ve
103103
*.bak
104104
/.cache/
105+
/tmp/

CHANGELOG.rst

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,103 @@
11
Release notes
22
=============
33

4+
5+
Version v30.1.1
6+
----------------
7+
8+
- We added a new web UI link to explain how to obtain an API for the publicly
9+
hosted VulnerableCode
10+
11+
12+
Version v30.1.0
13+
----------------
14+
15+
- We added a new "/packages/all" API endpoint to get all Package URLs know to be vulnerable.
16+
17+
418
Version v30.0.0
519
----------------
620

21+
This is a major version that is not backward compatible.
22+
723
- We refactored the core processing with Importers that import data and Improvers that
824
transform imported data and convert that in Vulnerabilities and Packages. Improvers can
925
also improve and refine imported and existing data as well as enrich data using external
1026
data sources. The migration to this new architecture is under way and not all importers
11-
are available. You can track the progress in this issue: https://github.com/nexB/vulnerablecode/issues/597
27+
are available.
28+
1229
Because of these extensive changes, it is not possible to migrate existing imported
1330
data to the new schema. You will need instead to restart imports from an empty database
14-
or request access to the new vulnerablecode.io live instance.
31+
or access the new public.vulnerablecode.io live instance. We also provide a database dump.
32+
33+
- You can track the progress of this refactoring in this issue:
34+
https://github.com/nexB/vulnerablecode/issues/597
1535

1636
- We added new data sources including PYSEC, GitHub and GitLab.
1737

1838
- We improved the documentation including adding development examples for importers and improvers.
1939

20-
- We removed the ability to edit relationships from the UI. The UI is now read-only
21-
and we will need to design a different UI for proper review and curation of vulnerabilities.
40+
- We removed the ability to edit relationships from the UI. The UI is now read-only.
41+
42+
- We replaced the web UI with a brand new UI based on the same overall look and feel as ScanCode.io.
2243

2344
- We added support for NixOS as a Linux deployment target.
2445

2546
- The aliases of a vulnerabily are reported in the API vulnerabilities/ endpoint
2647

27-
2848
- There are breaking Changes at API level with changes in the data structure:
2949

3050
- in the /api/vulnerabilities/ endpoint:
3151

3252
- Rename `resolved_packages` to `fixed_packages`
3353
- Rename `unresolved_packages` to `affected_packages`
3454
- Rename `url` to `reference_url` in the reference list
55+
- Add is_vulnerable property in fixed and affected_packages.
3556

3657
- in the /api/packages/ endpoint:
3758

3859
- Rename `unresolved_vulnerabilities` to `affected_by_vulnerabilities`
3960
- Rename `resolved_vulnerabilities` to `fixing_vulnerabilities`
4061
- Rename `url` to `reference_url` in the reference list
62+
- Add new attribute `is_resolved`
63+
- Add namespace filter
4164

42-
- We have provided backward compatibility for `url` and `unresolved_vulnerabilities` for now
65+
- We have provided backward compatibility for `url` and `unresolved_vulnerabilities` for now.
66+
These will be removed in the next major version and should be considered as deprecated.
4367

44-
- There is a new experimental cpe/ API endpoint to lookup for vulnerabilities by CPE and
68+
- There is a new experimental `cpe/` API endpoint to lookup for vulnerabilities by CPE and
4569
another aliases/ endpoint to lookup for vulnerabilities by aliases. These two endpoints will be
4670
replaced by query parameters on the main vulnerabilities/ endpoint when stabilized.
4771

72+
- We added filters for vulnerabilities endpoint to get fixed packages in accordance
73+
to the details given in filters: For example, when you call the endpoint this way
74+
``/api/vulnerabilities?type=pypi&namespace=foo&name=bar``, you will receive only
75+
fixed versioned purls of the type ``pypi``, namespace ``foo`` and name ``bar``.
76+
77+
- Package endpoint will give fixed packages of only those that
78+
matches type, name, namespace, subpath and qualifiers of the package queried.
79+
80+
- Paginated initial listings to display a small number of records
81+
and provided page per size with a maximum limit of 100 records per page.
82+
83+
- Add fixed packages in vulnerabilities details in packages endpoint.
84+
85+
- Add bulk search support for CPEs.
86+
87+
- Add authentication for REST API endpoint.
88+
The autentication is disabled by default and can be enabled using the
89+
VULNERABLECODEIO_REQUIRE_AUTHENTICATION settings.
90+
When enabled, users have to authenticate using
91+
their API Key in the REST API.
92+
Users can be created using the Django "createsuperuser" management command.
93+
94+
- The data license is now CC-BY-SA-4.0 as this is the highest common
95+
denominator license among all the data sources we collect and aggregate.
4896

4997
Other:
5098

51-
- we dropped calver to use a plain semver.
52-
- we adopted vers and the new univers library to handle version ranges.
99+
- We dropped calver to use a plain semver.
100+
- We adopted vers and the new univers library to handle version ranges.
53101

54102

55103
Version v20.10

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ sqlite:
109109
@$(MAKE) migrate
110110

111111
run:
112-
${MANAGE} runserver 8001 --noreload --insecure
112+
${MANAGE} runserver 8001 --insecure
113113

114114
test:
115115
@echo "-> Run the test suite"

docs/source/command-line-interface.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Command Line Interface
66
The main entry point is Django's :guilabel:`manage.py` management commands.
77

88
``$ ./manage.py --help``
9-
-----------------------
9+
------------------------
1010

1111
Lists all sub-commands available, including Django built-in commands.
1212
VulnerableCode's own commands are listed under the ``[vulnerabilities]`` section::

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# -- Project information -----------------------------------------------------
1919

2020
project = "VulnerableCode"
21-
copyright = "nexb Inc. and others"
22-
author = "nexb Inc. and others"
21+
copyright = "nexB Inc. and others"
22+
author = "nexB Inc. and others"
2323

2424

2525
# -- General configuration ---------------------------------------------------

docs/source/importers_link.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _importers_link:
2+
3+
Importers
4+
=========
5+
6+
.. include:: ../../SOURCES.rst

docs/source/installation.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Local development installation
109109
Supported Platforms
110110
^^^^^^^^^^^^^^^^^^^
111111

112-
**VulnerableCode* has been tested and is supported on the following operating systems:
112+
**VulnerableCode** has been tested and is supported on the following operating systems:
113113

114114
#. **Debian-based** Linux distributions
115115
#. **macOS** 12.1 and up
@@ -122,7 +122,7 @@ Pre-installation Checklist
122122

123123
Before you install VulnerableCode, make sure you have the following prerequisites:
124124

125-
* **Python: 3.8+* found at https://www.python.org/downloads/
125+
* **Python: 3.8+** found at https://www.python.org/downloads/
126126
* **Git**: most recent release available at https://git-scm.com/
127127
* **PostgreSQL**: release 10 or later found at https://www.postgresql.org/ or
128128
https://postgresapp.com/ on macOS
@@ -212,8 +212,6 @@ application.
212212
This setup is **not suitable for deployments** and **only supported for local
213213
development**.
214214

215-
An overview of the web application usage is available at :ref:`user_interface`.
216-
217215

218216
Upgrading
219217
^^^^^^^^^

docs/source/introduction.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ VulnerableCode is a work-in-progress towards a free and open vulnerabilities
77
database and the packages they impact and the tools to aggregate and correlate
88
these vulnerabilities.
99

10-
Why VulnerableCode ?
11-
---------------------
10+
Why VulnerableCode?
11+
-------------------
1212

1313
The existing solutions are commercial proprietary vulnerability databases, which
1414
in itself does not make sense because the data is about FOSS (Free and Open
@@ -27,12 +27,12 @@ security issues because:
2727
fundamental questions "Is package foo vulnerable" and "Is package foo
2828
vulnerable to vulnerability bar?"
2929

30-
How does it work ?
31-
-------------------
30+
How does it work?
31+
-----------------
3232

3333
VulnerableCode independently aggregates many software vulnerability data sources
3434
and supports data re-creation in a decentralized fashion. These data sources
35-
(see complete list `here <./SOURCES.rst>`_) include security advisories
35+
(see complete list :ref:`here <importers_link>`) include security advisories
3636
published by Linux and BSD distributions, application software package managers
3737
and package repositories, FOSS projects, GitHub and more. Thanks to this
3838
approach, the data is focused on specific ecosystems yet aggregated in a single
@@ -59,14 +59,17 @@ exposure due to various reasons like but not limited to the complicated
5959
procedure to receive CVE ID or not able to classify a bug as a security
6060
compromise.
6161

62-
Recent presentations:
6362

64-
- `Open Source Summit 2020 <https://github.com/nexB/vulnerablecode/blob/main/docs/Presentations/Why-Is-There-No-Free-Software-Vulnerability-Database-v1.0.pdf>`_
63+
Is VulnerableCode being actively developed?
64+
-------------------------------------------
6565

66-
Should I use VulnerableCode ?
67-
-------------------------------
66+
Yes -- VulnerableCode is a work in progress! Please stay in touch on our `Gitter channel <https://gitter.im/aboutcode-org/vulnerablecode>`_; and if you have any feedback, feel free to `enter an issue in our GitHub repo <https://github.com/nexB/vulnerablecode/issues>`_.
6867

69-
VulnerableCode is a work in progress project and will likely go through major changes. Please stay in touch on our `Gitter channel <https://gitter.im/aboutcode-org/vulnerablecode>`_
68+
69+
Recent presentations
70+
--------------------
71+
72+
- `Open Source Summit 2020 <https://github.com/nexB/vulnerablecode/blob/main/docs/Presentations/Why-Is-There-No-Free-Software-Vulnerability-Database-v1.0.pdf>`_
7073

7174
.. Some of this documentation is borrowed from the metaflow documentation and is also
7275
under Apache-2.0

docs/source/misc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Here is an example::
1717

1818
[Service]
1919
Type=oneshot
20-
ExecStart=/path/to/venv/bin/python /path/to/vulnerablecode/manage.py import --all
20+
ExecStart=/path/to/venv/bin/python /path/to/vulnerablecode/manage.py import --all && /path/to/venv/bin/python /path/to/vulnerablecode/manage.py improve --all
2121

2222
$ cat ~/.config/systemd/user/vulnerablecode.timer
2323

docs/source/reference_importer_overview.rst

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,33 @@
33
Importer Overview
44
==================
55

6-
Importers are responsible to scrape vulnerability data from various data sources without creating
7-
a complete relational model between vulnerabilites, their fixes and store them in a structured
8-
fashion.
6+
Importers are responsible for scraping vulnerability data such as vulnerabilities and their fixes
7+
and for storing the scraped information in a structured fashion. The structured data created by the
8+
importer then provides input to an improver (see :ref:`improver-overview`), which is responsible
9+
for creating a relational model for vulnerabilities, affected packages and fixed packages.
910

10-
All importer implementation related code is defined in :file:`vulnerabilites/importer.py`.
11+
All importer implementation-related code is defined in :file:`vulnerabilites/importer.py`.
1112

12-
Whereas, the framework related code for actually invoking and processing the importers are
13-
situated in :file:`vulnerabilites/import_runner.py`.
13+
In addition, the framework-related code for actually invoking and processing the importers is
14+
located in :file:`vulnerabilites/import_runner.py`.
1415

15-
The importers, after scraping, provide with ``AdvisoryData`` objects. These objects are then
16+
The importers, after scraping, provide ``AdvisoryData`` objects. These objects are then
1617
processed and inserted into the ``Advisory`` model.
1718

1819
While implementing an importer, it is important to make sure that the importer does not alter the
19-
upstream data at all. Its only job is to convert the data from a data source into structured - yet
20-
non relational - data. The importers must **not** be smart or performing trickeries
21-
under the hood.
22-
This ensures that we always have a *true* copy of an advisory without any speculations or
23-
improvements.
20+
upstream data at all. Its only job is to convert the data from a data source into structured -- yet
21+
non-relational -- data. This ensures that we always have a *true* copy of an advisory without any
22+
modifications.
2423

25-
As importers do not speculate and given that a lot of advisories publish version ranges of affected
24+
Given that a lot of advisories publish version ranges of affected
2625
packages, it is necessary to store those ranges in a structured manner. *Vers* was designed to
2726
solve this problem. It has been implemented in the `univers <https://github.com/nexB/univers>`_
2827
library whose development goes hand in hand with VulnerableCode.
2928

30-
The data imported by importers is not useful by itself, it must be processed into a relational
31-
model. The version ranges are required to be dissolved into concrete ranges. These are achieved by
32-
``Improvers``. For more, see: :ref:`improver-overview`
29+
The data imported by importers is not useful by itself: it must be processed into a relational
30+
model. The version ranges are required to be resolved into concrete ranges. These are achieved by
31+
``Improvers`` (see :ref:`improver-overview` for details).
3332

34-
As of now, the following importers have been implemented in VulnerableCode
33+
As of now, the following importers have been implemented in VulnerableCode:
3534

3635
.. include:: ../../SOURCES.rst

0 commit comments

Comments
 (0)