Vault Audit Tools (Rust CLI)
A high-performance command-line tool for analyzing HashiCorp Vault audit logs.
Quick Start
Build
Run
# System overview analysis
# See all available commands
Available Commands
| Command | Status | Description |
|---|---|---|
system-overview |
✅ | Identify high-volume operations and stress points |
kv-analyzer |
🚧 | Analyze KV usage by path and entity |
kv-compare |
🚧 | Compare KV usage between time periods |
kv-summary |
🚧 | Summarize KV usage statistics |
token-operations |
🚧 | Analyze token operations by entity |
token-export |
🚧 | Export token lookup patterns to CSV |
token-lookup-abuse |
🚧 | Detect suspicious token lookup patterns |
entity-gaps |
🚧 | Analyze entity creation/deletion gaps |
entity-timeline |
🚧 | Show operation timeline for specific entity |
path-hotspots |
🚧 | Identify frequently accessed paths |
k8s-auth |
🚧 | Analyze Kubernetes authentication patterns |
airflow-polling |
🚧 | Analyze Airflow polling behavior |
✅ = Complete | 🚧 = In Progress
Performance
Processes ~4 million audit log entries in ~20 seconds (3x faster than Python equivalent).
Example Usage
System Overview
Output:
- Operation type distribution
- Top path prefixes
- Highest volume paths
- Most active entities
- System stress points
Future Commands (After Conversion)
# KV usage analysis
# Token abuse detection
# Entity timeline
Development
Project Structure
src/
├── main.rs # CLI entry point
├── lib.rs # Library exports
├── audit/ # Core parsing logic
│ ├── types.rs # Data structures
│ └── parser.rs # Streaming parser
├── commands/ # Analysis tools
│ └── system_overview.rs
└── utils/ # Shared utilities
└── time.rs
Adding a New Command
- Create module in
src/commands/your_command.rs - Implement
pub fn run(...) -> Result<()> - Add to
src/commands/mod.rs - Add subcommand variant in
src/main.rs
Testing
# Run tests
# Check for warnings
# Format code
Dependencies
- clap - Command-line argument parsing
- serde/serde_json - JSON deserialization
- chrono - Date/time handling
- anyhow - Error handling
- csv - CSV I/O
See Cargo.toml for full dependency list.