-
-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a step in CI for CVEs scanning (#1478)
* Add a step in CI for CVEs scanning * Move the check for vulnerabilities on its own workflow * Clean the clone job and comment accepted risk * Add a badge for vulnerabilities clearance in the readme
- Loading branch information
1 parent
0a47ad2
commit 3c5a4cd
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Check vulnerabilities | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '!**.md' | ||
release: | ||
types: | ||
- released | ||
|
||
jobs: | ||
clone: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
architecture: x64 | ||
- name: Checkout pygeoapi | ||
uses: actions/checkout@master | ||
|
||
vulnerabilities: | ||
needs: [clone] | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Scan vulnerabilities with trivy | ||
run: | | ||
sudo apt-get install -y wget apt-transport-https gnupg lsb-release | ||
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null | ||
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 | ||
sudo apt-get update | ||
sudo apt-get install -y trivy | ||
trivy --exit-code 1 fs --scanners vuln,misconfig,secret --severity HIGH,CRITICAL --ignore-unfixed . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Accept the risk | ||
DS002 # Dockerfile with non-root user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters