fix(security): enable in-process tpa-descriptions scanner without Docker (MCP-2396)#662
Merged
Merged
Conversation
…ker (MCP-2396) The built-in, Docker-less tpa-descriptions scanner has an empty EffectiveImage(), so the enable path (InstallScanner) fell through to the Docker pull flow and left it stuck in 'error'/'pulling'. resolveScanners then prefail-skipped every scan with an unactionable 'reconfigure it from the Security page' notice — the flagship Tool-Poisoning-Attack description scan never ran via the pipeline. - InstallScanner: short-circuit InProcess scanners to 'installed' synchronously, skipping the Docker image-availability/pull path entirely. - syncRegistryFromStorage: self-heal in-process scanners an older build persisted in a Docker state (error/pulling) back to 'installed' at startup, so existing broken installs recover without a manual re-toggle. Adds TestServiceInstallInProcessScanner (enable path) and TestServiceHealsInProcessScannerStuckInError (startup heal). Related MCP-2396
Deploying mcpproxy-docs with
|
| Latest commit: |
4189612
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1fe521f7.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-mcp-2396-tpa-description.mcpproxy-docs.pages.dev |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 27501562256 --repo smart-mcp-proxy/mcpproxy-go
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The built-in tpa-descriptions scanner (MCPProxy's flagship in-process Tool-Poisoning-Attack description analyzer, added in #636) enables 'successfully' but lands in
status=errorwith an empty error field anddocker_image=''.resolveScannersthen prefail-skips it on every scan with the unactionable notice "reconfigure it from the Security page" — but it's a built-in with nothing to configure. The TPA description scan never runs via the pipeline.Root cause
tpa-descriptionsisInProcess: trueand has no Docker image, soEffectiveImage()returns"". The enable endpoint (POST /scanners/{id}/enable→InstallScanner) had no in-process branch: the empty image fell through to the Docker fast-path / availability check / pull flow, so the scanner ended uppulling→error.Fix (
internal/security/scanner/)InstallScanner: short-circuitInProcessscanners toinstalledsynchronously (viatargetStatusAfterPull), skipping the Docker image-availability/pull path entirely. No image, nothing to pull.syncRegistryFromStorage: self-heal at startup — an in-process scanner an older build persisted in a Docker state (error/pulling) is reset toinstalledand re-saved, so existing broken installs recover without a manual re-toggle.No
docker_imageis expected for this scanner; behavior now matches the existing docs (docs/features/security-scanner-plugins.md: "installed (always on) out of the box"), so no doc change is needed.Tests (TDD — red first, then green)
TestServiceInstallInProcessScanner— enabling an in-process scanner lands it ininstalled(noterror/pulling), persists it, and emits ascanner_changedinstalled event. Failed before the fix (got "pulling").TestServiceHealsInProcessScannerStuckInError— a service constructed with a staleerrorrecord for an in-process scanner self-heals toinstalledat startup.Verification
Related MCP-2396