Skip to content

Commit ee1fc4c

Browse files
Sergey VilgelmSteadBytes
Sergey Vilgelm
authored andcommitted
Audit Python packages for known vulnerabilities
1 parent 014eb95 commit ee1fc4c

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

.github/workflows/test.yml

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ jobs:
2222
run: |
2323
python -m pip install --upgrade pip
2424
pip install ".[dev]"
25+
- name: Audit Python packages for known vulnerabilities
26+
run: |
27+
if ! RES=$(ossaudit --installed --config setup.cfg); then
28+
RES="${RES//'%'/'%25'}"
29+
RES="${RES//$'\n'/'%0A'}"
30+
RES="${RES//$'\r'/'%0D'}"
31+
echo "::error ::${RES}"
32+
exit 1
33+
fi
34+
echo ${RES}
2535
- name: Format with black
2636
run: |
2737
if ! RES=$(black --check $(git diff --name-only --diff-filter=AM master -- "*.py") 2>&1); then

requirements/test.pip

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pytest-mock==1.10.4
1010
pytest-profiling==1.7.0
1111
pytest-sugar==0.9.2
1212
tzlocal
13-
1413
invoke==1.3.0
1514
readme-renderer==24.0
1615
twine==1.15.0
16+
ossaudit; python_version >= '3.5'

setup.cfg

+8
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ python_classes = *Test *Benchmark
99
markers =
1010
api: test requiring an initialized API
1111
request_context: switch the request
12+
13+
[ossaudit]
14+
15+
# The issue is fixed since the v40.8.0 of setuptools, but
16+
# the python3.5 and python3.6 use the old versions.
17+
# https://ossindex.sonatype.org/vuln/06e60262-8241-42ef-8f64-e3d72091de19
18+
# Ignore it until we suppor python < 3.7
19+
ignore-ids = 06e60262-8241-42ef-8f64-e3d72091de19

0 commit comments

Comments
 (0)