Skip to content

ethanbissbort/flux-framework-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Flux Framework

Modern Linux System Administration & Hardening Toolkit

Enterprise-grade server provisioning written in Rust πŸ¦€

Build Status License Rust Version Platform

Features β€’ Quick Start β€’ Modules β€’ Documentation β€’ Contributing


🌟 What is Flux?

Flux is a powerful, type-safe system administration framework that automates Linux server configuration, security hardening, and ongoing maintenance. Think of it as Infrastructure-as-Code meets Security-by-Default, all in a single blazingly fast binary.

πŸ’Ž Why Flux?

πŸš€ Fast         β†’ Native Rust performance, not shell scripts
πŸ”’ Secure       β†’ Security-first design with sensible defaults
🎯 Focused      β†’ One tool for system provisioning & hardening
πŸ“¦ Portable     β†’ Single binary, no dependencies
πŸ”§ Flexible     β†’ 11 modules, 5 workflows, fully composable
βœ… Reliable     β†’ Idempotent operations, automatic backups

✨ Features

πŸŽ›οΈ System Management

  • βœ… Package updates & security patches
  • βœ… Network configuration (static IP, VLANs)
  • βœ… User & group management
  • βœ… Hostname & FQDN setup
  • βœ… Certificate management

πŸ” Security Hardening

  • βœ… SSH hardening & fail2ban
  • βœ… Firewall (UFW/firewalld)
  • βœ… Kernel parameter tuning
  • βœ… Key-based authentication
  • βœ… Security compliance presets

🎨 Developer Experience

  • βœ… ZSH + Oh-My-Zsh setup
  • βœ… Custom MOTD banners
  • βœ… Interactive & scriptable modes
  • βœ… Comprehensive logging
  • βœ… Detailed help system

πŸ“Š Monitoring

  • βœ… Netdata integration
  • βœ… System health checks
  • βœ… Resource usage tracking
  • βœ… Service status monitoring
  • βœ… Custom dashboards

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Flux CLI                             β”‚
β”‚                    (Clap + Interactive)                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Workflows    β”‚          β”‚     Modules      β”‚
β”‚                β”‚          β”‚                  β”‚
β”‚ β€’ Essential    │◄────────── β€’ Network        β”‚
β”‚ β€’ Security     β”‚          β”‚ β€’ Hostname       β”‚
β”‚ β€’ Complete     β”‚          β”‚ β€’ Update         β”‚
β”‚ β€’ Development  β”‚          β”‚ β€’ User           β”‚
β”‚ β€’ Monitoring   β”‚          β”‚ β€’ SSH            β”‚
β”‚                β”‚          β”‚ β€’ Firewall       β”‚
β”‚                β”‚          β”‚ β€’ Sysctl         β”‚
β”‚                β”‚          β”‚ β€’ Certs          β”‚
β”‚                β”‚          β”‚ β€’ ZSH            β”‚
β”‚                β”‚          β”‚ β€’ MOTD           β”‚
β”‚                β”‚          β”‚ β€’ Netdata        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                           β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚   Helper Functions     β”‚
         β”‚                        β”‚
         β”‚ β€’ Logging              β”‚
         β”‚ β€’ Validation           β”‚
         β”‚ β€’ System Detection     β”‚
         β”‚ β€’ File Operations      β”‚
         β”‚ β€’ User Input           β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

πŸ“¦ Installation

Option 1: Build from Source (Recommended)

Prerequisites

Before building, ensure you have the required dependencies installed:

Quick Check (Automated):

# Clone the repository
git clone https://github.com/ethanbissbort/flux-framework-rust.git
cd flux-framework-rust

# Check and install all dependencies automatically
sudo ./scripts/check_dependencies.sh --install

Manual Installation:

Ubuntu/Debian
# Install build tools and dependencies
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev pkg-config git

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
RHEL/CentOS/Rocky/AlmaLinux/Fedora
# Install build tools and dependencies
sudo dnf install -y gcc gcc-c++ make openssl-devel pkg-config git
# OR for older systems: sudo yum install -y gcc gcc-c++ make openssl-devel pkg-config git

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
Arch/Manjaro
# Install build tools and dependencies
sudo pacman -S --noconfirm base-devel openssl pkg-config git

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
Alpine
# Install build tools and dependencies
sudo apk add build-base openssl-dev pkgconfig git

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

