feat(sdk): support sandbox network policies - #20
Closed
tianyuzhou95 wants to merge 1 commit into
Closed
Conversation
Expose unrestricted, block-network, and DNS-deny modes through the stable Python SDK. Enable sandboxd ACLs in bundled deployments and document the runtime requirements, limitations, upgrade procedure, and maintained example. Pin sandboxd to the ACL-enabled main revision. Keep the YuanRong submodule at a public placeholder revision until the control-plane changes are released and their final package versions and checksums can be recorded. Signed-off-by: Tianyu Zhou <albert.zty@antgroup.com>
Collaborator
Author
|
re-implement in #22 |
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.
Summary
This PR adds creation-time network ACLs to the public Python SDK and enables
ACL enforcement in the bundled AKernel deployments.
Callers can leave sandbox networking unrestricted, block all network traffic
except the YuanRong control proxy, or deny selected DNS names:
Omitting
network, or passing an emptyNetworkPolicy, preserves the existingunrestricted behavior and does not send a policy to the runtime.
SDK and runtime behavior
NetworkPolicyis a backend-independent AKernel value type. The SDK validatesand normalizes DNS patterns before sandbox creation, lowercases names, removes
trailing dots, and deduplicates entries. Exact patterns match only the named
domain; a leading
*.pattern matches descendants but not the apex. Block modeand DNS blacklist mode are currently mutually exclusive.
Both supported YuanRong backends translate the public type into their native
wire representation. In block mode, lifecycle and command operations remain
available through the YuanRong control proxy. Filesystem operations fall back
to the RuntimeRPC data path instead of the direct node route, so large file
transfers may be slower.
The bundled standalone, Helm, and Terraform configurations enable sandboxd
network ACL support. The deployment documentation describes the required TC
eBPF and bpffs capabilities, DNS proxy port requirements, and the need to drain
existing sandboxes before enabling ACLs on an existing node.
This PR also updates the sandboxd submodule URL to
akernel-dev/sandboxdand pins the ACL-enabledmainrevision.Limitations
changed through the SDK.
HTTPS and direct connections to a known IP address are outside their scope.
block_networkanddns_blacklistcannot be combined in one policy.Validation
End-to-end validation on the test node covered all required modes:
filesystem operations remained available.
github.comwhile non-blacklisted namesremained resolvable.
AKernel SDK validation completed successfully against the coordinated
sandbox-sdk source used for the test-node build:
Draft follow-ups
This PR is ready for API and implementation review, but the YuanRong release
artifacts are not available yet. Before marking the PR ready for merge:
src/yuanronggitlink with the official YuanRongsuperproject revision containing the Frontend, FunctionSystem, and
sandbox-sdk changes.
openyuanrong-sandbox==0.10.0dependency with theactual published version.
OPEN_YR_VERSIONand the checksum-pinned openYuanRong core wheel forboth supported architectures.
make sdk-check, the all-in-one image build, and end-to-end ACL testsusing only the published artifacts.