Skip to content
Draft
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
33 changes: 33 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Environment Variables Template
# Copy this file to .env and customize for your environment
# DO NOT commit .env to version control!

# Flask Application Secrets
# Generate with: python -c 'import secrets; print(secrets.token_hex(32))'
SECRET_KEY=your-secure-secret-key-here
FLASK_SECRET_KEY=your-secure-flask-secret-key-here

# Database Configuration
DB_PATH=./local_dev.db
UPLOADS_PATH=./local_uploads

# Redis Configuration (if using)
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=1
# REDIS_PASSWORD=your-redis-password

# Build Environment
# EDK_TOOLS_PATH=/path/to/edk2/BaseTools
# WORKSPACE=/path/to/edk2

# Secure Boot Keys Directory
# WARNING: Never commit private keys!
# SB_KEYS_DIR=/path/to/secure/keys

# Task Runner Configuration
# PFY_FILE=Pfyfile.pf

# Flask Environment
# FLASK_ENV=development
# ENVIRONMENT=development
28 changes: 27 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,30 @@ nohup*.out

# Generated documentation files
copilot-instructions.md
WARP.md
WARP.md

# Environment and secrets - NEVER commit these
.env
.env.local
.env.*.local
.env.production
.env.development
.env.test
*.pem
*.key
*.p12
*.pfx
secrets/
.secrets/

# Local development databases
*.db
*.sqlite
*.sqlite3
hardware_profiles.db
hardware_uploads/

# Temporary test files
test_output/
tmp/
.tmp/
25 changes: 25 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# PhoenixBoot Changes

For detailed change history, see:

- [CHANGELOG.md](CHANGELOG.md) - Detailed changelog with version history
- [CHANGELOG_CONSOLIDATED.md](CHANGELOG_CONSOLIDATED.md) - Consolidated changelog

For recent development updates, see:

- [IMPLEMENTATION_SUMMARY.md](IMPLEMENTATION_SUMMARY.md) - Recent implementation work
- [ISSUE_RESOLUTION_SUMMARY.md](ISSUE_RESOLUTION_SUMMARY.md) - Issue tracking

For project reviews and improvements:

- [GLOBAL_REVIEW_SUMMARY.md](GLOBAL_REVIEW_SUMMARY.md) - Comprehensive project review
- [SECURITY_REVIEW_2025-12-07.md](SECURITY_REVIEW_2025-12-07.md) - Security audit
- [CICD_REVIEW_ROLLUP.md](CICD_REVIEW_ROLLUP.md) - CI/CD improvements

## Quick Links

- **Getting Started**: [GETTING_STARTED.md](GETTING_STARTED.md)
- **Features**: [FEATURES.md](FEATURES.md)
- **Security Policy**: [SECURITY.md](SECURITY.md)
- **Contributing**: [CONTRIBUTING.md](CONTRIBUTING.md)
- **Architecture**: [ARCHITECTURE.md](ARCHITECTURE.md)
77 changes: 77 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in the PhoenixBoot community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

### Positive Behavior

Examples of behavior that contributes to a positive environment:

* **Being Respectful**: Treating all community members with respect and kindness
* **Constructive Feedback**: Providing helpful, constructive criticism and gracefully accepting feedback
* **Collaboration**: Working together toward common goals and supporting fellow contributors
* **Inclusivity**: Using welcoming and inclusive language
* **Empathy**: Showing empathy toward other community members
* **Security Focus**: Taking security seriously and reporting vulnerabilities responsibly

### Unacceptable Behavior

Examples of unacceptable behavior:

* **Harassment**: The use of sexualized language or imagery, and sexual attention or advances of any kind
* **Trolling**: Trolling, insulting or derogatory comments, and personal or political attacks
* **Discrimination**: Public or private harassment based on any protected characteristic
* **Privacy Violations**: Publishing others' private information without explicit permission
* **Security Violations**: Deliberately introducing security vulnerabilities or exploiting them maliciously

## Enforcement Responsibilities

Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all community spaces, including:

* GitHub repositories (issues, pull requests, discussions)
* Communication channels (chat, mailing lists, forums)
* Community events (virtual or in-person)

## Reporting

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers via:

* GitHub's reporting features
* Private communication with project maintainers
* Security issues should follow the guidelines in SECURITY.md

## Security-Specific Guidelines

Given PhoenixBoot's focus on security and firmware protection:

### Responsible Disclosure

* **Do Not**: Publicly disclose security vulnerabilities before they are fixed
* **Do**: Report security issues privately following SECURITY.md guidelines
* **Do**: Allow reasonable time for fixes before public disclosure

### Educational vs. Malicious

* **Encouraged**: Security research and educational discussions about vulnerabilities
* **Encouraged**: Developing defensive tools and techniques
* **Prohibited**: Using discovered vulnerabilities to harm others
* **Prohibited**: Developing or distributing malicious firmware or bootkits

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.

Last Updated: 2026-01-30

---

**Remember**: PhoenixBoot is a security project serving a critical function in firmware defense. Let's maintain a professional, respectful, and security-conscious community.
154 changes: 154 additions & 0 deletions ENV_VARIABLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Environment Variables Configuration

This file documents the environment variables used by PhoenixBoot components.

## Production Flask Applications

### web/hardware_database_server.py

**CRITICAL**: This is a development/demo server. Do not deploy to production without proper configuration.

Required environment variables for production:

```bash
# Generate a secure secret key with:
# python -c 'import secrets; print(secrets.token_hex(32))'
export SECRET_KEY="your-secure-secret-key-here"

# Database path (optional, defaults to ./hardware_profiles.db)
export DB_PATH="/var/lib/phoenixguard/hardware_profiles.db"

# Upload directory (optional, defaults to ./hardware_uploads)
export UPLOADS_PATH="/var/lib/phoenixguard/uploads"
```

### ideas/cloud_integration/api_endpoints.py

**CRITICAL**: This is example/demo code. Do not use in production without security review.

Required environment variables for production:

```bash
# Flask secret key
export FLASK_SECRET_KEY="your-secure-secret-key-here"

# Redis configuration
export REDIS_HOST="localhost"
export REDIS_PORT="6379"
export REDIS_DB="1"
export REDIS_PASSWORD="your-redis-password" # If Redis has authentication
```

## Task Runner (pf.py)

The pf.py task runner supports environment variables for configuration:

```bash
# Specify alternative Pfyfile location
export PFY_FILE="path/to/Pfyfile.pf"
```

## Build Environment

```bash
# EDK2 toolchain configuration
export EDK_TOOLS_PATH="/path/to/edk2/BaseTools"
export WORKSPACE="/path/to/edk2"

# Compiler selection
export GCC_VERSION="5" # or appropriate version
```

## Secure Boot Keys

**WARNING**: Never commit private keys to version control!

```bash
# Directory containing Secure Boot keys
export SB_KEYS_DIR="/path/to/secure/keys"

# Individual key paths (optional)
export PK_KEY="/path/to/PK.key"
export PK_CRT="/path/to/PK.crt"
export KEK_KEY="/path/to/KEK.key"
export KEK_CRT="/path/to/KEK.crt"
export DB_KEY="/path/to/db.key"
export DB_CRT="/path/to/db.crt"
```

## Container Configuration

When running in containers, pass environment variables via docker-compose or command line:

```bash
# Using docker-compose
docker-compose --env-file .env up

# Using docker run
docker run -e SECRET_KEY="..." -e DB_PATH="..." phoenixboot/app
```

## Creating .env File

For development, create a `.env` file (DO NOT commit to git):

```bash
# .env file for local development
SECRET_KEY=dev-secret-key-change-in-production
FLASK_SECRET_KEY=dev-flask-key-change-in-production
DB_PATH=./local_dev.db
UPLOADS_PATH=./local_uploads
```

Then load it with:

```bash
# Bash
set -a
source .env
set +a

# Or use docker-compose
docker-compose --env-file .env up
```

## Security Best Practices

1. **Never commit `.env` files** - Add to `.gitignore`
2. **Use different secrets** for each environment (dev, staging, prod)
3. **Rotate secrets regularly** - Especially after team member changes
4. **Use strong secrets** - At least 32 characters of random data
5. **Restrict access** - Only give access to people who need it
6. **Use secret managers** - Consider using AWS Secrets Manager, HashiCorp Vault, etc. for production

## Verifying Configuration

To check if all required environment variables are set:

```bash
#!/bin/bash
# check_env.sh

required_vars=("SECRET_KEY" "FLASK_SECRET_KEY")

missing=()
for var in "${required_vars[@]}"; do
if [[ -z "${!var}" ]]; then
missing+=("$var")
fi
done

if [[ ${#missing[@]} -gt 0 ]]; then
echo "ERROR: Missing required environment variables:"
printf ' %s\n' "${missing[@]}"
exit 1
fi

echo "✓ All required environment variables are set"
```

## Additional Resources

- [Twelve-Factor App: Config](https://12factor.net/config)
- [OWASP: Secure Configuration](https://owasp.org/www-project-secure-coding-practices/)
- [Python dotenv library](https://pypi.org/project/python-dotenv/)
62 changes: 62 additions & 0 deletions HOTSPOTS
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# PhoenixBoot Development Hotspots

This file tracks areas of active development or areas needing attention.

## Current Hotspots (2026-01-30)

### High Priority

1. **Container Architecture** - Actively being refined
- Location: `containers/`
- Status: Production-ready but evolving
- See: [docs/CONTAINER_ARCHITECTURE.md](docs/CONTAINER_ARCHITECTURE.md)

2. **Terminal UI (TUI)** - New interactive interface
- Location: `containers/tui/`
- Status: Recently added, under active development
- Technology: Python Textual framework

3. **SecureBoot Bootable Media** - Key feature
- Script: `create-secureboot-bootable-media.sh`
- Status: Production-ready
- See: [docs/SECUREBOOT_BOOTABLE_MEDIA.md](docs/SECUREBOOT_BOOTABLE_MEDIA.md)

### Maintenance Needed

1. **Legacy Demo Code** - Needs cleanup
- Location: `examples_and_samples/demo/legacy/`
- Action: Consider archiving or documenting status

2. **Python Type Hints** - Partial coverage
- Many older utilities lack type annotations
- Gradual migration recommended

3. **Documentation Consolidation**
- 40+ markdown files with some overlap
- Consider organizing into docs/ subdirectories

### Security Sensitive Areas

1. **Key Management** - Critical paths
- Scripts: `scripts/secure-boot/`, `scripts/mok-management/`
- Always review changes carefully

2. **UEFI Applications** - Low-level code
- Source: `staging/src/`
- Requires EDK2 expertise

3. **Subprocess Usage** - Potential injection risks
- Check: All Python files using subprocess/os.system
- Rule: Always use command lists, never shell=True with user input

## Areas for Contribution

- Python type hints for older modules
- Additional test coverage
- Documentation improvements
- Hardware compatibility testing

## Notes

Update this file when priorities shift or new hotspots emerge.
Last updated: 2026-01-30
Loading