test: add coverage for MCP mount/docker-arg warning propagation - #2114
Draft
github-actions[bot] wants to merge 1 commit into
Draft
test: add coverage for MCP mount/docker-arg warning propagation#2114github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
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.
Test Gap Fixes
Test suite snapshot: 3322 unit tests, ~700 integration tests, 40+ test fixtures (baseline
cargo testrun before this change)Added Coverage
src/validate.rsvalidate_mount_source(docker.sock detection), surfaced viavalidate_stdio_mcpinsrc/compile/common.rstest_compile_warns_on_docker_socket_mountsrc/validate.rsvalidate_docker_args(--privilegedflag detection)test_compile_warns_on_privileged_docker_argsrc/validate.rsvalidate_docker_args→validate_mount_sourcedelegation (-v/--volumesmuggling a sensitive host path)mounts:field still gets the delegated sensitive-path warning, end-to-end throughcompiletest_compile_warns_on_volume_arg_smuggling_sensitive_mountThese three security-relevant validators (container escape via docker socket mounts, privilege escalation via docker args, and mounts-validation bypass) previously had only direct unit tests in
src/compile/common.rsexercising the functions in isolation. Nothing asserted that the warnings actually reach the compiled CLI's stderr output when triggered through real front matter, so a regression in thevalidate_stdio_mcpwiring (e.g. dropping aneprintln!call or no longer iteratingopts.mounts/opts.args) would have gone unnoticed by the existing suite.Validation
cargo test(3322+ tests, all passing, including the 3 new tests)cargo clippy --all-targets --all-features(no warnings)This PR was created by the automated test gap finder. Modules audited this cycle:
secure.rs,validate.rs(focus: MCP docker/mount validators),sanitize.rs,execute.rs,fuzzy_schedule.rs,compile/ado_bundle.rs,compile/pr_filters.rs,compile/filter_ir.rs.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.