test: add unit test coverage for 6 security-critical gaps in compile/standalone.rs#186
Conversation
…ctions Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/c1b5d999-f258-4cba-8b5d-d88310bcd8a8 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
|
/rust-review |
|
✅ Rust PR Reviewer completed successfully! |
🔍 Rust PR ReviewSummary: Good coverage addition — all 30 tests pass. One structural weakness worth addressing: the warning-emitting functions are only smoke-tested (no-panic), so the behavioral contracts remain unverified. Findings
|
Addresses reviewer feedback: 1. Refactored validate_container_image, validate_mount_source, validate_docker_args, and warn_potential_secrets to return Vec<String> instead of emitting directly via eprintln. This enables tests to assert on warning content rather than being smoke tests that only verify no-panic. 2. Upgraded all 18 validation tests from smoke tests to real assertion tests that verify both warning presence (positive cases) and warning absence (negative cases). 3. Added clarifying comment on blocked-domain test noting that blocking uses exact-string removal and does not affect wildcard variants (e.g. blocking "github.com" does not remove "*.github.com"). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Looks good — clean, well-structured test-addition PR that all passes; one minor inconsistency worth noting. Findings
|
|
approved after final change |
Addresses remaining reviewer feedback: 1. Refactored validate_mcp_url to return Vec<String>, completing the pattern across all 5 validation functions. Added 4 tests covering https, http, bad scheme, and missing scheme cases. 2. Added warning when -v/--volume is the last Docker arg with no mount spec (previously silently ignored). Added 2 tests. 3. Documented network.blocked exact-string matching semantics in AGENTS.md with example showing how to block both a domain and its wildcard variant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Looks good — clean testability refactor with 30 correct unit tests. One minor observation below. Findings✅ What Looks Good
|
Automated test gap analysis identified 6 untested functions in
compile/standalone.rs, all with security or correctness implications. This PR adds 30 unit tests covering them.New test coverage
validate_docker_args— dangerous flag detection (--privileged,--entrypoint), volume smuggling via-v/--volume=(both split and equals forms), safe args no-panicvalidate_mount_source— Docker socket escape, sensitive prefixes (/etc,/proc), case-insensitive matching (/ETC/shadow), path-boundary false-positive guard (/etc-configsmust not match)validate_container_image— empty name, shell metacharacters, valid referenceswarn_potential_secrets— secret-named env var with inline value triggers; empty passthrough ("") does not;Authorizationheader andBearervalue triggergenerate_allowed_domains—network.blockedtakes precedence overnetwork.allow;host.docker.internalalways present; user-specified host included; blocked core host removed (uses exact split match to avoidapi.github.comfalse-positive); invalid DNS chars return errorgenerate_prepare_steps—has_memory=trueemitsDownloadPipelineArtifact+ memory prompt;has_memory=falsewith no steps returns empty; both memory and user steps coexist correctlyWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.github.com (HTTP Only)/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com --as-needed -dynamic-linker 6gho5pdg3qcc6imv8ae.03ai1re.rcgu.o b11g1torib5b8kf3tyq.03ai1re.rcgu.o vske8pir6qp7uwgmkra.03ai1re.rcgu.o 1kko1k42n6zoayjfrxk.03ai1re.rcgu.o pijo9cmb3mn0cjr0cs3.03ai1re.rcgu.o jy7p22v5y4xea6nw3uz.03ai1re.rcgu.o f44po5obfesbuktq145.03ai1re.rcgu.o xm80y5r6fqpc0kvsm54.03ai1re.rcgu.o w1l7t53fmyrqyygq9yc.03ai1re.rcgu.o pxfj6bodtbq5vvdmxb0.03ai1re.rcgu.o l0suhk86je6snmds865.03ai1re.rcgu.o x45qthlhzbsei17w176.03ai1re.rcgu.o 8ex5glrrub0lb4w33d6.03ai1re.rcgu.o rwvgjbj8u7wkgi227cu.03ai1re.rcgu.o(packet block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com g/de�� lib/rustlib/x86_--error-format=json lib/rustlib/x86_--json=diagnostic-rendered-ansi,artifacts,future-incompat bin/rustc res-0d1f7d618793cc res-0d1f7d618793-m64 res-0d1f7d618793/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rustc0RUv2z/symbols.o bin/rustc res-�� res-0d1f7d618793/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/mcp_http_tests-04474f03c5ca2c4/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw res-0d1f7d618793/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/mcp_http_tests-04474f03c5ca2c4compile f/encoding_rs-0./home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/mcp_http_tests-04474f03c5ca2c4/home/REDACTED/work/ado-aw/ado-aw/tests/fixtures/azure-devops-mcp-agent.md res-0d1f7d618793/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw eta.o res-0d1f7d618793/tmp/agentic-pipeline-uprnotvote-10218/upr-agent.md known-linux-gnu/-o(packet block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com g/de�� lib/rustlib/x86_/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/async_trait-f6d12dc65cce50cb.aiptables lib/rustlib/x86_/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/async_trait-f6d12dc65cce50cb.a-w lib/rustlib/x86_64-REDACTED-linux-gnu/bin/cc fe0dd3cb6f860c.ccc fe0dd3cb6f860c.c-m64 fe0dd3cb6f860c.c/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rustcQshIru/symbols.o fe0dd3cb6f860c.c/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.017qwv-d fe0d�� mbols.o -04474f03c5ca2c4/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.057ulncompile -04474f03c5ca2c4/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.09vese/home/REDACTED/work/ado-aw/ado-aw/tests/fixtures/azure-devops-mcp-agent.md -04474f03c5ca2c4/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw -04474f03c5ca2c4compile -04474f03c5ca2c4/home/REDACTED/work/ado-aw/ado-aw/tests/fixtures/1es-test-agent.md -04474f03c5ca2c4-o(packet block)dev.azure.com/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-e07c5709f9b8ed2e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-e07c5709f9b8ed2e --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 19xv9jm5rv1lqvwtrdayt68c.114b5c7.rcgu.o kfvqav2vxwob5emy3jyjhdyk.114b5c7.rcgu.o 3udnxujnyqlwki7eb55ujuz0.114b5c7.rcgu.o 6szb9gfg72lgmff75ks5v4oy.114b5c7.rcgu.o 98ylokwc4o0a1lwljih6e7dy.114b5c7.rcgu.o haslg5xpfds7r4ldv8ob2bhs.114b5c7.rcgu.o nfqjni1abcpgns9aw4rz3gi5.114b5c7.rcgu.o p2mzj4wl2mzvz8nuv8fobwn2.114b5c7.rcgu.o vk14clagoudz75k9tcqdef6e.114b5c7.rcgu.o 0k59no41h8pf7zq2kdw3ebcq.114b5c7.rcgu.o 2va92i8c0nlgeutzt6fhd04a.114b5c7.rcgu.o 4a6y3mt2496l6t08p14wvjtj.114b5c7.rcgu.o u995prndo1dh5c3j5xwvivfn.114b5c7.rcgu.o z5wgysxdci4oufxhqds0ix9w.114b5c7.rcgu.o(dns block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-e07c5709f9b8ed2e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-e07c5709f9b8ed2e /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/proxy_tests-fc040786449fc516.1nfqjni1abcpgns9aw4rz3gi5.114b5c7.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/proxy_tests-fc040786449fc516.1p2mzj4wl2mzvz8nuv8fobwn2.114b5c7.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/proxy_tests-fc040786449fc516.1vk14clagoudz75k9tcqdef6e.114b5c7.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/proxy_tests-fc040786449fc516.20k59no41h8pf7zq2kdw3ebcq.114b5c7.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/proxy_tests-fc040786449fc516.22va92i8c0nlgeutzt6fhd04a.114b5c7.rcgu.o 6gho5pdg3qcc6imv8ae.0pdls67.rcgu.o b11g1torib5b8kf3tyq.0pdls67.rcgu.o vske8pir6qp7uwgmkra.0pdls67.rcgu.o 1kko1k42n6zoayjfrxk.0pdls67.rcgu.o pijo9cmb3mn0cjr0cs3.0pdls67.rcgu.o jy7p22v5y4xea6nw3uz.0pdls67.rcgu.o f44po5obfesbuktq145.0pdls67.rcgu.o xm80y5r6fqpc0kvsm54.0pdls67.rcgu.o w1l7t53fmyrqyygq9yc.0pdls67.rcgu.o pxfj6bodtbq5vvdmxb0.0pdls67.rcgu.o l0suhk86je6snmds865.0pdls67.rcgu.o x45qthlhzbsei17w176.0pdls67.rcgu.o 8ex5glrrub0lb4w33d6.0pdls67.rcgu.o rwvgjbj8u7wkgi227cu.0pdls67.rcgu.o(dns block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com --allow dev.azure.com --allow *.visualstudio.com vske8pir6qp7uwgmkra.03ai1re.rcgu.o 1kko1k42n6zoayjfrxk.03ai1re.rcgu.o pijo9cmb3mn0cjr0cs3.03ai1re.rcgu.o jy7p22v5y4xea6nw3uz.03ai1re.rcgu.o f44po5obfesbuktq145.03ai1re.rcgu.o xm80y5r6fqpc0kvsm54.03ai1re.rcgu.o w1l7t53fmyrqyygq9yc.03ai1re.rcgu.o pxfj6bodtbq5vvdmxb0.03ai1re.rcgu.o l0suhk86je6snmds865.03ai1re.rcgu.o x45qthlhzbsei17w176.03ai1re.rcgu.o 8ex5glrrub0lb4w33d6.03ai1re.rcgu.o rwvgjbj8u7wkgi227cu.03ai1re.rcgu.o(dns block)msazuresphere.visualstudio.com/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com --allow dev.azure.com --allow *.visualstudio.com vske8pir6qp7uwgmkra.03ai1re.rcgu.o 1kko1k42n6zoayjfrxk.03ai1re.rcgu.o pijo9cmb3mn0cjr0cs3.03ai1re.rcgu.o jy7p22v5y4xea6nw3uz.03ai1re.rcgu.o f44po5obfesbuktq145.03ai1re.rcgu.o xm80y5r6fqpc0kvsm54.03ai1re.rcgu.o w1l7t53fmyrqyygq9yc.03ai1re.rcgu.o pxfj6bodtbq5vvdmxb0.03ai1re.rcgu.o l0suhk86je6snmds865.03ai1re.rcgu.o x45qthlhzbsei17w176.03ai1re.rcgu.o 8ex5glrrub0lb4w33d6.03ai1re.rcgu.o rwvgjbj8u7wkgi227cu.03ai1re.rcgu.o(dns block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com --allow dev.azure.com --allow *.visualstudio.com c1063f.rlib s/serde_derive-7-m64 s/serde_derive-7/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rustc0RUv2z/symbols.o bin/rustc(dns block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow api.github.com --allow dev.azure.com --allow *.visualstudio.com fe0dd3cb6f860c.c/usr/libexec/gcc/x86_64-linux-gnu/13/collect2 fe0dd3cb6f860c.c-plugin fe0dd3cb6f860c.c/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so fe0dd3cb6f860c.c-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper fe0d�� mbols.o -04474f03c5ca2c4--eh-frame-hdr -04474f03c5ca2c4-m -04474f03c5ca2c4/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw -04474f03c5ca2c4compile -04474f03c5ca2c4/tmp/agentic-pipeline-cwi-pass-11451/cwi-agent.md -04474f03c5ca2c4-o(dns block)raw.github.com/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow *.github.com /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.0mlxr4pxfj6bodtbq5vvdmxb0.0pdls67.rcgu.o /home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.0p9ee7l0suhk86je6snmds865.0pdls67.rcgu.o 6gho5pdg3qcc6imv8ae.03ai1re.rcgu.o b11g1torib5b8kf3tyq.03ai1re.rcgu.o vske8pir6qp7uwgmkra.03ai1re.rcgu.o 1kko1k42n6zoayjfrxk.03ai1re.rcgu.o pijo9cmb3mn0cjr0cs3.03ai1re.rcgu.o jy7p22v5y4xea6nw3uz.03ai1re.rcgu.o f44po5obfesbuktq145.03ai1re.rcgu.o xm80y5r6fqpc0kvsm54.03ai1re.rcgu.o w1l7t53fmyrqyygq9yc.03ai1re.rcgu.o pxfj6bodtbq5vvdmxb0.03ai1re.rcgu.o l0suhk86je6snmds865.03ai1re.rcgu.o x45qthlhzbsei17w176.03ai1re.rcgu.o 8ex5glrrub0lb4w33d6.03ai1re.rcgu.o rwvgjbj8u7wkgi227cu.03ai1re.rcgu.o(dns block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow *.github.com g/de��(dns block)/home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw /home/REDACTED/work/ado-aw/ado-aw/target/debug/ado-aw proxy --allow *.github.com 7.2b�� 7.2uobun4n1xgd04x1d5e7u1y4h.165v8ul.rcgu.o 7.330c18cwdvgi96e9ysiyncy21.165v8ul.rcgu.o mbols.o fe0dd3cb6f860c.ccc fe0dd3cb6f860c.c-m64 fe0dd3cb6f860c.c/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/rustcQshIru/symbols.o fe0dd3cb6f860c.c/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.017qwv--property=CPUQuota=5% fe0d�� mbols.o -d9ec3e202ea6353/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.057ulncompile -d9ec3e202ea6353/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.09vese/home/REDACTED/work/ado-aw/ado-aw/tests/fixtures/minimal-agent.md -d9ec3e202ea6353cargo -d9ec3e202ea6353test -d9ec3e202ea6353/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.0jvkevxm80y5r6fqpc0kvsm54.03ai1re.rcgu.o -d9ec3e202ea6353/home/REDACTED/work/ado-aw/ado-aw/target/debug/deps/ado_aw-2dc3dfb3700e1b69.0k51kow1l7t53fmyrqyygq9yc.03ai1re.rcgu.o(dns block)If you need me to access, download, or install something from one of these locations, you can either: