What are providers?
Providers are the foundation of Malbox’s machinery system. They handle the creation and allocation of compute infrastructure where analysis takes place. A provider is a component that implements a set of capability traits to interact with different infrastructure platforms. Providers abstract away the complexity of different technologies, giving you a consistent interface regardless of your underlying infrastructure. Providers register themselves at compile time using theinventory crate, so you can develop new providers independently of Malbox’s codebase.
Architecture
Malbox’s provider system is built on a capability-based architecture:ProviderHandle- a struct that wraps trait objects for each capability a provider supports. Created by the#[derive(RegisterProvider)]macro.ProviderMetadata- registered at compile time via theinventorycrate. Contains the provider name and a factory function that creates aProviderHandlefrom provider-specific TOML configuration.
create_provider(name, config), which finds the registered metadata and calls the factory function.
Capabilities
Providers declare which capabilities they support. One capability is mandatory; the rest are optional:| Capability | Required | Description |
|---|---|---|
| Allocate | Yes | Create and destroy machines. All providers must implement this. |
| Snapshot | No | Create, restore, and manage machine snapshots. |
| Clone | No | Clone existing machines to create new instances. |
| Migrate | No | Move machines between hosts. |
| GuestAccess | No | Transfer files and execute commands inside guest VMs. |
has_capability("snapshot") or list_capabilities().
Supported providers
libvirt
The built-in libvirt provider supports the Allocate, Snapshot, and Clone capabilities. It manages VMs through libvirt’s API and is enabled via theprovider-libvirt feature flag on the daemon.
Configuration in malbox.toml:
Next steps
- Read about Provisioners for configuring machines after creation
- Read about Packer for building machine images