Skip to content

Keep the apk package list so scanners see OS packages - #25

Merged
christophdb merged 1 commit into
mainfrom
fix/keep-apk-db-for-scanners
Nov 4, 2026
Merged

christophdb merged 1 commit into
mainfrom
fix/keep-apk-db-for-scanners

Conversation

@christophdb

@christophdb christophdb commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Summary

The image removes all of /lib/apk, including /lib/apk/db/installed, the list scanners read. Trivy therefore finds 0 OS packages, so its "0 OS CVEs" says nothing about the image.

This PR keeps /lib/apk/db and removes only /lib/apk/exec. /sbin/apk and /etc/apk stay removed, so apk remains unavailable. Under the permission model the server can't read the list either (ERR_ACCESS_DENIED).

Trivy 0.76.1, as in the workflow, on an otherwise identical image:

OS packages OS CVEs
Before 0 0 (not meaningful)
After 19 0

What changes for releases

  • The scan can now fail because of Alpine CVEs. The workflow pushes the image before it scans, so a new CVE can show up after an image has been published, also without a code change.
  • Possible false positives: apk-tools stays in the list although its binary is gone, and the same applies to busybox and its removed wget, nc and su.
  • Not covered: the Node runtime comes from /usr/local, not from apk, so it isn't among these packages.

Test plan

  • Image built from this branch: /lib/apk/db/installed present, /lib/apk/exec, /sbin/apk and /etc/apk absent
  • Container starts and /health responds
  • Trivy with the workflow's version sees the OS packages
  • Merge before tagging release-v1.9.3, so that its scan already covers OS packages

Independent of #24. Trivy reports 0 vulnerabilities for npm packages on this branch, although it still has zod 3.25.76, so only Docker Scout reports the zod CVE. The Trivy scan therefore can't confirm the fix in #24.

🤖 Generated with Claude Code

Removing /lib/apk also removed /lib/apk/db/installed, the list scanners
read. Trivy found 0 OS packages and reported 0 OS CVEs, which said
nothing about the image. /sbin/apk and /etc/apk stay removed, so apk
remains unavailable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@christophdb
christophdb merged commit 85aaab2 into main Nov 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant