mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-08-08 09:53:13 +02:00
fix(security): patch image CVEs and unbreak Scout SARIF uploads
- Build git-lfs with Go 1.25.12 (stdlib CVEs fixed in 1.25.10) and pull golang.org/x/net past the fix for CVE-2026-39821; x/net 0.54.0 was flagged critical in the image scan. - Cap SARIF relatedLocations at 100 per result before upload. GitHub rejects SARIF with >1000 related locations per result, and Docker Scout exceeds that for common OS packages, so every upload since May had failed silently (continue-on-error) and the Security tab was frozen on a stale scan. With uploads flowing again, already-fixed alerts (samlify, libgnutls via the existing apt-get upgrade) close on the next scan.
This commit is contained in:
@@ -251,6 +251,21 @@ jobs:
|
||||
write-comment: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# GitHub rejects SARIF files where a single result carries more than
|
||||
# 1000 relatedLocations, which Scout produces for widely-referenced OS
|
||||
# packages — every upload had been silently failing on this since May
|
||||
# ("rejecting SARIF, as there are more related locations per result than
|
||||
# allowed"). Cap them so uploads flow and stale alerts can auto-close.
|
||||
- name: Sanitize Scout SARIF (cap relatedLocations)
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if [ -f scout-results.sarif ]; then
|
||||
jq '(.runs[]?.results[]?) |= (if .relatedLocations then .relatedLocations |= .[:100] else . end)' \
|
||||
scout-results.sarif > scout-results.sanitized.sarif
|
||||
mv scout-results.sanitized.sarif scout-results.sarif
|
||||
fi
|
||||
|
||||
# Upload security scan results to GitHub Security tab
|
||||
- name: Upload Docker Scout scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v4
|
||||
|
||||
+2
-1
@@ -32,7 +32,7 @@ FROM debian:trixie-slim AS git-lfs-builder
|
||||
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
|
||||
wget ca-certificates git make \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
ARG GO_VERSION=1.25.9
|
||||
ARG GO_VERSION=1.25.12
|
||||
ARG GIT_LFS_VERSION=3.7.1
|
||||
RUN ARCH="$(dpkg --print-architecture)" \
|
||||
&& wget -qO /tmp/go.tar.gz "https://go.dev/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz" \
|
||||
@@ -44,6 +44,7 @@ ENV GOTOOLCHAIN=local
|
||||
RUN git clone --branch "v${GIT_LFS_VERSION}" --depth 1 https://github.com/git-lfs/git-lfs.git /tmp/git-lfs \
|
||||
&& cd /tmp/git-lfs \
|
||||
&& go get golang.org/x/crypto@latest \
|
||||
&& go get golang.org/x/net@latest \
|
||||
&& go mod tidy \
|
||||
&& make \
|
||||
&& install -m 755 /tmp/git-lfs/bin/git-lfs /usr/local/bin/git-lfs
|
||||
|
||||
Reference in New Issue
Block a user