Skip to content

Commit 2d11906

Browse files
authored
Merge branch 'main' into Vuln
2 parents 8fad52e + ab99939 commit 2d11906

153 files changed

Lines changed: 27802 additions & 348 deletions

File tree

Some content is hidden

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

.VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
refs=$Format:%D$
2-
commit=$Format:%H$
2+
commit=$Format:%h$
33
abbrev_commit=$Format:%H$

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ docker-compose.yml
66

77

88
# Ignore Git directory and files and github directory.
9-
**/.git
109
**/.gitignore
1110
**/.gitattributes
1211
**/.gitmodules

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.VERSION export-subst

.github/workflows/pypi-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
name: Create GH release
4848
needs:
4949
- build-pypi-distribs
50-
runs-on: ubuntu-20.04
50+
runs-on: ubuntu-22.04
5151

5252
steps:
5353
- name: Download built archives
@@ -67,7 +67,7 @@ jobs:
6767
name: Create PyPI release
6868
needs:
6969
- create-gh-release
70-
runs-on: ubuntu-20.04
70+
runs-on: ubuntu-22.04
7171

7272
steps:
7373
- name: Download built archives

CHANGELOG.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,51 @@
11
Release notes
22
=============
33

4+
Version v37.0.0
5+
---------------------
6+
7+
- This is a major version, this version introduces Advisory level details
8+
https://github.com/aboutcode-org/vulnerablecode/issues/1796
9+
https://github.com/aboutcode-org/vulnerablecode/issues/1393
10+
https://github.com/aboutcode-org/vulnerablecode/issues/1883
11+
https://github.com/aboutcode-org/vulnerablecode/issues/1882
12+
https://github.com/aboutcode-org/vulnerablecode/pull/1866
13+
- We have added new models AdvisoryV2, AdvisoryAlias, AdvisoryReference, AdvisorySeverity, AdvisoryWeakness, PackageV2 and CodeFixV2.
14+
- We are using ``avid`` as an internal advisory ID for uniquely identifying advisories.
15+
- We have a new route ``/v2`` which only support package search which has information on packages that are reported to be affected or fixing by advisories.
16+
- This version introduces ``/api/v2/advisories-packages`` which has information on packages that are reported to be affected or fixing by advisories.
17+
- Pipeline Dashboard improvements #1920.
18+
- Throttle API requests based on user permissions #1909.
19+
- Add pipeline to compute Advisory ToDos #1764
20+
21+
Version v36.1.3
22+
---------------------
23+
24+
- Increase docker shared memory size #1896
25+
26+
27+
Version v36.1.2
28+
---------------------
29+
30+
- Get tag from VERSION manifest #1895
31+
32+
33+
Version v36.1.1
34+
---------------------
35+
36+
- Update is_active help text in pipeline migration #1887
37+
38+
39+
Version v36.1.0
40+
---------------------
41+
42+
- Remove admin panel #1885
43+
- Support running pipelines in scheduled task queue #1871
44+
- Optimize export management command #1868
45+
- Fix alpine linux importer #1861
46+
- Stop github OSV importer crashes #1854
47+
- Make advisory content_id a unique field #1864
48+
449

550
Version v36.0.0
651
---------------------

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,21 @@ ENV PYTHONDONTWRITEBYTECODE 1
1717

1818
RUN mkdir -p /var/vulnerablecode/static
1919

20+
RUN apt-get update \
21+
&& apt-get install -y --no-install-recommends \
22+
wait-for-it \
23+
&& apt-get clean \
24+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
25+
2026
# Keep the dependencies installation before the COPY of the app/ for proper caching
2127
COPY setup.cfg setup.py requirements.txt pyproject.toml /app/
2228
RUN pip install . -c requirements.txt
2329

