witmproxy ⚠️ under construction 👷
A WASM-in-the-middle proxy, written in Rust.
Quick Start
1. Installation and setup
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)
2. Daemon management
# View daemon status
# Control the daemon
# View logs
# Manage installation
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
See WIT Publishing Documentation for more information.
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.