| Crates.io | alhalo |
| lib.rs | alhalo |
| version | 0.3.1 |
| created_at | 2025-09-14 22:54:35.699443+00 |
| updated_at | 2025-10-15 03:12:54.580409+00 |
| description | Linux system audit library and CLI for home users and sysadmins. |
| homepage | https://github.com/AlethaLabs/halo |
| repository | https://github.com/AlethaLabs/halo |
| max_upload_size | |
| id | 1839243 |
| size | 2,352,499 |
A Linux System Audit Library and CLI by Aletha Labs
HALO is a modular Rust-based tool for auditing, parsing, and rendering Linux system configuration. It is designed to be simple for home users, yet powerful for sysadmins, with a focus on extensibility, actionable output, and maintainable code.
HALO separates its CLI and library code for maintainability and extensibility:
src/cli.rs) parses commands and dispatches to handler functions for each command.src/handle_args.rs perform the actual work (parsing, auditing, rendering).src/) provides core audit logic, config loading, and output rendering.
This modular structure makes it easy to add new CLI commands or audit rules.This is a rust program, so rust is required to build the library. If you need help with installing rust check out the - Rust Installation Guide
git --version
git clone https://github.com/AlethaLabs/HALO.git
cd HALO
cargo build --release
Run the interactive CLI:
cargo run
Welcome to Aletha Labs: HALO - Host Armor for Linux Operations
Please enter your commands, or type 'help' for further information
halo> check --target user
[
{
"severity": "None",
"status": "Pass",
"path": "/etc/passwd",
"expected_mode": "644",
"found_mode": "644",
"importance": "Medium"
},
{
...
}
]
Summary: 29 checked, 27 passed, 0 strict, 2 failed
[!] FAIL: /etc/shadow (found: 640, expected: 600)
Suggested fix: chmod 600 /etc/shadow
Would you like to apply the suggested fixes? [y/N]: y
--- Permission Fix Generated ---
#!/bin/bash
# Halo Permission Fix Script
chmod 600 /etc/shadow
Run suggested fixes? [y/N]: y
Running fix script as root (requires sudo)...
[sudo] password for AlethaLabs: password123
Permissions fixed
.....
Or use commands directly:
# Get help for commands
cargo run help
cargo run check --help
cargo run parse --help
./target/release/alhalo check --target -h
# Parse and render a file
cargo run parse --file /proc/cpuinfo --format json
# Network discovery - scan local network devices
cargo run net --devices --format json
cargo run net -d # Pretty print format
# Run both permissions and ownership audit at once
cargo run check --path /etc/shadow --expect 600 --importance high --expect-uid 0 --expect-gid 42 --format json
# Audit user files
./target/release/alhalo check --target user
# Audit a file with expected permissions and importance
./target/release/alhalo check --path /etc/shadow --expect 640 --importance high
# Audit file ownership (UID/GID)
./target/release/alhalo check --path /etc/shadow --expect-uid 0 --expect-gid 42
# Load custom audit rules from TOML
cargo run check --toml config.toml
# Generate Bash completion script
./target/release/alhalo bash --out halo.bash
source halo.bash
./target/release/alhalo check --toml /examples/toml_configs/permissions_config.toml
cargo run --example audit_permissions
Add to your Rust project and use the API - See docs:
cargo add alhalo
PermissionRules::new() to create audit rules.Renderable trait for consistent output formatting.Renderable types for consistent output formatting.use alhalo::{
audit::{PermissionRules, Importance, default_permissions::SystemPermissionConfig},
render_output::{Renderable, OutputFormat}
};
// Network device discovery
let devices = alhalo::audit::networking::discovery::get_arp_devices()
.expect("Failed to discover network devices");
devices.render_and_print(&OutputFormat::Json);
// Define custom audit rules
let (rule, _status) = PermissionRules::new("/etc/shadow".into(), 0o600, Importance::High);
let mut visited = std::collections::HashSet::new();
let results = rule.check(&mut visited);
results.render_and_print(&OutputFormat::Pretty);
// Use custom audit for simpler one-off checks
let results = PermissionRules::custom_audit("/etc/shadow".into(), 0o600, Importance::High);
results.render_and_print(&OutputFormat::Csv);
// Use default system audits
let system_config = SystemPermissionConfig::default();
let results = system_config.audit_permissions();
results.render_and_print(&OutputFormat::Csv);
This crate is tested with Rust 1.65 and newer. Please use a recent stable toolchain for best results.
Contributions are welcome! Please open issues or pull requests for bugs, features, or improvements.
See CONTRIBUTING.md for:
MIT
For more details, see the crate documentation or run --help in the CLI.
Commands enum and adding handler functions.src/ modules; integration tests are in tests/.