GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — Fix CVEs by removing unused OS packages and updating dependencies by moshemorad · Pull Request #545 · robusta-dev/krr Conversation
Contributor
SummaryThis PR addresses multiple CVEs in the krr container image and its dependencies by removing unused OS packages and updating vulnerable transitive dependencies to patched versions. Key ChangesDockerfile
pyproject.toml
requirements.txt
Implementation Details
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsScanned both images with Trivy and remediated per policy: all CRITICAL and HIGH findings, plus MEDIUM findings older than 60 days. 50 of the 69 in-policy findings are resolved; the krr image goes from 4 CRITICAL / 33 HIGH / 191 total to 0 CRITICAL / 7 HIGH / 86 total. The enforcer image already scanned clean (0 findings across 39 Alpine and 64 Python packages) and is unchanged. Dependency bumps (requirements.txt, pyproject.toml, poetry.lock): - pillow 12.2.0 -> 12.3.0, clearing 10 HIGH and 3 MEDIUM - pyasn1 0.6.3 -> 0.6.4, clearing CVE-2026-59885 and CVE-2026-59886 (HIGH) - setuptools 80.9.0 -> 83.0.0. setuptools >=81 vendors jaraco.context 6.1.0 and wheel 0.46.3, which clears CVE-2026-23949 and CVE-2026-24049 (both HIGH, reachable only through setuptools' bundled copies) plus CVE-2026-59890 pillow and pyasn1 are transitive (via matplotlib and google-auth), so they are now pinned explicitly in pyproject.toml to hold the fixed floors. poetry.lock was regenerated with Poetry 1.8.5 to keep lock-version 2.0, matching the existing file; only these three package entries change. Dockerfile: the remaining OS findings all sit in Debian trixie packages with no fixed version published, and apt-get upgrade is a verified no-op, so the only remedy is to stop shipping the packages. perl-base (4 CRITICAL, 4 HIGH, 4 MEDIUM) and the util-linux family (CVE-2026-53615 HIGH plus 2 MEDIUM each) are unused by this pure-Python app and are now purged. dpkg exits non-zero on essential-package warnings even when every removal succeeds, so the layer verifies each removal explicitly and then smoke-tests the interpreter and bash rather than trusting the exit code. ncurses is deliberately kept: bash links libtinfo.so.6, and removing it leaves the image without a working shell for kubectl/docker exec. login cannot be removed at all (dpkg protected). Those account for 5 of the 7 remaining HIGH findings; gzip and libacl1 are the other two. Verified on linux/amd64: 55/55 tests pass, image builds, krr version and --help run, and numpy/pandas/matplotlib/pillow import and render. The purge layer and the three bumped packages were checked on linux/arm64 as well. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6
|
There was an error while loading. Please reload this page.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughUpdates Python dependency pins and adds a Docker build step that purges selected Debian packages, removes apt lists, verifies package removal, and runs runtime sanity checks. ChangesSecurity hardening
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Dockerfile`:
- Around line 50-54: Update the package-state validation loop in the Dockerfile
to query each package with dpkg-query’s ${db:Status-Status} field and accept
only an absent or not-installed result. Reject installed, config-files-only,
unpacked, half-configured, and any other non-absent state, while preserving the
existing failure message and exit behavior.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c1b6188b-7a54-45eb-94d1-63c4a6b35e8d
poetry.lock is excluded by !**/*.lockDockerfilepyproject.tomlrequirements.txt
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
reminder to test before next release
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Removing libuuid1 disables CPython's optional _uuid C accelerator; the stdlib uuid module falls back to its pure-Python implementation by design. Nothing in krr or its dependencies calls uuid1()/generate_time_safe (the only paths _uuid accelerates), and krr itself only imports the UUID class for parsing. The build-time verification now exercises uuid4/uuid1/getnode through the fallback so a future base-image change that breaks it fails the build instead of shipping. Also record why removing mount/util-linux cannot affect Kubernetes volume, secret or configmap mounts: the container runtime performs them on the host via mount(2) before the container rootfs starts, and never execs the in-image mount binary. Verified by running the purged image with bind, tmpfs and read-only-rootfs mounts. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6
The previous grep on dpkg -l only matched ii/hi states, so a package left in a partial state (half-installed, unpacked) after the intentionally-ignored dpkg exit code could slip through. Query db:Status-Status and accept only absent or not-installed. Addresses the review comment on PR #545. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6
There was an error while loading. Please reload this page.
…rew update chain (#560) ## Summary Every release since v1.29.0 hung for 24h and was cancelled, and every binary since v1.30.0 crashes on startup. The Homebrew formula is still on v1.28.0. **1. Retired `macos-13` runner.** `build (macos-13)` never got a runner and was cancelled after 24h, which skipped `check-latest`, the hash jobs and `update-formula`. The Intel binary is now built on `macos-15-intel`. It still runs on macOS 10.13+ (highest `minos` across the bundle's Mach-O files), because minimum versions come from the prebuilt Python, wheels and PyInstaller bootloader, not the runner. The Intel asset is now `krr-macos-15-intel-<tag>.zip`; nothing references the old name. **2. Binaries crash since v1.30.0.** ``` AttributeError: module 'pkg_resources' has no attribute 'NullProvider' [PYI-...:ERROR] Failed to execute script 'pyi_rth_pkgres' due to unhandled exception! ``` #545 bumped setuptools 80.9.0 → 83.0.0 (CVE fixes). setuptools 83 no longer ships `pkg_resources`, but upgrading the runner's preinstalled setuptools leaves an empty `pkg_resources/` dir. PyInstaller bundles it as a namespace package plus its `pyi_rth_pkgres` hook, which crashes. Builds now pass `--exclude-module pkg_resources` (nothing krr uses needs it; setuptools stays on 83). A `Smoke test the binary` step runs `krr version` after each build. **3. Homebrew update chain.** - Hash jobs use `$GITHUB_OUTPUT` instead of the deprecated `::set-output`. - `if: needs.check-latest.outputs.IS_LATEST` was always true (job outputs are strings, and "false" is truthy). Now compares to `'true'`. - `excludes: prerelease,draft`: get-latest-release v0.7.0 splits on `,` without trimming, so `" draft"` never excluded drafts. - New `brew-test` job (macOS + Linux): installs the new formula from a local tap pointed at the zips just built, runs `brew test`, and checks `krr version` prints the tag. `update-formula` needs it, so a formula that doesn't install is never pushed. - `update-formula` fails instead of writing a missing or malformed sha256; the commit message includes the tag (`TAG_NAME` was never set there). **4. Dry-run support.** Release-only steps (asset upload, Apple certificate, tap push) are guarded by `github.event_name == 'release'` and the tag comes from `RELEASE_TAG`, so the workflow can run as a dry run on a PR. The `pull_request` trigger was used to test this PR and then removed; add it back to dry-run future workflow changes. **5. Hardening.** `permissions: contents: read` by default, `contents: write` only for `build`. `persist-credentials: false` on the build and `brew-test` checkouts. `actions/checkout` v4, `actions/setup-python` v5 (actionlint flagged v2). ## Tests performed - Published macOS (arm64) zips, `krr version`: v1.28.0 and v1.29.0 work; v1.30.0, v1.31.0, v1.31.1, v1.31.2 crash with the error above. - Local PyInstaller build (arm64 macOS, Python 3.11): clean venv works; with an empty `site-packages/pkg_resources/` it crashes with the exact CI error; `--exclude-module pkg_resources` fixes it. - `actionlint` passes. - Dry run 41858869705: all four builds got runners (incl. `macos-15-intel`) and smoke tests printed `pr-560`; hash outputs match the downloaded artifacts; `update-formula` printed the expected diff; push, asset upload and certificate steps skipped; homebrew-krr untouched; the CI-built macOS zip runs `krr version` / `krr simple --help` locally. - Dry run 41864839078: `brew-test` installed the formula on macOS and Linux (`krr version: pr-560`). `update-formula` was not scheduled in that run due to the GitHub Actions incident. - Dry run 41867739161 (commit 303f31f, last one before removing the PR trigger): all jobs passed; smoke tests and `brew-test` on macOS and Linux printed `pr-560`; `update-formula` printed the expected diff and skipped the push. - `otool -l` on the `macos-15-intel` build: highest minimum macOS across all Mach-O files is 10.13. - Not covered: release-only steps (asset upload, certificate import, tap push) will first run on the next release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.