Skip to content

Commit d00bf6d

Browse files
author
Sergey Vilgelm
committed
Audit Python packages for known vulnerabilities
1 parent 0f53873 commit d00bf6d

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
@@ -19,6 +19,20 @@ jobs:
1919
run: |
2020
python -m pip install --upgrade pip
2121
pip install ".[dev]"
22+
- name: Audit Python packages for known vulnerabilities
23+
run: |
24+
if ! type ossaudit; then
25+
echo "::warning ::ossaudit tool is not installed"
26+
exit 0
27+
fi
28+
if ! RES=$(ossaudit --installed --config setup.cfg); then
29+
RES="${RES//'%'/'%25'}"
30+
RES="${RES//$'\n'/'%0A'}"
31+
RES="${RES//$'\r'/'%0D'}"
32+
echo "::error ::${RES}"
33+
exit 1
34+
fi
35+
echo ${RES}
2236
- name: Test with inv
2337
run: inv cover qa
2438
- 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)