Building Flux

# Clone the repository (if not already done)
git clone https://github.com/ethanbissbort/flux-framework-rust.git
cd flux-framework-rust

# Build in release mode
cargo build --release

# Install system-wide
sudo install -m755 target/release/flux /usr/local/bin/flux

# Verify installation
flux --version

Troubleshooting Build Issues

Error: linker 'cc' not found or error occurred: Command "cc" ... failed

  • Cause: C compiler/linker not installed
  • Solution: Install build tools using the automated script:
    sudo ./scripts/check_dependencies.sh --install
    Or install manually for your distribution (see Manual Installation above)

Error: could not find native static library 'ssl'

  • Cause: OpenSSL development headers not installed
  • Solution:
    • Ubuntu/Debian: sudo apt-get install libssl-dev
    • RHEL/CentOS/Fedora: sudo dnf install openssl-devel
    • Arch: sudo pacman -S openssl
    • Alpine: sudo apk add openssl-dev

Error: Rust version ... is too old

  • Cause: Rust version older than 1.77
  • Solution: Update Rust with rustup update

Need Help? Run the dependency checker for a detailed report:

./scripts/check_dependencies.sh
Option 2: From Crates.io (Future)
cargo install flux-framework

βš™οΈ First Run

# 1. Check system compatibility
flux status

# 2. List available modules
flux list modules

# 3. Run essential setup (updates, certs, hardening)
sudo flux apply essential

# 4. Harden security (firewall, SSH, kernel)
sudo flux apply security

🎯 Common Tasks

# Configure SSH hardening
sudo flux module ssh --harden

# Setup a new admin user
sudo flux module user --admin alice --github alice

# Configure firewall with web server preset
sudo flux module firewall --preset web-server

# Install ZSH with Oh-My-Zsh
sudo flux module zsh --theme powerlevel10k

# Setup monitoring
sudo flux module netdata --install

🧩 Modules

Flux provides 11 specialized modules for comprehensive system management:

Module Status Description Key Features
πŸ”„ update βœ… System updates & patches Security updates, package management, reboot detection
🌐 network βœ… Network configuration Static IP, VLANs, diagnostics, interface management
🏷️ hostname βœ… Hostname & FQDN setup System naming, /etc/hosts management
πŸ‘€ user βœ… User & group management Admin users, SSH keys, GitHub integration
πŸ” ssh βœ… SSH hardening Port changes, key-only auth, fail2ban
πŸ›‘οΈ firewall βœ… Firewall management UFW/firewalld, presets, rule management
βš™οΈ sysctl βœ… Kernel hardening IPv4/IPv6 security, ASLR, performance tuning
πŸ“œ certs βœ… Certificate management System trust store, CA certificates
πŸ’» zsh βœ… ZSH shell setup Oh-My-Zsh, themes, plugins, aliases
πŸ“‹ motd βœ… Dynamic MOTD System info, resource usage, security status
πŸ“Š netdata βœ… Monitoring agent Real-time metrics, health checks, dashboards

πŸ’‘ Tip: Run flux module <name> --help for detailed usage information

πŸ“– Full Module Documentation β†’


πŸ”— Workflows

Workflows combine multiple modules into cohesive provisioning pipelines:

🌟 Essential

Perfect for: Fresh server setup, base configuration

sudo flux apply essential

Includes: update β†’ certs β†’ sysctl β†’ ssh

What it does:

  • βœ… Updates all packages to latest versions
  • βœ… Installs required certificates
  • βœ… Applies kernel hardening parameters
  • βœ… Configures SSH security

πŸ”’ Security

Perfect for: Hardening existing servers, security compliance

sudo flux apply security

Includes: firewall β†’ ssh β†’ sysctl

What it does:

  • βœ… Configures firewall with deny-all default
  • βœ… SSH hardening (port change, key-only auth)
  • βœ… Kernel security parameters

🎯 Complete

Perfect for: Full server provisioning from scratch

sudo flux apply complete

Includes: All 11 modules in optimized sequence


πŸ’» Development

Perfect for: Developer workstations, coding environments

sudo flux apply development

Includes: user β†’ zsh β†’ certs


πŸ“Š Monitoring

Perfect for: Setting up observability stack

sudo flux apply monitoring

Includes: netdata β†’ certs β†’ motd


πŸ“– Full Workflow Guide β†’


🎨 Usage Examples

πŸ”§ Setup a Web Server
# 1. Essential baseline
sudo flux apply essential

# 2. Create admin user
sudo flux module user --admin deploy --github deploybot

# 3. Configure firewall for web traffic
sudo flux module firewall --preset web-server

# 4. Harden SSH
sudo flux module ssh --port 2222 --disable-passwords

# 5. Setup monitoring
sudo flux module netdata --install

# 6. Custom MOTD
sudo flux module motd --org "MyCompany" --banner flux-large
πŸ—„οΈ Database Server Hardening
# Run security workflow
sudo flux apply security

# Configure firewall for database
sudo flux module firewall --preset database-server

# Apply strict kernel parameters
sudo flux module sysctl --apply

# Setup monitoring
sudo flux module netdata --install
πŸ’» Developer Workstation Setup
# Run development workflow
sudo flux apply development

# Install ZSH with custom theme
sudo flux module zsh --theme agnoster --plugins "git docker kubectl"

# Setup custom MOTD
sudo flux module motd --org "Dev Team" --banner simple

πŸ“– More Examples β†’


πŸ“š Documentation

πŸ“– User Guides

πŸ› οΈ Development

πŸ“ Reference

  • claude.md - Complete framework reference for AI assistants

🐧 Supported Distributions

Distribution Support Status Notes
🟒 Ubuntu βœ… Full 20.04+, 22.04+, 24.04+
🟒 Debian βœ… Full 11, 12
🟒 RHEL βœ… Full 8, 9
🟒 CentOS βœ… Full Stream 8, 9
🟒 Rocky Linux βœ… Full 8, 9
🟒 AlmaLinux βœ… Full 8, 9
🟒 Fedora βœ… Full 38, 39, 40
🟑 Alpine πŸ”œ Planned v0.5
🟑 Arch πŸ”œ Planned v0.5

🀝 Contributing

We ❀️ contributions! Whether it's:

Quick Contribution Guide

# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/flux-framework-rust.git

# 2. Create a branch
git checkout -b feature/amazing-feature

# 3. Make your changes and test
cargo test
cargo clippy
cargo fmt

# 4. Commit with DCO sign-off
git commit -s -m "Add amazing feature"

# 5. Push and create PR
git push origin feature/amazing-feature

πŸ“– Full Contributing Guide β†’


πŸ—ΊοΈ Roadmap

βœ… Version 3.0 (Current)

  • Complete Rust migration from shell scripts
  • All 11 modules implemented
  • 5 workflows operational
  • Comprehensive error handling
  • Interactive & scriptable modes

🎯 Version 3.1 (Next)

  • Configuration file support (flux.toml)
  • Dry-run mode for all operations
  • Enhanced logging with JSON output
  • Module dependency resolution
  • Automatic rollback on failure

πŸš€ Version 3.2

  • Plugin system for custom modules
  • Remote execution support
  • Multi-server orchestration
  • Web UI dashboard
  • API server mode

🌟 Version 4.0

  • Alpine & Arch Linux support
  • Container-based testing
  • Integration with Ansible/Terraform
  • Cloud provider integrations
  • Compliance reporting (CIS, NIST)

πŸ“– Detailed Roadmap β†’


πŸ“Š Project Stats

πŸ“¦ Modules:     11 βœ… | 0 πŸ”œ
πŸ”— Workflows:   5 βœ…  | 0 πŸ”œ
πŸ§ͺ Tests:       Coverage in progress
πŸ“„ Lines:       ~12,000 lines of Rust
⚑ Binary Size: <5 MB (release)

πŸ™ Acknowledgements

Flux stands on the shoulders of giants:

Special thanks to all contributors!


πŸ“œ License

Flux Framework is dual-licensed under your choice of:

This means you can use Flux in your projects under either license.


πŸ“¬ Contact & Support


⚑ Built with ❀️ and Rust πŸ¦€

Making Linux system administration fast, safe, and enjoyable

⬆ Back to Top

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •