Skip to content

Commit 70fb0dd

Browse files
authored
add CI for vulnerability scanning (#939)
1 parent 3dd6f9e commit 70fb0dd

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/vulnerabilities.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check vulnerabilities
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
pull_request:
8+
branches:
9+
- master
10+
paths-ignore:
11+
- '!**.md'
12+
release:
13+
types:
14+
- released
15+
16+
jobs:
17+
clone:
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Setup Python
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: 3.8
24+
architecture: x64
25+
- name: Checkout pycsw
26+
uses: actions/checkout@master
27+
28+
vulnerabilities:
29+
needs: [clone]
30+
runs-on: ubuntu-22.04
31+
32+
steps:
33+
- name: Scan vulnerabilities with trivy
34+
run: |
35+
sudo apt-get install -y wget apt-transport-https gnupg lsb-release
36+
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null
37+
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
38+
sudo apt-get update
39+
sudo apt-get install -y trivy
40+
trivy --exit-code 1 fs --scanners vuln,misconfig,secret --severity HIGH,CRITICAL --ignore-unfixed .

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Build Status](https://github.com/geopython/pycsw/workflows/build%20%E2%9A%99%EF%B8%8F/badge.svg)](https://github.com/geopython/pycsw/actions)
55
[![Join the chat at https://gitter.im/geopython/pycsw](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/geopython/pycsw)
66
[![Documentation](https://readthedocs.org/projects/pycsw/badge/)](https://docs.pycsw.org)
7+
[![Vulnerabilities](https://github.com/geopython/pycsw/actions/workflows/vulnerabilities.yml/badge.svg)](https://github.com/geopython/pycsw/actions/workflows/vulnerabilities.yml)
78

89
[pycsw](https://pycsw.org) is an OGC API - Records and CSW server implementation written in Python.
910

0 commit comments

Comments
 (0)