POC: Add network and DNS filtering with approval UI#631
POC: Add network and DNS filtering with approval UI#631benoitf wants to merge 1 commit intocontainers:mainfrom
Conversation
Proof of concept for network traffic filtering and DNS request approval in gvisor-tap-vsock (see containers#630). Adds filtering logic for TCP/UDP forwarders and DNS services, a configuration model for filter rules, and a Svelte-based approval web UI. This is a POC generated via vibe coding using Claude Code (AI-assisted). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: benoitf The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Fwiw, I’m not sure about adding the svelte UI to the gvisor-tap-vsock repo, but that’s not central to this feature |
|
sure, I don't think it should be there, I only provided it as a convenient way rather than using curl/rest commands |
|
#609 attempts to solve a very similar usecase, though I don’t think it has the "request" feature. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
POC for outbound network and DNS filtering in gvisor-tap-vsock, built entirely via vibe coding with Claude Code AI.
gvproxy-demo.mov
related to #630
What was done
pkg/services/forwarder/filter.go): ACL-based filtering for outbound TCP/UDP connections with CIDR, port, and protocol matching. First-match-wins rule evaluation.pkg/services/dns/filter.go): Domain-level filtering with allow/block lists and wildcard support (*.example.com). Denied domains are tracked.--secure-mode): When enabled, all outbound traffic is denied by default. Blocked connections are held pending (up to 30s timeout) while waiting for user approval via the HTTP API. Approved DNS domains automatically whitelist the resolved IPs for TCP/UDP./network/eventsendpoint streams connection events (pending, approved, denied) and DNS events to subscribers.approval/): A web frontend that connects to the SSE stream and lets users approve/deny pending connections and DNS queries in real-time.pkg/types/configuration.go):NetworkPolicyandDNSPolicytypes supporting YAML config files or the--secure-mode/--network-policyCLI flags.Architecture
VM → gvisor-tap-vsock → DNS Filter → upstream DNS
→ Network Filter (TCP/UDP) → internet
↕
HTTP API + SSE ← Approval UI (Svelte)
How to quickly test
1. Secure mode (deny-all + interactive approval)