Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/build-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Build SecureOS ISO
run: |
sudo bash scripts/build_iso.sh
sudo ./build-iso.sh

- name: Verify ISO was created
run: |
Expand All @@ -56,6 +56,10 @@ jobs:
ls -lh iso-build/
echo "ISO Size: $(du -h iso-build/${{ env.ISO_NAME }} | cut -f1)"

- name: Run ISO verification
run: |
./verify-iso.sh || echo "Verification completed with warnings"

- name: Generate checksums
run: |
cd iso-build
Expand Down Expand Up @@ -97,11 +101,20 @@ jobs:
See [README.md](https://github.com/${{ github.repository }}/blob/master/README.md) for installation instructions.

## Features

### Core Security
- Full disk encryption (LUKS2)
- Hardened kernel
- Hardened kernel with security features
- AppArmor, UFW firewall, auditd
- Privacy tools: Tor, encrypted DNS
- Automatic security updates
- No telemetry

### v5.0.0 Advanced Features
- Quantum-resistant cryptography (NIST PQC)
- Blockchain-based audit logging
- AI-powered threat detection
- Self-healing security system
- Advanced malware sandboxing
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build artifacts
iso-build/
build-output/
*.iso
*.img
build.log
Expand Down
213 changes: 186 additions & 27 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# SecureOS Build Guide

## Overview
Building the SecureOS ISO creates a bootable installation media with all security and privacy features pre-configured.
Building the SecureOS ISO creates a bootable installation media with all security and privacy features pre-configured, including advanced v5.0.0 features like quantum-resistant cryptography, blockchain audit logging, AI-powered threat detection, self-healing security, and advanced malware sandboxing.

## System Requirements for Building

### Minimum:
- Ubuntu/Debian-based Linux system
- 10GB free disk space
- Ubuntu/Debian-based Linux system (Ubuntu 20.04+ or Debian 11+)
- 15GB free disk space (for /tmp directory)
- 4GB RAM
- Fast internet connection (will download ~2GB)
- Root/sudo access

### Recommended:
- 20GB free disk space
- 25GB free disk space
- 8GB RAM
- SSD storage
- Dedicated build machine or VM
- Multi-core CPU (for faster compilation)

## Build Time Estimates

Expand All @@ -34,36 +35,64 @@ git clone https://github.com/barrersoftware/SecureOS.git
cd SecureOS
```

### 2. Review the Build Script
### 2. Choose Your Build Script

SecureOS provides multiple build options:

- **`build-iso.sh`** (Recommended): Comprehensive build with v5.0.0 features
- **`scripts/build_iso.sh`**: Standard build with all security features
- **`scripts/build_iso_fast.sh`**: Faster build with fewer packages (for testing)

### 3. Review the Build Script (Optional)
```bash
cat build-iso.sh
```

### 4. Run the Build (requires sudo)

**Comprehensive Build (Recommended):**
```bash
cat scripts/build_iso.sh
sudo ./build-iso.sh
```

### 3. Run the Build (requires sudo)
**Standard Build:**
```bash
sudo bash scripts/build_iso.sh
```

### 4. Monitor Progress
**Fast Build (for testing):**
```bash
sudo bash scripts/build_iso_fast.sh
```

### 5. Monitor Progress
The build process will:
1. Install dependencies (debootstrap, squashfs-tools, etc.)
2. Bootstrap Ubuntu 24.04.3 base system
1. Check and install dependencies (debootstrap, squashfs-tools, xorriso, etc.)
2. Bootstrap Ubuntu 24.04.3 (Noble) base system
3. Install kernel and system packages
4. Install security tools (UFW, AppArmor, auditd, fail2ban, ClamAV)
5. Install privacy tools (Tor, Privoxy, macchanger, MAT2)
6. Apply security hardening
7. Create squashfs filesystem
8. Generate bootable ISO with GRUB

### 5. Build Output
6. **Install v5.0.0 advanced features:**
- Quantum-resistant cryptography
- Blockchain-based audit logging
- AI-powered threat detection
- Self-healing security system
- Advanced malware sandboxing
7. Apply security hardening
8. Create compressed squashfs filesystem
9. Generate bootable ISO with GRUB

### 6. Build Output
When complete, you'll find:
```
iso-build/
├── SecureOS-1.0.0-amd64.iso # Bootable ISO (~1.5GB)
├── SecureOS-1.0.0-amd64.iso # Bootable ISO (~1.5-2.0GB)
├── SecureOS-1.0.0-amd64.iso.sha256 # SHA256 checksum
└── SecureOS-1.0.0-amd64.iso.md5 # MD5 checksum
```

Build logs are saved to `build.log` in the project directory.

## What Gets Installed in the ISO

### Base System
Expand Down Expand Up @@ -95,6 +124,13 @@ iso-build/
- **cryptsetup**: LUKS disk encryption
- **ecryptfs-utils**: File-level encryption

### 🚀 Advanced v5.0.0 Security Features
- **Quantum-Resistant Cryptography**: Post-quantum encryption algorithms (NIST PQC)
- **Blockchain Audit Logging**: Immutable, tamper-proof security event logging
- **AI Threat Detection**: Machine learning-powered behavioral analysis and anomaly detection
- **Self-Healing Security**: Autonomous security remediation and recovery
- **Advanced Malware Sandbox**: Hardware-isolated malware analysis environment

## Testing the ISO

### Option 1: QEMU (Fast, Recommended for Testing)
Expand Down Expand Up @@ -166,36 +202,128 @@ apt-get install -y ubuntu-desktop
## Troubleshooting Build Issues

### Error: "Not enough disk space"
- Free up at least 10GB
- Build uses `/tmp/secureos-build` (needs 5-8GB temp space)
**Solution:**
- Free up at least 15GB (20GB recommended)
- Build uses `/tmp/secureos-build` (needs 8-12GB temp space)
- Check with: `df -h /tmp`

### Error: "Permission denied"
- Must run with `sudo`
- Check file permissions
**Solution:**
- Must run with `sudo` or as root
- Check file permissions with: `ls -la build-iso.sh`
- Make executable: `chmod +x build-iso.sh`

### Error: "Failed to download packages"
- Check internet connection
**Solution:**
- Check internet connection: `ping archive.ubuntu.com`
- Try different mirror in sources.list
- Update package lists: `sudo apt-get update`
- Retry the build

### Error: "This script must be run as root"
**Solution:**
- Run with sudo: `sudo ./build-iso.sh`
- Or switch to root: `sudo su -` then run the script

### Build Hangs or Freezes
- Check system resources (RAM, CPU)
**Solution:**
- Check system resources: `htop` or `free -h`
- Kill and restart: `sudo killall debootstrap`
- Clear temp: `sudo rm -rf /tmp/secureos-build`
- Check logs: `tail -f build.log`

### Error: "Invalid GPG signature"
**Solution:**
- Update GPG keys:
```bash
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [KEY_ID]
```

### Error: "grub-mkrescue: command not found"
**Solution:**
- Install GRUB tools:
```bash
sudo apt-get install grub-pc-bin grub-efi-amd64-bin
```

### Error: "mksquashfs: command not found"
**Solution:**
- Install squashfs-tools:
```bash
sudo apt-get install squashfs-tools
```

### Python Dependencies Missing (v5.0.0 features)
**Solution:**
- Install Python packages:
```bash
sudo apt-get install python3-pip python3-dev
sudo pip3 install numpy scikit-learn cryptography pynacl
```

### Build fails during chroot
**Solution:**
- Check if filesystems are mounted: `mount | grep secureos-build`
- Unmount manually:
```bash
sudo umount /tmp/secureos-build/chroot/{dev/pts,sys,proc,run,dev}
```
- Clean and retry

## Dependency Management

### Required Build Dependencies

The build scripts automatically check and install required dependencies. These include:

- **debootstrap**: Bootstrap base system
- **squashfs-tools**: Create compressed filesystem
- **xorriso**: Create ISO images
- **isolinux**: Boot loader for ISO
- **syslinux-efi**: EFI boot support
- **grub-pc-bin**: GRUB bootloader (BIOS)
- **grub-efi-amd64-bin**: GRUB bootloader (UEFI)
- **mtools**: DOS filesystem tools
- **dosfstools**: FAT filesystem tools
- **git**: Version control

### Manual Dependency Installation

If you prefer to install dependencies manually before building:

```bash
sudo apt-get update
sudo apt-get install -y \
debootstrap \
squashfs-tools \
xorriso \
isolinux \
syslinux-efi \
grub-pc-bin \
grub-efi-amd64-bin \
mtools \
dosfstools \
git \
python3 \
python3-pip
```

### Python Dependencies for v5.0.0 Features

```bash
sudo pip3 install numpy scikit-learn cryptography pynacl
```

## Build Cleanup

After successful build:
```bash
# Temporary build files are auto-cleaned
# Temporary build files are auto-cleaned by the script
# But you can manually clean with:
sudo rm -rf /tmp/secureos-build

# Clean all build artifacts:
sudo rm -rf iso-build/ build-output/ build.log
```

## Advanced: Automated Build
Expand Down Expand Up @@ -229,15 +357,46 @@ fi
- First boot requires configuration
- All network services disabled by default

## Build Verification

After building, verify the ISO integrity:

### Automated Verification (Recommended)

Run the verification script to perform comprehensive checks:
```bash
./verify-iso.sh
```

This script checks:
- ISO file existence and size
- SHA256 and MD5 checksums
- ISO format and bootability
- Essential ISO contents (kernel, initrd, filesystem)
- Build log for errors

### Manual Verification

Check the SHA256 checksum manually:
```bash
cd iso-build
sha256sum -c SecureOS-1.0.0-amd64.iso.sha256
```

Expected output:
```
SecureOS-1.0.0-amd64.iso: OK
```

## Next Steps After Building

1. **Verify the ISO**:
1. **Verify the ISO** (see Build Verification section above)

2. **Test in VM** before deploying to production:
```bash
sha256sum -c iso-build/SecureOS-1.0.0-amd64.iso.sha256
qemu-system-x86_64 -m 2048 -enable-kvm -cdrom iso-build/SecureOS-1.0.0-amd64.iso
```

2. **Test in VM** before deploying to production

3. **Create installation media** (USB/DVD)

4. **Read installation guide** in README.md
Expand Down
Loading
Loading