Skip to content

Commit 6e77b25

Browse files
committed
Merge remote-tracking branch 'origin/main' into vulntotal
2 parents e54618d + e38eb1b commit 6e77b25

File tree

191 files changed

+15031
-8951
lines changed

Some content is hidden

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

191 files changed

+15031
-8951
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: 122 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,170 @@
11
Release notes
22
=============
33

4+
5+
6+
Version v30.3.1
7+
----------------
8+
9+
This is a minor bug fix release.
10+
11+
- We enabled proper CSRF configuration for deployments
12+
13+
14+
Version v30.3.0
15+
----------------
16+
17+
This is a feature update release including minor bug fixes and the introduction
18+
of API keys and API throttling.
19+
20+
- We enabled API throttling for a basic user and for a staff user
21+
they can have unlimited access on API.
22+
23+
- We added throttle rate for each API endpoint and it can be
24+
configured from the settings #991 https://github.com/nexB/vulnerablecode/issues/991
25+
26+
- We improved how we import NVD data
27+
- We refactored and made the purl2cpe script work to dump purl to CPE mappings
28+
29+
Internally:
30+
31+
- We aligned key names internally with the names used in the UI and API (such as affected and fixed)
32+
- We now use querysets as model managers and have streamlined view code
33+
34+
35+
Version v30.2.1
36+
----------------
37+
38+
- We refactored and fixed the LaunchPad API code.
39+
- We now ignore qualifiers and subpath from PURL search lookups.
40+
- We fixed severity table column spillover.
41+
42+
43+
Version v30.2.0
44+
----------------
45+
46+
This is a critical bug fix release including features updates.
47+
48+
- We fixed critical performance issues that made the web UI unusable. This include
49+
removing some less interesting redundant details displayed in the web UI for
50+
vulnerabilities.
51+
- We made minor documentation updates.
52+
- We re-enabled support for Arch linux, Debian, and Ubuntu security advisories importers
53+
- We added a new improver for Oval data sources
54+
- We improved Alpine linux and Gitlab security advisories importers
55+
56+
The summary of performance improvements include these fixes:
57+
58+
- Cascade queries from exact to approximate searches to avoid full table scans
59+
in all cases. This is a band-aid for now. The proper solution will likely
60+
require using full text search instead.
61+
- Avoid iceberg queries with "prefetch related" to limit the number of queries
62+
that are needed in the UI
63+
- Do not recreate querysets from scratch but instead allow these to be chained
64+
for simpler and correct code.
65+
- Remove extra details from the vulnerability pacge: each package was further
66+
listing its related vulnerabilities creating an iceberg query.
67+
- Enable the django-debug-toolbar with a setting to easily profile queries on demand
68+
by setting both VULNERABLECODE_DEBUG and VULNERABLECODE_DEBUG_TOOLBAR enviroment
69+
variables.
70+
71+
72+
Version v30.1.1
73+
----------------
74+
75+
- We added a new web UI link to explain how to obtain an API for the publicly
76+
hosted VulnerableCode
77+
78+
79+
Version v30.1.0
80+
----------------
81+
82+
- We added a new "/packages/all" API endpoint to get all Package URLs know to be vulnerable.
83+
84+
485
Version v30.0.0
586
----------------
687

88+
This is a major version that is not backward compatible.
89+
790
- We refactored the core processing with Importers that import data and Improvers that
891
transform imported data and convert that in Vulnerabilities and Packages. Improvers can
992
also improve and refine imported and existing data as well as enrich data using external
1093
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
94+
are available.
95+
1296
Because of these extensive changes, it is not possible to migrate existing imported
1397
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.
98+
or access the new public.vulnerablecode.io live instance. We also provide a database dump.
99+
100+
- You can track the progress of this refactoring in this issue:
101+
https://github.com/nexB/vulnerablecode/issues/597
15102

16103
- We added new data sources including PYSEC, GitHub and GitLab.
17104

18105
- We improved the documentation including adding development examples for importers and improvers.
19106

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.
107+
- We removed the ability to edit relationships from the UI. The UI is now read-only.
108+
109+
- We replaced the web UI with a brand new UI based on the same overall look and feel as ScanCode.io.
22110

