fix(ci): resolve Trivy HIGH CVEs blocking Tier 2 Governance on main - #377
Merged
Conversation
Tier 2 Governance's Trivy scan has been failing on every main push (predates #376) on two HIGH CVEs neither traceable to app code: - msgpack 1.1.2 (GHSA-6v7p-g79w-8964): not our dependency — it's pip's own vendored copy at pip/_vendor/msgpack. - setuptools 70.3.0 (CVE-2025-47273): not installed anywhere — it's a version string in pip's _vendor/vendor.txt that Trivy's scanner parses as an installed package. pip is never invoked at runtime (entrypoint.sh only runs manage.py/ gunicorn), so strip it from the final image after the existing setuptools/wheel patch step. Also drop the now-pointless ensurepip bundled wheel, and pin msgpack==1.2.1 directly (transitive via pytest-bdd->gherkin-official, flagged separately). Verified locally: rebuilt image, Trivy --severity HIGH,CRITICAL --ignore-unfixed exits 0, and Django still boots with pip removed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tier 2 Governance's Trivy scan has been failing on every push to
main(predates #376 — the same two CVEs failed the prior push too) on two HIGH CVEs that trace back topipitself, not the app's real dependencies:msgpack 1.1.2(GHSA-6v7p-g79w-8964) — pip's own vendored copy atpip/_vendor/msgpack, not our installedmsgpack(already resolves to a clean version transitively).setuptools 70.3.0(CVE-2025-47273) — not installed anywhere; it's a version string in pip's_vendor/vendor.txtmanifest that Trivy's scanner parses as an "installed" package.pipis never invoked at container runtime (entrypoint.shonly runsmanage.py/gunicorn), so this strips it from the final image after the existing setuptools/wheel CVE-patch step. Also removes the now-pointlessensurepipbundled wheel (same class of issue), and pinsmsgpack==1.2.1directly since it's also a real (if separate) transitive dependency viapytest-bdd→gherkin-official.Changes
Dockerfile: drop ensurepip bundled wheels in thebasestage; removepipfrom theruntimestage after the setuptools/wheel upgrade.requirements.txt: pinmsgpack==1.2.1.Test plan
trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1→ exit code 0 (clean)msgpackresolves to 1.2.1 andsetuptoolsto 83.0.0 inside the built imageensurepip/_bundledis empty andpip/pip3are gone from the imagedjango.setup()) to confirm removing pip doesn't break the app🤖 Generated with Claude Code