PhoenixBoot (PhoenixGuard) is a firmware defense system that provides hardware-level recovery, secure boot enforcement, and comprehensive UEFI boot chain protection. This document describes the system architecture and design principles.
PhoenixBoot operates on multiple security layers:
- Hardware Layer: Direct hardware register access below the bootkit layer
- Firmware Layer: UEFI applications with cryptographic verification
- Boot Chain Layer: Secure Boot key management and enforcement
- OS Layer: Kernel module signing and security checks
PhoenixBoot assumes attacks will succeed and focuses on:
- Guaranteed recovery from firmware-level compromises
- Multiple independent recovery paths for resilience
- Hardware-level operations that bypass software-based attacks
- Cryptographic verification at every boot stage
All components are isolated and independently testable:
- Container-based for reproducibility
- Script-based for transparency and auditability
- Task-based for workflow automation
Battle-tested UEFI bootloader with strict security:
- Secure Boot enforcement - Requires Secure Boot enabled
- Runtime attestation - Verifies binary hash against sidecar file
- Network boot support - Downloads configuration over HTTPS
- Memory-safe - Built with EDK2 for reliability
Automated Secure Boot key enrollment:
- Enrolls PK, KEK, and db keys from ESP
- Supports authenticated variables
- Prepares system for custom Secure Boot configuration
Universal UEFI diagnostic and management tool:
- System information - Firmware version, memory, security status
- Variable management - View, edit, and analyze all UEFI variables
- Security analysis - Detect suspicious variables and patterns
- Nuclear wipe capability - Complete system sanitization
- Debug diagnostics - Comprehensive system dump for deep analysis
Central automation system using the pf-runner framework:
- core.pf - Essential functionality (build, test, keys, MOK)
- secure.pf - Advanced Secure Boot operations
- workflows.pf - Multi-step workflows (ESP, CD, USB)
- maint.pf - Maintenance tasks (lint, format, cleanup)
All operational scripts organized by category:
scripts/
├── build/ # Build operations
├── testing/ # QEMU and validation tests
├── mok-management/ # MOK and module signing
├── esp-packaging/ # ESP image creation
├── secure-boot/ # SecureBoot key management
├── validation/ # Security checks and scanning
├── recovery/ # Hardware recovery and wipe
├── uefi-tools/ # UUEFI operations
├── usb-tools/ # USB media creation
├── qemu/ # QEMU test runners
└── maintenance/ # Project maintenance
Specialized Python tools for complex operations:
- pgmodsign.py - Kernel module signing
- kernel_hardening_analyzer.py - DISA STIG compliance checking
- kernel_config_remediation.py - Kernel config fixing
- firmware_checksum_db.py - Firmware verification
- cert_inventory.py - Certificate management
- uefi_variable_analyzer.py - UEFI variable analysis
Modular, reproducible container-based execution:
- EDK2 toolchain for UEFI compilation
- GCC, Make, NASM for native builds
- Produces: NuclearBootEdk2.efi, KeyEnrollEdk2.efi, UUEFI.efi
- QEMU for UEFI boot testing
- OVMF firmware for SecureBoot testing
- JUnit report generation
- Negative attestation testing
- ESP image creation (FAT32)
- ISO integration and loopback
- Bootable media packaging
- Key enrollment preparation
- On-host operations (efibootmgr, mokutil)
- Real hardware UEFI variable access
- Boot entry management
- MOK enrollment
- Interactive terminal interface
- Task categorization and execution
- Real-time output display
- Modern, user-friendly experience
Source Code (staging/src/)
↓
Build Container (EDK2 compilation)
↓
Production Binaries (staging/boot/)
↓
ESP Packaging (out/esp/)
↓
Bootable Media (USB/CD/ISO)
System Boot
↓
secure-env-check.sh
├─► EFI Variable Scan
├─► Boot Integrity Check
├─► Secure Boot Status
├─► Kernel Security Check
├─► Bootkit Detection
└─► Module Signature Verification
↓
Security Report (JSON + Text)
Compromised Firmware Detected
↓
Hardware Recovery Script
├─► Direct Register Access (/dev/mem)
├─► Unlock Flash Protection (FLOCKDN)
├─► Dump Current Firmware (flashrom)
├─► Verify Against Baseline
└─► Restore Known-Good Firmware
↓
System Restored
PK (Platform Key) - Root of trust
↓
KEK (Key Exchange Key) - Intermediate authority
↓
db (Signature Database) - Allowed signatures
↓
Signed Bootloaders & Kernels
MOK (Machine Owner Key) - User-controlled
↓
Signed Kernel Modules
↓
Module Loading with SecureBoot Enabled
PhoenixBoot operates at multiple hardware levels:
- UEFI Runtime Services
- Operating System APIs
- File System Access
- Direct Memory-Mapped I/O (/dev/mem)
- SPI Controller Registers
- CPU Model Specific Registers (MSRs)
- Chipset Configuration Registers
Key Innovation: PhoenixGuard operates below the software layer where bootkits live, making it immune to firmware-level malware.
PhoenixBoot/
├── pf.py, *.pf # Task runner and definitions
├── staging/ # Production-ready code
│ ├── src/ # UEFI application source
│ ├── boot/ # Compiled EFI binaries
│ └── tools/ # Build scripts
├── scripts/ # Operational scripts (organized)
├── utils/ # Python utilities
├── containers/ # Container definitions
├── out/ # Build artifacts and results
│ ├── staging/ # Compiled binaries
│ ├── esp/ # ESP images
│ ├── qemu/ # Test logs and reports
│ └── keys/ # Generated keys
├── keys/ # SecureBoot keys (legacy)
├── docs/ # Comprehensive documentation
├── tests/ # Test suites
└── examples_and_samples/ # Demo materials
- Individual script validation
- Python utility tests
- UEFI application compilation tests
- QEMU boot tests (basic, SecureBoot, strict mode)
- Negative attestation testing (corruption detection)
- UUEFI diagnostic testing
- End-to-end workflows
- Real hardware boot validation
- Key enrollment on physical systems
- Module signing verification
- Recovery procedure validation
Protected Against:
- ✅ Bootkits (firmware-level malware)
- ✅ Rootkits (kernel-level malware)
- ✅ Supply chain attacks (compromised firmware)
- ✅ Unauthorized boot modifications
- ✅ Malicious kernel modules
Not Protected Against:
⚠️ Hardware tampering (requires physical security)⚠️ Side-channel attacks (timing, power analysis)⚠️ Zero-day vulnerabilities in EDK2/firmware⚠️ Evil maid attacks without boot password
- Secure Boot Enforcement - Cryptographic chain of trust
- Hardware-Level Recovery - Direct register access
- Attestation - Runtime binary verification
- Module Signing - Prevent unsigned kernel modules
- Security Monitoring - Continuous integrity checking
- Nuclear Wipe - Complete system sanitization option
# Local development with containers
docker-compose --profile build up
docker-compose --profile test up# GitHub Actions automated testing
./pf.py build-build
./pf.py test-qemu
./pf.py test-e2e-all# Systemd services with Podman Quadlet
systemctl start phoenixboot-runtime.service# Create standalone bootable media
./create-secureboot-bootable-media.sh --iso ubuntu.isoPhoenixBoot is designed to be extended:
- Create script in appropriate
scripts/subdirectory - Add task definition to relevant
.pffile - Test with
./pf.py <task-name>
- Add source to
staging/src/ - Create build script in
staging/tools/ - Update ESP packaging scripts
- Add check script to
scripts/validation/ - Integrate into
secure-env-check.sh - Update reporting format
- Build Time: EDK2 compilation ~2-5 minutes
- Test Time: QEMU boot tests ~30-60 seconds each
- ESP Creation: ~10-30 seconds
- Security Scan: ~5-15 seconds
- Always test in QEMU first before hardware deployment
- Use the task runner (
./pf.py) for consistent operations - Keep keys secure - Store in encrypted locations
- Regular security scans - Run
secure-envperiodically - Maintain baselines - Keep known-good firmware checksums
- Document changes - Track key enrollments and modifications
- Cloud attestation API for remote verification
- Distributed firmware database for cooperative defense
- Hardware Security Module (HSM) integration
- Automated firmware update verification
- TPM 2.0 measured boot integration
- UEFI Capsule update support
Made with 🔥 for a more secure boot process