Skip to content

fix(scanner): pin ramparts builder to rust:1-slim-bookworm (MCP-2395) - #665

Merged
Dumbris merged 2 commits into
mainfrom
fix/ramparts-glibc-bookworm
Jun 14, 2026
Merged

Dumbris merged 2 commits into
mainfrom
fix/ramparts-glibc-bookworm

Conversation

@Dumbris

@Dumbris Dumbris commented Jun 14, 2026

Copy link
Copy Markdown
Member

Problem

The ramparts scanner image build uses a two-stage Dockerfile:

  • Builder: FROM rust:1-slim (unpinned)
  • Runtime: FROM debian:bookworm-slim

The unpinned rust:1-slim tag recently moved to Debian trixie (glibc 2.41). The binary compiled there links symbols up to GLIBC_2.39, which bookworm's glibc 2.36 cannot satisfy. Every scan fails at startup with:

ramparts: /lib/aarch64-linux-gnu/libc.so.6: version GLIBC_2.39 not found

Fix

Pin the builder to rust:1-slim-bookworm so both stages share glibc 2.36.

-FROM rust:1-slim AS builder
+FROM rust:1-slim-bookworm AS builder

Verification

Tested locally on arm64:

image codename glibc
rust:1-slim (old builder) trixie 2.41
rust:1-slim-bookworm (new builder) bookworm 2.36 ✓
debian:bookworm-slim (runtime) bookworm 2.36 ✓

Built the image with the fix — ramparts --version exits 0 cleanly (no GLIBC error).

Known follow-up

During verification, discovered that ramparts v0.8.x changed from a file-based scanner (directory path) to a URL-based scanner (ramparts scan <url>). The current entrypoint uses flags (--output, --format sarif, path argument) that no longer exist in v0.8.x. That entrypoint compatibility issue is tracked separately — it is a pre-existing design gap independent of this GLIBC crash.

The unpinned rust:1-slim builder tag now resolves to Debian trixie
(glibc 2.41) while the runtime stage stays on debian:bookworm-slim
(glibc 2.36). The binary compiled on trixie links GLIBC_2.39 symbols
that bookworm cannot satisfy, causing every ramparts scan to fail with:
  ramparts: /lib/aarch64-linux-gnu/libc.so.6: version GLIBC_2.39 not found

Fix: pin the builder to rust:1-slim-bookworm so both build and runtime
stages share glibc 2.36.

Verified: docker build succeeds; `ramparts --version` exits 0 on the
resulting image (no GLIBC error). Noted separately that the ramparts
v0.8.x CLI has switched from file-based to URL-based scanning
(entrypoint CLI compat tracked as follow-up issue).

Co-Authored-By: Paperclip <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: bb6e93d
Status: ✅  Deploy successful!
Preview URL: https://21a2b565.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-ramparts-glibc-bookworm.mcpproxy-docs.pages.dev

