Commit 6333a1c
authored
Allow SHA-256 digests in container image references (#3352)
The `container` field regex rejects `@sha256:` digest-pinned image
references, blocking immutable container image pinning for supply-chain
security.
### Changes
- **Regex pattern** (`validation_schema.go`): Append optional
`(@sha256:[a-fA-F0-9]{64})?` group to `containerPattern`
- **JSON schema** (`mcp-gateway-config.schema.json`): Mirror the same
pattern update
- **Tests**: Add valid cases (`image:tag@sha256:...`,
`image@sha256:...`) and invalid cases (short digest, wrong algorithm)
Now accepts:
```
ghcr.io/github/github-mcp-server:v0.32.0@sha256:2763823c67a0adca...
ghcr.io/github/github-mcp-server@sha256:2763823c67a0adca...
```
No launcher changes needed — Docker already resolves the full
`image:tag@sha256:...` reference passed through.
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `example.com`
> - Triggering command: `/tmp/go-build2438908248/b514/launcher.test
/tmp/go-build2438908248/b514/launcher.test
-test.testlogfile=/tmp/go-build2438908248/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s go_.�� @v1.1.3/internal-errorsas
64/src/debug/dwa-ifaceassert x_amd64/vet --gdwarf-5 nal/version -o
x_amd64/vet -plu�� /sdk@v1.43.0/tra-errorsas
/sdk@v1.43.0/tra-ifaceassert x_amd64/vet -plugin-opt=-pasdocker
telabs/wazero/ininfo -plugin-opt=-pas-stringintconv x_amd64/vet` (dns
block)
> - `invalid-host-that-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build2438908248/b496/config.test
/tmp/go-build2438908248/b496/config.test
-test.testlogfile=/tmp/go-build2438908248/b496/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build2438908248/b393/vet.cfg g_.a --debug-prefix-map x_amd64/vet
-I 0218966/b157/ -I x_amd64/vet` (dns block)
> - `nonexistent.local`
> - Triggering command: `/tmp/go-build2438908248/b514/launcher.test
/tmp/go-build2438908248/b514/launcher.test
-test.testlogfile=/tmp/go-build2438908248/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s go_.�� @v1.1.3/internal-errorsas
64/src/debug/dwa-ifaceassert x_amd64/vet --gdwarf-5 nal/version -o
x_amd64/vet -plu�� /sdk@v1.43.0/tra-errorsas
/sdk@v1.43.0/tra-ifaceassert x_amd64/vet -plugin-opt=-pasdocker
telabs/wazero/ininfo -plugin-opt=-pas-stringintconv x_amd64/vet` (dns
block)
> - `slow.example.com`
> - Triggering command: `/tmp/go-build2438908248/b514/launcher.test
/tmp/go-build2438908248/b514/launcher.test
-test.testlogfile=/tmp/go-build2438908248/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s go_.�� @v1.1.3/internal-errorsas
64/src/debug/dwa-ifaceassert x_amd64/vet --gdwarf-5 nal/version -o
x_amd64/vet -plu�� /sdk@v1.43.0/tra-errorsas
/sdk@v1.43.0/tra-ifaceassert x_amd64/vet -plugin-opt=-pasdocker
telabs/wazero/ininfo -plugin-opt=-pas-stringintconv x_amd64/vet` (dns
block)
> - `this-host-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build2438908248/b523/mcp.test
/tmp/go-build2438908248/b523/mcp.test
-test.testlogfile=/tmp/go-build2438908248/b523/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -p g_.a -trimpath x_amd64/vet -I
ernal/proxy -I x_amd64/vet -uns�� .cfg
/tmp/go-build1090218966/b063/vet-ifaceassert x_amd64/vet -D GOAMD64_v1
-o x_amd64/vet` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/github/gh-aw-mcpg/settings/copilot/coding_agent)
(admins only)
>
> </details>4 files changed
Lines changed: 55 additions & 4 deletions
File tree
- internal/config
- schema
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
368 | 392 | | |
369 | 393 | | |
370 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
67 | 80 | | |
68 | 81 | | |
69 | 82 | | |
| |||
86 | 99 | | |
87 | 100 | | |
88 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
89 | 116 | | |
90 | 117 | | |
91 | 118 | | |
| |||
0 commit comments