Skip to content

Commit 22fa55d

Browse files
authored
fix: add severity score to Alpine vulns (#4043)
(based on NVD data)
1 parent a2307e8 commit 22fa55d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

vulnfeeds/cmd/alpine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ COPY ./go.sum /src/go.sum
2222
RUN go mod download
2323

2424
COPY ./ /src/
25-
RUN go build -o alpine ./cmd/alpine/
25+
RUN go build -o alpine-osv ./cmd/alpine/
2626

2727

2828
FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:alpine@sha256:cdac858d976cb0e6bfdc3288fee5a0a7bf6348a009089be130b2009e28463c52
2929

3030
WORKDIR /root/
31-
COPY --from=GO_BUILD /src/alpine ./
31+
COPY --from=GO_BUILD /src/alpine-osv ./
3232
COPY ./cmd/alpine/run_alpine_convert.sh ./
3333

3434
ENTRYPOINT ["/root/run_alpine_convert.sh"]

vulnfeeds/cmd/alpine/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ func generateAlpineOSV(allAlpineSecDb map[string][]VersionAndPkg, allCVEs map[cv
220220
logger.Warn(fmt.Sprintf("Skipping %s as no affected versions found.", v.ID), slog.String("cveID", cveID))
221221
continue
222222
}
223+
v.AddSeverity(cve.CVE.Metrics)
223224
osvVulnerabilities = append(osvVulnerabilities, v)
224225
}
225226

vulnfeeds/cmd/alpine/run_alpine_convert.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ echo "Begin syncing NVD data from GCS bucket ${INPUT_BUCKET}"
2323
gcloud --no-user-output-enabled storage -q cp "gs://${INPUT_BUCKET}/nvd/*-????.json" "${CVE_OUTPUT}"
2424
echo "Successfully synced from GCS bucket"
2525

26-
./alpine -output_bucket "$OUTPUT_BUCKET" -output_path "$OSV_OUTPUT_PATH" -num_workers "$WORKERS" -uploadToGCS
26+
./alpine-osv -output_bucket "$OUTPUT_BUCKET" -output_path "$OSV_OUTPUT_PATH" -num_workers "$WORKERS" -uploadToGCS
2727
echo "Successfully converted and uploaded to cloud"

0 commit comments

Comments
 (0)