Skip to content

Security: melihxz/ferryboot

Security

docs/security.md

FerryBoot Security Design

Overview

FerryBoot implements multiple layers of security to protect the boot process and ensure system integrity.

Password Protection

BIOS Password

FerryBoot supports BIOS password protection:

  • Master password for bootloader access
  • User password for specific boot entries
  • Password hashing with salted SHA-256

UEFI Password

UEFI systems use the platform's built-in password features:

  • Setup password for firmware settings
  • Boot password for OS selection
  • Integration with UEFI security protocols

Secure Boot

UEFI Secure Boot

FerryBoot supports UEFI Secure Boot:

  • Signed bootloader binaries
  • Verification of OS kernel signatures
  • Integration with Microsoft UEFI CA
  • Support for custom certificate authorities

BIOS Secure Boot

For BIOS systems, FerryBoot implements its own secure boot mechanism:

  • RSA signature verification
  • SHA-256 hashing
  • Certificate chain validation
  • Revocation list support

Disk Encryption

LUKS Support

FerryBoot can unlock LUKS-encrypted volumes:

  • Prompt for passphrase
  • Support for key files
  • Integration with LUKS header parsing
  • Support for multiple key slots

BitLocker Support

FerryBoot supports BitLocker-encrypted volumes:

  • TPM integration
  • Recovery key support
  • Password/PIN authentication
  • Compatible with Windows BitLocker

VeraCrypt Support

FerryBoot supports VeraCrypt-encrypted volumes:

  • Password authentication
  • Keyfile support
  • Hidden volume detection
  • System encryption support

Kernel Verification

Signature Verification

FerryBoot verifies kernel signatures before loading:

  • RSA signature checking
  • SHA-256/SHA-512 hashing
  • Certificate validation
  • Certificate revocation checking

Hash Verification

For unsigned kernels, FerryBoot can verify file hashes:

  • SHA-256 kernel hash verification
  • Configuration-stored hash values
  • Automatic hash generation tool

Memory Protection

Stack Protection

FerryBoot implements stack protection:

  • Stack canaries
  • Stack overflow detection
  • Secure stack initialization

Heap Protection

Memory allocation protection:

  • Bounds checking
  • Double-free detection
  • Use-after-free prevention

Trusted Boot

TPM Integration

FerryBoot supports TPM for trusted boot:

  • PCR extension
  • Measured boot
  • Attestation support
  • Seal/unseal operations

Integrity Measurement

Boot process integrity measurement:

  • Component hashing
  • Measurement log
  • Remote attestation
  • Integrity verification

Secure Communication

Network Security

For network boot operations:

  • TLS/SSL support
  • Certificate validation
  • Encrypted PXE boot
  • Secure configuration download

Anti-Tampering

Bootloader Integrity

Protect bootloader from tampering:

  • Self-checksum verification
  • Read-only storage
  • Hardware-based protection
  • Tamper detection alerts

Configuration Protection

Secure configuration storage:

  • Encrypted configuration
  • Integrity verification
  • Access control
  • Audit logging

Implementation Details

Cryptographic Libraries

FerryBoot uses proven cryptographic implementations:

  • RSA for asymmetric cryptography
  • AES for symmetric encryption
  • SHA-256/SHA-512 for hashing
  • HMAC for message authentication

Key Management

Secure key storage and management:

  • Hardware key storage (TPM)
  • Secure key derivation
  • Key rotation support
  • Certificate management

Security APIs

Cryptography API

// Hash functions
int sha256_hash(const void* data, size_t len, uint8_t* hash);
int sha512_hash(const void* data, size_t len, uint8_t* hash);

// RSA operations
int rsa_verify(const uint8_t* signature, size_t sig_len,
               const uint8_t* data, size_t data_len,
               const rsa_public_key_t* pubkey);

// AES operations
int aes_decrypt(const uint8_t* ciphertext, size_t len,
                const uint8_t* key, size_t key_len,
                const uint8_t* iv, uint8_t* plaintext);

Security Module Interface

// Security module interface
typedef struct {
    int (*init)(void);
    void (*cleanup)(void);
    int (*verify_signature)(const uint8_t* sig, size_t sig_len,
                           const uint8_t* data, size_t data_len);
    int (*decrypt_volume)(const char* device, const char* passphrase);
} security_module_t;

Security Testing

Vulnerability Scanning

Regular security testing:

  • Static analysis
  • Dynamic analysis
  • Fuzz testing
  • Penetration testing

Compliance

Security standard compliance:

  • NIST guidelines
  • FIPS 140-2
  • Common Criteria
  • ISO 27001

Best Practices

Development

Security-focused development practices:

  • Secure coding guidelines
  • Code review processes
  • Threat modeling
  • Security training

Deployment

Secure deployment practices:

  • Secure key management
  • Regular updates
  • Monitoring and logging
  • Incident response

There aren’t any published security advisories