Pin MCP gateway container base images and add drift guard - #9841
Conversation
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS References: §29962287459
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Notes
References: §29962287450
|
There was a problem hiding this comment.
Pull request overview
Pins MCP Gateway container bases and adds a regression guard against floating image references.
Changes:
- Pins Go builder and Alpine runtime images by tag and digest.
- Adds Dockerfile pinning tests.
Show a summary per file
| File | Description |
|---|---|
Dockerfile |
Pins builder and runtime base images. |
dockerfile_test.go |
Tests base-image pinning syntax. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 4
- Review effort level: Medium
| @@ -1,5 +1,5 @@ | |||
| # Build stage | |||
| FROM golang:1.25-alpine AS builder | |||
| FROM golang:1.25.11-alpine3.22@sha256:65b4400aee0927412e9ed791a11893273a49d55df24841f7599660fb80dae464 AS builder | |||
|
|
||
| # Runtime stage | ||
| FROM alpine:latest | ||
| FROM alpine:3.22.5@sha256:14358309a308569c32bdc37e2e0e9694be33a9d99e68afb0f5ff33cc1f695dce |
| pinnedBuilderPattern = regexp.MustCompile(`(?m)^FROM golang:\d+\.\d+(?:\.\d+)?-alpine\d+\.\d+(?:\.\d+)?@sha256:[a-f0-9]{64} AS builder$`) | ||
| pinnedRuntimePattern = regexp.MustCompile(`(?m)^FROM alpine:\d+\.\d+(?:\.\d+)?@sha256:[a-f0-9]{64}$`) |
| dockerfile := string(content) | ||
| assert.Regexp(t, pinnedBuilderPattern, dockerfile) | ||
| assert.Regexp(t, pinnedRuntimePattern, dockerfile) |
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Full ReportPart A — MCP Reads (ALLOWED ✅)
Part B — MCP Writes (BLOCKED ✅)All 7 write tools refused by gateway with
Part C — CLI Reads (ALLOWED ✅)
Part D — CLI REST Writes (BLOCKED ✅)
Part E — GraphQL Mutations (BLOCKED ✅)
References: §29962287614
|
|
@copilot address review feedback |
The published MCP gateway image was still built from floating Go and Alpine base tags, which made the final runtime package set release-dependent and allowed vulnerable packages to persist across releases. This change hard-pins the builder and runtime bases so published images are reproducible and easier to audit against final-image scan findings.
Container base-image hardening
DockerfileRegression guard for future releases
FROMlines with digestsWhat this changes concretely
Scope