2430
COPY . /app
31+
32+
# Store commit hash for docker deployment from local checkout.
33+
RUN if [ -d ".git" ]; then \
34+
GIT_COMMIT=$(git rev-parse --short HEAD) && \
35+
echo "VULNERABLECODE_GIT_COMMIT=\"$GIT_COMMIT\"" >> /app/vulnerablecode/settings.py; \
36+
rm -rf .git; \
37+
fi

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ACTIVATE?=. ${VENV}/bin/activate;
2929
VIRTUALENV_PYZ=etc/thirdparty/virtualenv.pyz
3030
# Do not depend on Python to generate the SECRET_KEY
3131
GET_SECRET_KEY=`base64 /dev/urandom | head -c50`
32+
GET_ALTCHA_HMAC_KEY=`head -c 32 /dev/urandom | xxd -p -c 32`
3233
# Customize with `$ make envfile ENV_FILE=/etc/vulnerablecode/.env`
3334
ENV_FILE=.env
3435
# Customize with `$ make postgres VULNERABLECODE_DB_PASSWORD=YOUR_PASSWORD`
@@ -63,6 +64,7 @@ envfile:
6364
@if test -f ${ENV_FILE}; then echo ".env file exists already"; exit 1; fi
6465
@mkdir -p $(shell dirname ${ENV_FILE}) && touch ${ENV_FILE}
6566
@echo SECRET_KEY=\"${GET_SECRET_KEY}\" > ${ENV_FILE}
67+
@echo ALTCHA_HMAC_KEY=\"${GET_ALTCHA_HMAC_KEY}\" >> ${ENV_FILE}
6668

6769
isort:
6870
@echo "-> Apply isort changes to ensure proper imports ordering"

docker-compose.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ services:
99
volumes:
1010
- db_data:/var/lib/postgresql/data/
1111
- ./etc/postgresql/postgresql.conf:/etc/postgresql/postgresql.conf
12+
shm_size: 1gb
13+
14+
vulnerablecode_redis:
15+
image: redis
16+
volumes:
17+
- vulnerablecode_redis_data:/data
18+
restart: always
1219

1320
vulnerablecode:
1421
build: .
@@ -26,6 +33,31 @@ services:
2633
depends_on:
2734
- db
2835

36+
vulnerablecode_scheduler:
37+
build: .
38+
command: wait-for-it web:8000 -- python ./manage.py run_scheduler
39+
env_file:
40+
- docker.env
41+
volumes:
42+
- /etc/vulnerablecode/:/etc/vulnerablecode/
43+
depends_on:
44+
- vulnerablecode_redis
45+
- db
46+
- vulnerablecode
47+
48+
vulnerablecode_rqworker:
49+
build: .
50+
command: wait-for-it web:8000 -- python ./manage.py rqworker default
51+
env_file:
52+
- docker.env
53+
volumes:
54+
- /etc/vulnerablecode/:/etc/vulnerablecode/
55+
depends_on:
56+
- vulnerablecode_redis
57+
- db
58+
- vulnerablecode
59+
60+
2961
nginx:
3062
image: nginx
3163
ports:
@@ -44,4 +76,5 @@ services:
4476
volumes:
4577
db_data:
4678
static:
79+
vulnerablecode_redis_data:
4780

docker.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ POSTGRES_PASSWORD=vulnerablecode
44

55
VULNERABLECODE_DB_HOST=db
66
VULNERABLECODE_STATIC_ROOT=/var/vulnerablecode/static/
7+
8+
VULNERABLECODE_REDIS_HOST=vulnerablecode_redis

docs/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
"https://example.org/api/non-existent-packages",
3939
"https://github.com/aboutcode-org/vulnerablecode/pull/495/commits",
4040
"https://nvd.nist.gov/products/cpe",
41+
"https://ftp.suse.com/pub/projects/security/yaml/suse-cvss-scores.yaml",
42+
"http://ftp.suse.com/pub/projects/security/yaml/",
4143
]
4244

4345
# Add any Sphinx extension module names here, as strings. They can be

0 commit comments

Comments
 (0)