Skip to content
gniPublic

About

DinD dns & proxy infrastructure for agents sandbox (experimental)

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

Repository files navigation

Ottergate

Ottergate is a Go-based DNS and HTTP/HTTPS egress gateway designed to restrict and filter network access for untrusted code execution sandboxes.

This project is a Go port of the original Node.js implementation: zonzon.


How it works

[ Sandbox Client ] ---> ( Ottergate ) ---> [ Public Internet ]
  1. System Call Isolation: Your sandbox runtime (e.g., gVisor / runsc) isolates the OS kernel.
  2. Network Egress Containment: Ottergate intercepts and filters DNS and HTTP/HTTPS traffic to prevent SSRF and exfiltration.

Features

  • DNS Interception: Serves local DNS mappings or forwards permitted queries to upstream resolvers.
  • SSRF Protection: Blocks private RFC 1918 subnets and cloud provider metadata services (169.254.169.254).
  • Client Sandbox Isolation: Prevents lateral network movement between untrusted agent sandboxes.
  • Egress Filtering: Restricts outbound connections to specific IP addresses and wildcard domains (e.g., *.openai.com).
  • L7 Proxying & mTLS: Proxies HTTP/HTTPS traffic, injects custom headers, evaluates URL-specific header injection rules (url_rules), and validates upstream client certificates (mTLS).
  • Per-Client Configuration Layering & Differential Persistence: Supports dedicated per-client configuration files (config/clients/<clientname>-<sanitized-ip>.json, e.g. clientname-172200101.json). Clients can inject custom headers, add client-only hosts, or customize firewall rules. Only delta overrides are stored; unoverridden elements inherit from the global base configuration. Files are generated, updated, and pruned automatically via the Dashboard.
  • IPv6 Dual-Stack & Toggle Control: Full IPv6 resolution (AAAA records) and dual-stack proxy routing with an on/off control toggle in the visual dashboard and configuration ("enableIpv6": true|false).
  • L4 SNI Passthrough: Transparently tunnels TLS connections without terminating upstream certificates.
  • Visual Dashboard & Autosave: Web-based control plane featuring real-time telemetry, visual configuration editor with autosave, and sandbox isolation monitoring.
  • Secret Encryption: Encrypts sensitive configuration headers in memory and at rest using AES-256-GCM.

Quick Start

1. Build and Launch

docker compose build
docker compose up -d

2. Run Tests

Runs syntax checks, Go unit tests, proxy integration tests, and sandbox verification:

./tests/run_all_tests.sh

Configuration

Configurations are stored in config/config.json:

{
  "port": 53,
  "httpPort": 80,
  "httpsPort": 443,
  "fallbackDns": "1.1.1.1",
  "firewall": {
    "defaultPolicy": "deny",
    "allowlist_domains": [
      "*.openai.com",
      "*.github.com"
    ],
    "blocklist_domains": [
      "*.malicious-domain.example",
      "malicious-domain.example"
    ],
    "allowlist_ips": [
      "172.21.0.100"
    ],
    "blocklist_ips": [
      "127.0.0.1",
      "169.254.169.254",
      "100.100.100.200"
    ],
    "allowlist_ranges": [
      "0.0.0.0/0"
    ],
    "blocklist_ranges": [
      "10.0.0.0/8",
      "172.16.0.0/12",
      "192.168.0.0/16",
      "127.0.0.0/8",
      "169.254.0.0/16"
    ]
  }
}

License

Apache License 2.0.

About

DinD dns & proxy infrastructure for agents sandbox (experimental)

Resources

Stars

3 stars

Watchers

1 watching

Forks

Contributors

Languages