build(release): 기본 이미지를 noble로 올리고 이미지 검사를 취약점과 라이선스로 나눈다
pr / done (pull_request) Failing after 12m44s

문제: release 수동 실행(run 62)의 app-image-release가 Trivy에서 실패한다. 기본
이미지 eclipse-temurin:21-jre-jammy(ubuntu 22.04)에 고친 버전이 있는 OS 취약점
HIGH 7건(apt, libssl3/openssl, libbrotli1 등)과 OS 패키지 라이선스 HIGH 370건이
걸렸다. 앱 jar는 0건이다.

고른 방법(2026-11-11 소유자 결정 「권하는 안」):
- builder·runtime을 eclipse-temurin:21-{jdk,jre}-noble(ubuntu 24.04.5)의
  2026-10-29 digest로 올린다. noble 이미지에는 uid·gid 1000인 `ubuntu` 계정이
  있어, 앱 계정(uid 1000)을 만들기 전에 지운다. wget(healthcheck)과 C.UTF-8은
  noble에도 있다(desktop에서 확인).
- 취약점: OS·앱 모두 High/Critical이면 실패를 유지한다. 고친 버전이 있으면
  새 digest로 고치고, 아직 없는 것만 .trivyignore.yaml에 만료일 예외로 둔다.
- 라이선스: 앱 의존성(`--pkg-types library`)의 금지 라이선스(Trivy CRITICAL)만
  실패. OS 패키지 것을 포함한 나머지는 보고만 한다.
- 정책 문서(.github/dependency-vulnerability-policy.md)에 같은 내용을 적는다.

위험·한계: noble로 바꾸며 아직 고친 버전이 없는 High가 새로 보일 수 있다.
그때는 이유와 만료일을 달아 예외로 둔다. PR의 filesystem 검사는 그대로라
앱 의존성의 restricted(HIGH) 라이선스는 PR에서 여전히 막힌다.

검증: runner release 수동 실행의 app-image-release(이 PR 본문에 적는다),
desktop compose smoke(같은 Dockerfile로 qualification 이미지를 만든다).
This commit is contained in:
DongHyeonka
2026-11-12 01:18:24 +09:00
parent 96caf997f8
commit cfc80ae8d4
3 changed files with 37 additions and 10 deletions
+14 -3
View File
@@ -6,7 +6,8 @@
# bash scripts/ci/trivy-scan.sh filesystem dependency tree: block High/Critical, report
# Medium/Low, fail on any CISA KEV match
# bash scripts/ci/trivy-scan.sh image <reference> release image: write image-sbom.cdx.json,
# block High/Critical, report Medium/Low
# block High/Critical vulnerabilities and
# forbidden application licenses, report the rest
#
# Tools are pinned release binaries with an asserted SHA-256, installed under RUNNER_TEMP (or a
# temporary directory): a checksum is a supply-chain claim that can be checked offline, an action
@@ -97,8 +98,18 @@ scan_filesystem() {
scan_image() {
trivy image --format cyclonedx --scanners license --output image-sbom.cdx.json "$1"
test -s image-sbom.cdx.json
trivy image --scanners vuln,license --severity CRITICAL,HIGH --exit-code 1 --ignorefile .trivyignore.yaml "$1"
trivy image --scanners vuln,license --severity MEDIUM,LOW --exit-code 0 --ignorefile .trivyignore.yaml "$1"
# Vulnerabilities, OS and application packages alike: High or Critical fails the release. A
# finding with a fix is fixed (a newer base image digest or dependency); one with no fix yet is
# carried in .trivyignore.yaml with its expiry (owner decision 2026-11-11).
trivy image --scanners vuln --severity CRITICAL,HIGH --exit-code 1 --ignorefile .trivyignore.yaml "$1"
trivy image --scanners vuln --severity MEDIUM,LOW --exit-code 0 --ignorefile .trivyignore.yaml "$1"
# Licenses (same decision): an application dependency under a forbidden license (Trivy's
# CRITICAL) fails the release. Every other license finding, the OS packages' included, is
# reported and does not block: a distribution's GPL packages are not this application's terms.
trivy image --scanners license --pkg-types library --severity CRITICAL --exit-code 1 \
--ignorefile .trivyignore.yaml "$1"
trivy image --scanners license --severity HIGH,MEDIUM,LOW,UNKNOWN --exit-code 0 \
--ignorefile .trivyignore.yaml "$1"
}
case "${1:-}" in