Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release-sbom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ name: Release SBOM
# can check against the exact digest that was pulled.
#
# The SBOM covers only the Rust dependency graph (from rust-junosmcp's
# Cargo.toml), not the image's runtime base (gcr.io/distroless/cc-debian13:
# glibc, libgcc, libssl, ca-certificates). Call it a "Rust dependency SBOM"
# Cargo.toml), not the image's runtime base (gcr.io/distroless/base-nossl-debian13:
# glibc, libgcc, ca-certificates). Call it a "Rust dependency SBOM"
# anywhere a reader might otherwise take it as a full image SBOM.
#
# Triggered on `release: published`, matching release-sign-tarball.yml's
Expand Down
41 changes: 0 additions & 41 deletions .trivyignore.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,3 @@
vulnerabilities:
# MEC-1031: HIGH CVEs in libssl3t64, a transitive package inside the pinned
# gcr.io/distroless/cc-debian13:nonroot runtime base image. No upstream fix
# exists yet: the nonroot/latest tags for that image resolve to the exact
# digest already pinned in the Dockerfile, so there is no patched digest to
# bump to. rust-junosmcp has no OpenSSL/native-tls dependency (see
# Cargo.lock: no openssl or native-tls crate); all TLS is rustls, using
# rustls-native-certs only for the system CA bundle. The distroless nonroot
# runtime has no shell and cannot exec `openssl` (PR #212 removed the last
# Command::new spawn), so libssl3t64 is never loaded by this binary. This is
# a time-boxed suppression, not a permanent risk acceptance: added
# 2026-09-30 with expired_at: 2026-11-30, so trivy stops honoring the
# ignore and the gate re-fails automatically on that date if no one has
# removed it. Remove sooner if gcr.io/distroless/cc-debian13:nonroot ships
# a digest with the patched package before then.
- id: CVE-2026-75804
expired_at: 2026-11-30
statement: >-
Unreachable: no OpenSSL/native-tls dependency in rust-junosmcp (rustls
only); distroless nonroot runtime has no shell to exec openssl.
Suppression added 2026-09-30 pending an upstream distroless rebuild
with the patched libssl3t64; tracked in MEC-1031. Expires 2026-11-30 so
trivy re-flags this for review if the upstream fix still hasn't shipped.
- id: CVE-2026-84782
expired_at: 2026-11-30
statement: >-
Unreachable: no OpenSSL/native-tls dependency in rust-junosmcp (rustls
only); distroless nonroot runtime has no shell to exec openssl.
Suppression added 2026-09-30 pending an upstream distroless rebuild
with the patched libssl3t64; tracked in MEC-1031. Expires 2026-11-30 so
trivy re-flags this for review if the upstream fix still hasn't shipped.
- id: CVE-2026-124709
expired_at: 2027-01-31
statement: >-
Unreachable: no OpenSSL/native-tls dependency in rust-junosmcp (rustls
only; `cargo tree -i native-tls` and `-i openssl-sys` match nothing);
the CVE is an OpenSSL QUIC stream memory leak and this server speaks no
QUIC. Distroless nonroot runtime has no shell to exec openssl. No fixed
libssl3t64 exists yet. Suppression added 2026-11-21 (MEC-1031); expires
2027-01-31 so trivy re-flags it for review if no fix has shipped.

misconfigurations:
- id: AVD-DS-0026
paths:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ All notable user-facing changes are recorded here. Format loosely follows

### Changed

- The container image runs on `distroless/base-nossl-debian13` (plus `libgcc_s.so.1`
with its dpkg record) instead of `cc-debian13`, so it no longer carries
`libssl3t64` and its unfixed CVE-2026-124709. The libssl `.trivyignore.yaml`
entries are removed.
- Container images are published for `linux/amd64` and `linux/arm64`, so Apple
Silicon pulls a native image instead of failing with `no matching manifest`
(#648). Each platform builds on its own native runner.
Expand Down
24 changes: 21 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#
# Builder version is taken from rust-toolchain.toml (currently 1.100.0). The two
# must stay in sync.
# Source of libgcc-s1 only; the runtime is base-nossl, which lacks it. Not the
# runtime itself, so keep it ahead of the builder and out of the last FROM.
FROM gcr.io/distroless/cc-debian13:nonroot@sha256:cb87acc574abe719b6e5c547384defa2f7b1f24af9605d3f618cf852495d8be2 AS libgcc

FROM rust:1.100-slim-bookworm@sha256:7c7d4eb4d05b7781187a327809466cfddf29753f6defdc3d19a0e291951b7a37 AS builder
WORKDIR /src

Expand All @@ -30,22 +34,36 @@ RUN install -d -m 0750 -o 65532 -g 65532 \
&& install -d -m 0700 -o 65532 -g 65532 /stage-var/lib/jmcp/device-leases \
&& install -m 0600 -o 65532 -g 65532 /dev/null /stage-var/lib/jmcp/known_hosts

# Runtime base: distroless. Now possible because #212 removed the last
# libgcc_s.so.1 is the one library the binary needs beyond glibc, and
# base-nossl does not ship it. Stage it with its dpkg records (status.d) so
# Trivy and the SBOM still see libgcc-s1 and gcc-14-base. The multiarch
# directory is taken from the builder's own triplet (x86_64 or aarch64).
COPY --from=libgcc / /cc/
RUN triplet="$(gcc -dumpmachine | sed 's/-pc-/-/')" \
&& install -d "/stage-libgcc/usr/lib/${triplet}" /stage-libgcc/var/lib/dpkg/status.d \
&& cp -a "/cc/usr/lib/${triplet}/libgcc_s.so.1" "/stage-libgcc/usr/lib/${triplet}/" \
&& cp -a /cc/var/lib/dpkg/status.d/libgcc-s1 /cc/var/lib/dpkg/status.d/libgcc-s1.md5sums \
/cc/var/lib/dpkg/status.d/gcc-14-base /cc/var/lib/dpkg/status.d/gcc-14-base.md5sums \
/stage-libgcc/var/lib/dpkg/status.d/

# Runtime base: distroless base-nossl (no libssl3t64/libcrypto: the binary is
# rustls-only, and libssl3t64 carries unfixed CVE-2026-124709). Now possible because #212 removed the last
# Command::new spawn (the scp subprocess). The server no longer shells out, so
# it no longer needs a shell or utilities.
#
# glibc rule: builder generation must be <= runtime generation. The builder is
# bookworm (glibc 2.36) and this is debian13 (glibc 2.41), so the direction is
# safe. Moving the builder forward would require moving this first.
FROM gcr.io/distroless/cc-debian13:nonroot@sha256:cb87acc574abe719b6e5c547384defa2f7b1f24af9605d3f618cf852495d8be2
FROM gcr.io/distroless/base-nossl-debian13:nonroot@sha256:89815d620ac01d8de13cdaf04d19ed874447ca2296d4985b14b818f6e5e47854
LABEL org.opencontainers.image.source="https://github.com/mechubsec/rustjunosmcp"
LABEL org.opencontainers.image.licenses="MIT"
# Official MCP Registry ownership check: must equal server.json "name".
LABEL io.modelcontextprotocol.server.name="io.github.mechubsec/rustjunosmcp"

# CA certificates are shipped in gcr.io/distroless/cc-* at /etc/ssl/certs. The
# CA certificates are shipped in gcr.io/distroless/base-nossl-* at /etc/ssl/certs. The
# binary makes outbound TLS calls (HTTPS requests for device APIs), and rustls
# uses the system CA bundle via rustls-native-certs.
COPY --from=builder /stage-libgcc/ /
COPY --from=builder --chown=65532:65532 \
/src/target/release/rust-junosmcp /usr/local/bin/rust-junosmcp
COPY --from=builder --chown=65532:65532 /stage-etc/jmcp /etc/jmcp
Expand Down
4 changes: 2 additions & 2 deletions docs/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,8 @@ default) and want to use it, set `port` to 830 explicitly.
> [`docs/HOW-TO-SETUP-DOCKER.md`](HOW-TO-SETUP-DOCKER.md).

Prebuilt images are published to GHCR on every version tag. The package is
public — no `docker login` required. The runtime is `distroless` — no shell,
`apt`, or OpenSSH client (#201) — and runs as numeric UID/GID `65532:65532`.
public — no `docker login` required. The runtime is `distroless/base-nossl` — no shell,
`apt`, OpenSSH client (#201) or OpenSSL — and runs as numeric UID/GID `65532:65532`.
`transfer_file`/`fetch_file` no longer spawn `scp`; they speak the SCP1 wire
protocol natively via `mecmcp-scp` over the SSH exec channel (#212).

Expand Down
2 changes: 1 addition & 1 deletion featurescope.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ v0.13.0 through v0.28.1, v1.0.0, and v2.0.0 through v2.7.5.

- rmcp 3.1.1 on mecmcp 0.5.0 (MCP 2026-07-28 support).
- **The container image has no shell, `apt` or `openssh-client`.** The runtime
base is `gcr.io/distroless/cc-debian13:nonroot`. `transfer_file` and
base is `gcr.io/distroless/base-nossl-debian13:nonroot`. `transfer_file` and
`fetch_file` no longer spawn `scp`; they use the SCP wire protocol natively.
- New stable error code `host_key_revoked`.

Expand Down
4 changes: 2 additions & 2 deletions packaging/container/compose.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# and explicit writable mounts. Copy this, adjust the image tag and the paths,
# and treat it as a starting point rather than a drop-in.
#
# The image is distroless (gcr.io/distroless/cc-debian13:nonroot) — no shell,
# no package manager, just the binary and glibc. All file transfers run in-process
# The image is distroless (gcr.io/distroless/base-nossl-debian13:nonroot) — no shell,
# no package manager, no OpenSSL, just the binary, glibc and libgcc_s. All file transfers run in-process
# via the native SCP1 client (#212).

services:
Expand Down
14 changes: 14 additions & 0 deletions packaging/tests/container-scp-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ if docker run --rm --entrypoint /usr/bin/scp "$APP_IMAGE" --version 2>/dev/null;
exit 1
fi

# Verify the image carries no OpenSSL (base-nossl; the binary is rustls-only)
# and still ships libgcc_s, the one library it needs beyond glibc.
container_id=$(docker create "$APP_IMAGE")
image_files="$(docker export "$container_id" | tar -t)"
docker rm "$container_id" > /dev/null
if grep -E 'lib(ssl|crypto)' <<<"$image_files"; then
echo "image should not contain libssl or libcrypto" >&2
exit 1
fi
grep -q '/libgcc_s\.so\.1$' <<<"$image_files" || {
echo "image is missing libgcc_s.so.1" >&2
exit 1
}

echo ">> Verifying config-path argv survival under operator overrides"
# Regression guard for mecmcp#357: config paths must survive operator overrides.
# Docker replaces CMD entirely when the caller supplies args, but appends to
Expand Down
Loading