Skip to main content

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 the inventory 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 the inventory crate. Contains the provider name and a factory function that creates a ProviderHandle from provider-specific TOML configuration.
Malbox looks up providers by name at runtime using 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:
CapabilityRequiredDescription
AllocateYesCreate and destroy machines. All providers must implement this.
SnapshotNoCreate, restore, and manage machine snapshots.
CloneNoClone existing machines to create new instances.
MigrateNoMove machines between hosts.
GuestAccessNoTransfer files and execute commands inside guest VMs.
You can query a provider’s capabilities at runtime via 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 the provider-libvirt feature flag on the daemon. Configuration in malbox.toml:
[providers.libvirt]
uri = "qemu:///system"

Next steps

  • Read about Provisioners for configuring machines after creation
  • Read about Packer for building machine images