rust-ipmi is a native rust client for remotely managing/monitoring systems with hardware support for IPMI. IPMI is a specification which allows software to interact and communicate with systems through the BMC (Baseboard Management Controller). BMC is a hardware component which enables interaction with a computer's chassis, motherboard, and storage through LAN and serial.
- v0.1.1 is live on crates.io 🥳. See release notes here!
This is a hobby project to learn some rust, and is NOT a library meant for production use. If you would like a stable, well featured IPMI LAN client, look into ipmi-tool - a CLI tool which has been maintained for over a decade.
IPMI through LAN has multiple relatively well-documented security vulnerabilities. Here are a few suggestions to harden your security:
- Change the default IPMI username
- Keep port 623/UDP to the servers under a restrictive firewall
- Do not directly expose your servers to the WAN
Creating an ipmi client, authenticating against the BMC, and running a raw request
use rust_ipmi::{IPMIClient, NetFn};
fn main() {
// create the client for the server you want to execute IPMI commands against
let mut client: IPMIClient =
IPMIClient::new("192.168.88.10:623").expect("Failed to create ipmi client");
// establish a session with the BMC using the credentials specified
client
.establish_connection("billybob123", "superpassword")
.expect("Failed to establish the session with the BMC");
// send a command to the BMC using raw values
let response = client.send_raw_request(NetFn::App, 0x3b, Some(vec![0x04]));
match response {
Err(err) => println!("Failed to send the raw request; err = {:?}", err),
Ok(n) => println!("{}", n), // print the response
}
}