witmproxy ⚠️ under construction 👷
A WASM-in-the-middle proxy, written in Rust.
Quick Start
1. Installation and setup
# Install via shell script
|
# Or install from crates.io
# First run: installs daemon and attaches to logs
# Run detached (start daemon without attaching to logs)
On first run, witm automatically:
- Installs the proxy as a system daemon (using launchd on macOS, systemd on Linux, or Windows Services)
- Starts the daemon service
- Attaches to the daemon's log output (unless
-d/--detachis specified)
Linux: Daemon management commands (
install,start,stop,restart,uninstall) require root privileges. Run them withsudo. Thestatusandlogscommands do not require root.macOS: Uses user-level launchd, so no
sudois needed for daemon management.
2. Daemon management
# View daemon status (no sudo required)
# Control the daemon (Linux: prefix with sudo)
# View logs (no sudo required)
# Manage installation (Linux: prefix with sudo)
Certificate Installation
The witm ca install command installs the witmproxy root certificate into your system's trust store. This command may prompt for sudo on both Linux and macOS.
3. Add plugins
Plugins are how you can extend witmproxy with whatever functionality your heart desires.
4. Creating a new plugin
The witmproxy plugin WIT interface is automatically published to GitHub Container Registry and can be consumed using wkg:
# Fetch the WIT interface for plugin development
Architecture
A not-entirely-accurate but pretty LLM-generated diagram:
┌─────────────────┐ ┌─────────────────────────────┐ ┌─────────────────┐
│ User device │ │ witmproxy │ │ Target Server │
│ │ │ │ │ │
│ ┌───────────┐ │ │ ┌───────────────────────┐ │ │ ┌───────────┐ │
│ │ App / │◄─┼──────┼─►│ TLS Termination │◄─┼──────┼─►│ HTTPS │ │
| | Browser | | │ └───────────────────────┘ │ │ │ Server │ │
│ └───────────┘ │ │ ┌───────────────────────┐ │ │ └───────────┘ │
│ │ │ | Encrypted SQLite | │ └─────────────────┘
└─────────────────┘ │ │ ┌───────────────┐ │ │
│ │ │ WASM Plugins │ │ │
┌─────────────────┐ │ │ └───────────────┘ │ │
│ Web Interface │ │ │ │ │
│ │ │ └───────────────────────┘ │
│ ┌───────────┐ │ │ ┌───────────────────────┐ │
│ │ Cert │──┼──────┼─►│ Cert CA │ │
│ │ Download │ │ │ └───────────────────────┘ │
│ └───────────┘ │ └─────────────────────────────┘
└─────────────────┘
⚠️ Security Considerations
- Certificate Trust: Installing the root certificate allows the proxy to decrypt all HTTPS traffic.
- Plugin capabilities: Plugins only have the permissions you give them, but you are responsible for verifying those permissions are restricted appropriately.
- Plugin execution can be limited using CEL expressions, restricting when they're allowed to run. While plugins come with their own recommended defaults, users always have the ability to restrict them as they see fit.
- Plugins may request host capabilities, which you are responsible to decide whether or not to provide.
future work:Whilewitmproxyprovides default implementations of capabilities we expect to be useful to plugin authors, as a user you may replace the implementation of capabilities granted to plugins.
Supporting the project
Consider either supporting the author directly, or supporting any of the maintainers of the projects that make witmproxy possible:
- mitmproxy the inspiration for this project
- sqlite the database engine used for storage
- Tokio the projects async runtime
- hyper the man-in-the-middle proxy server
- salvo the backend powering the web interface and API
- ...and more! (see
cargo.tomlfor a full list of our dependencies)
Contributing
Prerequisites
- Nightly Rust:
witmproxyrequires nightly Rust for development (rustup default nightlyor use+nightlywith cargo commands) - WASM target: Plugin development requires the
wasm32-wasip2target:rustup target add wasm32-wasip2 - wkg: The
wkgCLI is required for updating and fetching WIT (WebAssembly Interface Type) files used by the plugin interface
Steps
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Acknowledgements
Projects which make witmproxy possible (but don't actively list direct sponsorship options):
- Rust the programming language used to build this project
- wasmtime the WebAssembly runtime that runs plugins
- sqlcipher the encrypted database engine used for storage
- rustls the Rust TLS implementation
License
This project is licensed under the AGPLv3 License, with a paid commercial license available on request.