Skip to content

Commit 4c827c2

Browse files
ENH: Add vulnerability scan workflow with grype
* Add GitHub Actions workflow that runs a vulnerability scan with grype (https://github.com/anchore/grype) on the conda packages in the Pixi environment. Check for installed versions that have releases with known fixes. * Add .grype.yaml to ignore python packages and focus on conda-forge conda packages.
1 parent 7c719ad commit 4c827c2

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/grype.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Vulnerability scans
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'pixi.lock'
9+
- '.github/workflows/grype.yml'
10+
pull_request:
11+
paths:
12+
- 'pixi.lock'
13+
- '.github/workflows/grype.yml'
14+
schedule:
15+
# Sunday at 01:59 UTC
16+
- cron: '59 01 * * 0'
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
grype-scan:
25+
name: "Scan action pixi environment"
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30+
31+
- name: Set up pixi
32+
uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
33+
with:
34+
locked: true
35+
36+
- name: Scan with grype
37+
run: pixi exec grype .pixi/envs/default --only-fixed --fail-on high

.grype.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ignore:
2+
- package:
3+
# only show vulnerabilities from conda-forge conda packages
4+
type: python

0 commit comments

Comments
 (0)