23111
- We added support for NixOS as a Linux deployment target.
24112

25113
- The aliases of a vulnerabily are reported in the API vulnerabilities/ endpoint
26114

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

30117
- in the /api/vulnerabilities/ endpoint:
31118

32-
- Rename `resolved_packages` to `fixed_packages`
119+
- Rename `resolved_packages` to `fixed_packages`
33120
- Rename `unresolved_packages` to `affected_packages`
34121
- Rename `url` to `reference_url` in the reference list
122+
- Add is_vulnerable property in fixed and affected_packages.
35123

36124
- in the /api/packages/ endpoint:
37125

38126
- Rename `unresolved_vulnerabilities` to `affected_by_vulnerabilities`
39127
- Rename `resolved_vulnerabilities` to `fixing_vulnerabilities`
40128
- Rename `url` to `reference_url` in the reference list
129+
- Add new attribute `is_resolved`
130+
- Add namespace filter
41131

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

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

48-
- Added filters for vulnerabilities endpoint to get fixed packages in accordance to the details given in filters:
49-
For example:
50-
- /api/vulnerabilities?type=pypi&namespace=foo&name=bar
51-
will give only fixed versioned purls of this type `pkg:pypi/foo/bar`
139+
- We added filters for vulnerabilities endpoint to get fixed packages in accordance
140+
to the details given in filters: For example, when you call the endpoint this way
141+
``/api/vulnerabilities?type=pypi&namespace=foo&name=bar``, you will receive only
142+
fixed versioned purls of the type ``pypi``, namespace ``foo`` and name ``bar``.
52143

53144
- Package endpoint will give fixed packages of only those that
54145
matches type, name, namespace, subpath and qualifiers of the package queried.
55146

147+
- Paginated initial listings to display a small number of records
148+
and provided page per size with a maximum limit of 100 records per page.
149+
150+
- Add fixed packages in vulnerabilities details in packages endpoint.
151+
152+
- Add bulk search support for CPEs.
153+
154+
- Add authentication for REST API endpoint.
155+
The autentication is disabled by default and can be enabled using the
156+
VULNERABLECODEIO_REQUIRE_AUTHENTICATION settings.
157+
When enabled, users have to authenticate using
158+
their API Key in the REST API.
159+
Users can be created using the Django "createsuperuser" management command.
160+
161+
- The data license is now CC-BY-SA-4.0 as this is the highest common
162+
denominator license among all the data sources we collect and aggregate.
163+
56164
Other:
57165

58-
- we dropped calver to use a plain semver.
59-
- we adopted vers and the new univers library to handle version ranges.
166+
- We dropped calver to use a plain semver.
167+
- We adopted vers and the new univers library to handle version ranges.
60168

61169

62170
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/api.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.. _api:
2+
3+
API overview
4+
========================
5+
6+
7+
Browse the Open API documentation
8+
------------------------------------
9+
10+
- https://public.vulnerablecode.io/api/docs/ for documentation with Swagger
11+
- https://public.vulnerablecode.io/api/schema/ for the OpenAPI schema
12+
13+
14+
Enable the API key authentication
15+
------------------------------------
16+
17+
There is a setting VULNERABLECODEIO_REQUIRE_AUTHENTICATION for this. Use it this
18+
way::
19+
20+
$ VULNERABLECODEIO_REQUIRE_AUTHENTICATION=1 make run
21+
22+
23+
Create an API key-only user
24+
------------------------------------
25+
26+
This can be done in the admin and from the command line::
27+
28+
$ ./manage.py create_api_user --email "[email protected]" --first-name="Phil" --last-name "Goel"
29+
User [email protected] created with API key: ce8616b929d2adsddd6146346c2f26536423423491
30+
31+
32+
Access the API using curl
33+
-----------------------------
34+
35+
curl -X GET -H 'Authorization: Token <YOUR TOKEN>' https://public.vulnerablecode.io/api/
36+
37+
38+
API endpoints
39+
---------------
40+
41+
42+
There are two primary endpoints:
43+
44+
- packages/: this is the main endpoint where you can lookup vulnerabilities by package.
45+
46+
- vulnerabilities/: to lookup by vulnerabilities
47+
48+
And two secondary endpoints, used to query vulnerability aliases (such as CVEs)
49+
and vulnerability by CPEs: cpes/ and aliases/
50+

docs/source/command-line-interface.rst

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
Command Line Interface
44
======================
55

6-
The main entry point is Django's :guilabel:`manage.py` management commands.
6+
The main entry point is the Django :guilabel:`manage.py` management command script.
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::
1313

1414
$ ./manage.py --help
1515
...
1616
[vulnerabilities]
17-
create_cpe_to_purl_map
18-
importer
19-
improver
17+
import
18+
improve
19+
purl2cpe
20+
2021

2122
``$ ./manage.py <subcommand> --help``
2223
---------------------------------------
@@ -58,3 +59,17 @@ Other variations:
5859

5960
* ``--list`` List all available improvers
6061
* ``--all`` Run all available improvers
62+
63+
64+
65+
``$ ./manage.py purl2cpe --destination <directory``
66+
------------------------------------------
67+
68+
Dump a mapping of CPEs to PURLs grouped by vulnerability in the ``destination``
69+
directory.
70+
71+
72+
Other variations:
73+
74+
* ``--limit`` Limit the number of processed vulnerabilities
75+

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/contributing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Contributing to VulnerableCode
55

66
Thank you so much for being so interested in contributing to VulnerableCode. We
77
are always on the lookout for enthusiastic contributors like you who can make
8-
our project better, and we're willing to lend a helping hand if you have any
8+
our project better, and we are willing to lend a helping hand if you have any
99
questions or need guidance along the way. That being said, here are a few
1010
resources to help you get started.
1111

@@ -33,13 +33,13 @@ join our community. Below are some examples to get involved:
3333
First Timers
3434
^^^^^^^^^^^^
3535

36-
You are here to help, but you're a new contributor! No worries, we always
36+
You are here to help, but you are a new contributor! No worries, we always
3737
welcome newcomer contributors. We maintain some
3838
`good first issues <https://github.com/nexB/vulnerablecode/labels/good%20first%20issue>`_
3939
and encourage new contributors to work on those issues for a smooth start.
4040

4141
.. tip::
42-
If you're an open-source newbie, make sure to check the extra resources at
42+
If you are an open-source newbie, make sure to check the extra resources at
4343
the bottom of this page to get the hang of the contribution process!
4444

4545
Code Contributions
@@ -75,7 +75,7 @@ Other Ways
7575
^^^^^^^^^^
7676

7777
You want to contribute to other aspects of the VulnerableCode project, and you
78-
can't find what you're looking for! You can always discuss new topics, ask
78+
cannot find what you are looking for! You can always discuss new topics, ask
7979
questions, and interact with us and other community members on
8080
`AboutCode Gitter <https://gitter.im/aboutcode-org/discuss>`_ and `VulnerableCode Gitter <https://gitter.im/aboutcode-org/vulnerablecode>`_
8181

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/index.rst

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
VulnerableCode documentation
1+
Welcome to VulnerableCode!
22
=============================
33

4-
Welcome to VulnerableCode! In this documentation you’ll find information on:
4+
*VulnerableCode* provides an open database of software packages that are affected
5+
by known security vulnerabilities aka. *"vulnerable packages"*.
56

6-
- An overview of VulnerableCode
7+
VulnerableCode is also a free and open source software (FOSS) project that
8+
provides the tools to build this open database. The tools handle collecting,
9+
aggregating and correlating these vulnerabilities and relating them to a correct
10+
package version. Our project also supports a public cloud instance of this
11+
database - VulnerableCode.io.
12+
13+
In this documentation you will find information on:
14+
15+
- An overview of VulnerableCode and what you can do with it
716
- Installation instructions
817
- How to make technical contributions to the project and the community
918

@@ -33,6 +42,8 @@ Welcome to VulnerableCode! In this documentation you’ll find information on:
3342
reference_improver_overview
3443
reference_framework_overview
3544
command-line-interface
45+
importers_link
46+
api
3647

3748
.. toctree::
3849
:maxdepth: 1

0 commit comments

Comments
 (0)