mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #186] [MERGED] fix(network): tighten sandbox host isolation and egress handling #236
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/186
Author: @LSX-s-Software
Created: 8/18/2026
Status: ✅ Merged
Merged: 8/19/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/network-policy📝 Commits (2)
a74ec38perf(network): skip empty egress programming on clean slots925d12efix(network): tighten sandbox egress chain and gateway ingress chain📊 Changes
3 files changed (+135 additions, -28 deletions)
View changed files
📝
src/sandbox/network/manager.rs(+38 -6)📝
src/sandbox/network/policy.rs(+44 -13)📝
src/sandbox/network/slot.rs(+53 -9)📄 Description
What
Why
The previous host and namespace rules were broader than required for sandbox operation. A sandbox could reach host-side addresses through the baseline egress allow rules, and the global host forwarding rules matched the full host-interaction CIDR without constraining the AgentENV interface. In addition, every sandbox without runtime egress rules still entered its network namespace and reprogrammed an empty user chain, including clean warm-pool slots.
This change reduces the reachable host surface while preserving host-initiated proxy/envd reply traffic and avoids unnecessary namespace/iptables work on the common no-policy path.
Related issue
N/A - no linked issue was provided.
Scope and non-goals
Included:
Not included:
Design and behavior changes
ESTABLISHED,RELATEDreplies from AgentENV veth interfaces, then reject other guest-to-host traffic from the host-interaction CIDR.Slotrecords whether user egress rules were successfully installed. Empty policy updates return immediately for known-clean slots; failed apply or cleanup attempts preserve the prior state so a later reuse does not incorrectly skip cleanup.Compatibility and operations
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
The exact command lines were not provided with the PR creation request.
Skipped checks and reasons:
make -C services test: skipped becauseservices/is unchanged.Risks and reviewer notes
src/sandbox/network/slot.rstogether with warm-pool reuse.src/sandbox/network/manager.rsand the namespace baseline rules insrc/sandbox/network/policy.rs.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.