Repository navigation
Prevent SSH servers in gateway images and document SSHHole applicability - #16421
Conversation
Document SSHHole non-applicability for both published v0.5.8 architectures and fail final-image builds if an OpenSSH server appears. Exercise the build check with shell-level regression tests. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the preventive SSH-server image hardening and its supporting tests and documentation.
No open issues 🎉
What changed in this PR
This PR adds preventive hardening to keep SSH servers out of MCP Gateway runtime images and documents why the inspected v0.5.8 images are not affected by SSHHole. It does not patch OpenSSH or update deployed images.
Changes:
- Reject final image builds containing OpenSSH server packages or an
sshdexecutable on PATH, and fail closed on package-query errors. - Add shell-level regression coverage for clean, client-only, server-containing, and package-query-failure cases.
- Document image inspection evidence, applicability limits, and separate assessment requirements for backend containers, derived images, and hosts.
| File | Description |
|---|---|
| SECURITY.md | Records SSHHole applicability, image digests, and assessment limitations. |
| dockerfile_test.go | Exercises the Dockerfile check with mocked package inventories and executable lookup. |
| Dockerfile | Adds a final runtime-image check rejecting OpenSSH servers. |
Review effort: Balanced (auto)
ð��� mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write leaked on any surface. Parts A and C fully confirm read access works. Parts B, D, and E could not independently confirm the gateway's own write-blocking layer:
No reaction, star, issue, comment, branch, file, or PR was created. Full log: /tmp/gh-aw/agent/readonly-stress-43283394558.txt
|
Co-authored-by: lpcox <[email protected]>
Removed the stale imports. Focused Dockerfile tests and |
Summary
sshdfiles. No OpenSSH package installation or version bump is appropriate.sshdexecutable on PATH are introduced. Package inventory failures fail closed.This is preventive hardening and an applicability assessment, not an OpenSSH package patch or an update to deployed images. Backend containers, derived images, and host SSH services require separate assessment. Firewall is being handled separately.
Evidence
Verified the upstream OpenSSH 10.6p2 release notes and Alpine advisory. Alpine 3.24's fixed server package is
10.3_p1-r2; the advisory excludes containers that do not runsshd.Inspected every layer and the final populated
/lib/apk/db/installedpackage database forghcr.io/github/gh-aw-mcpg:v0.5.8on 2026-11-12. Both architectures have 80 installed packages, no SSH packages, and nosshdfilesystem entries. The entrypoint starts the gateway, not an SSH service. The Debian Bookworm development container uses glibc rather than the affected musl stack.sha256:e237aabf51d4485474b9355649b811ca6c1db22359eeb1860832fc1fb5a7a347sha256:dab817040f9666831719bfc4517bff30f4eaae625b4ee7e8d492600b7e0b317esha256:f8a03b4bd8ce3b6e0c5fb52386599a868bf4d1af4fa577bef8ff49d451299b74Validation
go test . -run 'TestDockerfile' -count=1passed.make agent-finishedpassed: build, vet, golangci-lint (0 issues), Go tests, and 722 Rust guard tests.git diff --checkpassed.Gap: no local Docker daemon was available, so no new full image build or runtime authentication test was performed. Registry-layer inspection established the existing release's server absence; tests execute the actual Dockerfile check with mocked package inventories and executable lookup. No deployed image has been changed by this PR.