View logs

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mcpproxy-gatekeeper mcpproxy-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Claude Code review (Codex out): ramparts builder glibc pin (MCP-2395). Reviewer verified fix + tests + CI green; VERDICT ACCEPT.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/ramparts-glibc-bookworm

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (14 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (21 MB)
  • installer-dmg-darwin-arm64 (19 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 27501643115 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

The rust:1-slim-bookworm pin invalidated the buildx cache, forcing a cold
cargo build of ramparts. Combined with the QEMU-emulated linux/arm64 leg
(~5-10x slower), the cold build exceeds the runner budget and the job is
cancelled mid-compile (last live line: Compiling want v0.3.1). Build
ramparts for linux/amd64 only via a per-scanner matrix platforms override;
the other (Python) scanners keep multi-arch.

Co-Authored-By: Paperclip <[email protected]>

@mcpproxy-gatekeeper mcpproxy-gatekeeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude review ACCEPT — build-unblock: ramparts restricted to linux/amd64 (QEMU arm64 cold-compile blew runner budget); GLIBC bookworm pin preserved; CI-config-only change, scanner code unchanged. Tradeoff: ramparts image amd64-only (emulated on arm64 hosts) — acceptable given ramparts also needs a separate v0.8.x URL-scanning follow-up.

@Dumbris
Dumbris enabled auto-merge (squash) June 14, 2026 16:22
@Dumbris
Dumbris merged commit b29a265 into main Jun 14, 2026
37 checks passed
Dumbris added a commit that referenced this pull request Jun 14, 2026
…ay shim (#670)

Ramparts v0.8.x dropped file/directory scanning: `ramparts scan <target>` now
requires a live MCP endpoint (URL or `stdio:`), and `scan`'s --format no longer
accepts `sarif` nor a `--output` flag. The container's entrypoint still ran the
stale `--format sarif --output FILE /scan/source`, so every scan failed even
after the image was unblocked (MCP-2395/#665).

Bridge the source-tree model to the new endpoint model without ever executing
the untrusted upstream (preserves the no-exec invariant, MCP-2206/#658):

- mcp-replay.py: a static MCP stdio server that replays the tool definitions
  MCPProxy already exports into /scan/source/tools.json (the same file the Cisco
  scanner consumes). entrypoint runs `ramparts scan stdio:python3:.../mcp-replay.py
  --format json`. Unit-tested against the rmcp handshake (initialize/tools-list/
  resources/prompts/ping/notifications/unknown-method/missing-file).
- Dockerfile: pin ramparts 0.8.2, ship its YARA `rules/`, `taxonomies/` and
  `config.yaml` (loaded relative to CWD — a binary-only image loads zero rules
  and finds nothing), and add a python3 runtime for the shim.
- engine.go: the rampartsIssue parser was also stale — v0.8.x serializes
  `issue_type`/`severity`/`message`/`details` (+ per-kind subject), not the old
  `type`/`impact`, so security_issues parsed with empty rule IDs and wrong
  severities. Updated to the v0.8.x shape; the yara_results path was already
  compatible. Parser proven end-to-end with a faithful v0.8.2 `--format json`
  fixture.
- registry: NetworkReq false (replay shim is local, YARA offline); refreshed
  description/comments.
- docs: refresh the ramparts design + the now-fixed/amd64-only arm64 note.

Full container E2E (built amd64 image vs a poisoned server) runs in CI/QA.

Related MCP-2422
Dumbris added a commit that referenced this pull request Jun 22, 2026
ramparts (GLIBC_2.39):
- Split CI matrix into per-arch native builds: ubuntu-latest for amd64,
  ubuntu-24.04-arm for arm64. Eliminates QEMU overhead that caused
  arm64 cargo-install to time out (MCP-2395), which left a stale
  arm64 manifest in GHCR linked against glibc 2.39 (trixie-era rust:1-slim).
- Add merge-ramparts job: assembles the multi-arch :latest manifest from
  :latest-amd64 + :latest-arm64 using docker buildx imagetools create.
- Dockerfile already has the bookworm pin (PR #665); no Dockerfile change needed.

trivy-mcp (vuln-DB download timeout):
- Add docker/scanners/trivy/Dockerfile: wraps ghcr.io/aquasecurity/trivy:latest
  and pre-caches the ~96 MiB vuln DB at build time via
  trivy image --download-db-only. TRIVY_CACHE_DIR=/trivy-cache baked in so
  runtime reads the same path without --cache-dir flags.
- Update registry_bundled.go: DockerImage -> ghcr.io/smart-mcp-proxy/scanner-trivy,
  Timeout 300s -> 120s (no download needed for fs scans), update NetworkReq comment.
- Add trivy to scanner-images.yml matrix (linux/amd64,linux/arm64).
- Add weekly cron schedule (Monday 03:00 UTC) so the pre-cached DB stays current.

Co-authored-by: Paperclip <[email protected]>
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.

2 participants