Skip to content

Commit dc2f7d2

Browse files
author
Sergey Vilgelm
committed
Audit Python packages for known vulnerabilities
1 parent 3582c84 commit dc2f7d2

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ jobs:
2525
run: |
2626
python -m pip install --upgrade pip
2727
pip install ".[dev]"
28+
- name: Audit Python packages for known vulnerabilities
29+
run: |
30+
if ! type ossaudit; then
31+
echo "::warning ::ossaudit tool is not installed"
32+
exit 0
33+
fi
34+
if ! RES=$(ossaudit --installed --config setup.cfg); then
35+
RES="${RES//'%'/'%25'}"
36+
RES="${RES//$'\n'/'%0A'}"
37+
RES="${RES//$'\r'/'%0D'}"
38+
echo "::error ::${RES}"
39+
exit 1
40+
fi
41+
echo ${RES}
2842
- name: Test with inv
2943
run: inv cover qa
3044
- name: Coveralls

requirements/test.pip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ pytest-mock==1.10.4
1010
pytest-profiling==1.7.0
1111
pytest-sugar==0.9.2
1212
tzlocal
13+
ossaudit; python_version >= '3.5'

setup.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ python_classes = *Test *Benchmark
1414
markers =
1515
api: test requiring an initialized API
1616
request_context: switch the request
17+
18+
[ossaudit]
19+
# 06e60262-8241-42ef-8f64-e3d72091de19 - setuptools
20+
# the fix is released in the v40.8.0 of setuptools,
21+
# but the database is not updated yet.
22+
# Here is the ticket: https://github.com/OSSIndex/vulns/issues/58
23+
ignore-ids = 06e60262-8241-42ef-8f64-e3d72091de19

0 commit comments

Comments
 (0)