fix: eliminate nested bash layer in chroot command execution for Java/.NET#715
fix: eliminate nested bash layer in chroot command execution for Java/.NET#715
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Smoke Test ResultsLast 2 Merged PRs:
✅ GitHub MCP: Fetched recent PRs Overall Status: PASS
|
C++ Build Test Results
Overall: PASS ✅ All C++ projects built successfully.
|
Build Test: Bun - ✅ PASSTest Results
Overall: PASS ✅ All Bun projects built and tested successfully.
|
|
✅ GitHub MCP: PR #197 (release highlights), PR #706 (hide mcp-logs) Status: PASS cc @Mossaka
|
Go Build Test Results
Overall: PASS ✅ All Go projects successfully downloaded dependencies and passed their tests.
|
Deno Build Test Results
Overall: ✅ PASS All Deno tests completed successfully.
|
Build Test: Node.js - Results
Overall: PASS ✅ All Node.js projects built and tested successfully.
|
Rust Build Test Results
Overall: PASS All Rust projects built and tested successfully.
|
Java Build Test Results
Overall: PASS ✅ All Java projects successfully compiled and passed their test suites through the AWF firewall with Maven proxy configuration.
|
Java Build Test Results
Overall: PASS ✅ All Java projects compiled and tested successfully through AWF firewall with Maven proxy configuration.
|
Chroot Version Comparison Test Results
Overall Result: Tests FAILED (not all versions match) The chroot environment successfully accessed host binaries, but version mismatches were detected for Python and Node.js. Go versions matched correctly.
|
Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Overall Status: PASS 🎉 cc @Mossaka
|
Add integration tests verifying the capsh execution chain works correctly after PR #715 eliminated the nested bash layer for Java/.NET compatibility. Tests verify: - CAP_NET_ADMIN, CAP_SYS_CHROOT, CAP_SYS_ADMIN dropped from CapBnd bitmask - iptables, chroot, mount commands fail (capabilities enforced) - Commands run under bash shell (BASH_VERSION set) - /proc/self/exe resolves correctly for python3 (not /bin/bash) - Special characters and pipe chains work with direct-write approach Fixes #842 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add integration tests verifying the capsh execution chain works correctly after PR #715 eliminated the nested bash layer for Java/.NET compatibility. Tests verify: - CAP_NET_ADMIN, CAP_SYS_CHROOT, CAP_SYS_ADMIN dropped from CapBnd bitmask - iptables, chroot, mount commands fail (capabilities enforced) - Commands run under bash shell (BASH_VERSION set) - /proc/self/exe resolves correctly for python3 (not /bin/bash) - Special characters and pipe chains work with direct-write approach Fixes #842 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Java and .NET runtimes fail inside AWF chroot mode because
/proc/self/exeresolves to/bin/bashinstead of the actual runtime binary. .NET CLR rejects execution with "cannot execute dotnet when renamed to bash" (exit 132); JVM misidentifies itself and outputs bash version info.Root cause: Docker CMD
['/bin/bash', '-c', 'command']is passed to the entrypoint as$@, then written to the chroot script file viaprintf '%q ' "$@", producing:This nested
bash -ccreates an intermediate process whose/proc/self/exeis/bin/bash, which propagates to runtimes checking their process identity.Fix in
entrypoint.sh:$1=/bin/bash,$2=-c,$#=3)$3(the command string) directly into the script file, eliminating the nested bash layerprintf '%q'behavior for non-standard invocationsdocs/chroot-mode.mdto document the direct-write approach as part of the procfs resolution chainOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.