Skip to content

Commit 3478802

Browse files
chore: update OSV-Scanner to v2.0.2 (#397)
Also add a Makefile to allow vulnerability scans of dependencies to be run locally more easily. - `make scan` to scan all components. - `make component=core scan` to scan only the core component. - `make clean` to remove Gradle lockfiles used for scans.
1 parent d47a5ab commit 3478802

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ indent_size = 2
2222

2323
[.gitmodules]
2424
indent_style = tab
25+
26+
[Makefile]
27+
indent_style = tab

.github/workflows/pr.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ jobs:
5252
distribution: 'temurin'
5353
- name: Setup Gradle
5454
uses: gradle/actions/setup-gradle@v4
55-
- name: Create Gradle lockfile
56-
run: ./gradlew :${{ matrix.project }}:dependencies --write-locks
5755
- name: Scan
58-
run: docker run --rm -v "${PWD}/${{ matrix.project }}/gradle.lockfile:/gradle.lockfile" ghcr.io/google/osv-scanner:v2.0.0 scan --lockfile /gradle.lockfile
56+
run: make component=${{ matrix.project }} scan
5957
java:
6058
name: Build and Test Java
6159
runs-on: ubuntu-latest

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
5+
OSV_SCANNER_IMAGE := ghcr.io/google/osv-scanner:v2.0.2
6+
7+
.PHONY: scan
8+
scan:
9+
ifdef component
10+
./gradlew --quiet ':$(component):dependencies' --write-locks --configuration runtimeClasspath
11+
docker run --rm --volume './$(component)/gradle.lockfile:/gradle.lockfile' $(OSV_SCANNER_IMAGE) scan --lockfile /gradle.lockfile
12+
else
13+
$(MAKE) component=core scan
14+
$(MAKE) component=isthmus scan
15+
$(MAKE) component=isthmus-cli scan
16+
endif
17+
18+
.PHONY: clean
19+
clean:
20+
find . -depth 2 -type f -name gradle.lockfile -delete -print

0 commit comments

Comments
 (0)