Skip to content

cyclonite69/parrot-booty-protection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ΄β€β˜ οΈ Parrot Booty Protection (PBP)

Enterprise-Grade Linux Security Control Platform

OS: Parrot OS / Debian License: MIT Version: 2.0.0 Security: Audited

Parrot Booty Protection is a production-ready security control platform that enforces operator sovereignty over Linux hardening. Built with defense-in-depth principles and zero-tolerance for autonomous configuration changes, it provides automated scanning, professional reporting, real-time monitoring, and a local web control plane.


🎯 What Makes PBP Different?

Traditional security tools make changes without asking. PBP enforces operator authority:

  • πŸ›‘οΈ Operator Sovereignty - No autonomous configuration changes, ever
  • πŸ“‹ Policy-Driven - Single source of truth for all security decisions
  • πŸ” Integrity Monitoring - Protected files watched continuously
  • ⚠️ Alert Framework - Instant notification of violations
  • πŸ–₯️ Control Plane - Local web dashboard (no cloud dependencies)
  • πŸ”„ Rollback Capability - Every change is reversible
  • πŸ“Š Risk Quantification - Know your security posture with numerical scores
  • πŸ“„ Professional Reports - PDF/HTML reports for compliance

PBP is not a script collection. It's a security control platform.


πŸ›‘οΈ Security Modules

PBP provides 7 independent security modules, each with full lifecycle management:

Module Purpose Technology Risk Mitigation
⏰ TIME NTS-authenticated time sync chrony + NTS Prevents time-based attacks, ensures certificate validity
πŸ”’ DNS Encrypted DNS queries systemd-resolved + DoT Blocks DNS hijacking, surveillance, cache poisoning
πŸ›‘οΈ NETWORK Stateful firewall nftables Default-deny policy, connection tracking, egress filtering
πŸ“¦ CONTAINER Rootless container security Podman + seccomp Prevents privilege escalation, container breakouts
πŸ“‹ AUDIT System activity monitoring auditd Detects unauthorized changes, tracks privileged commands
πŸ” ROOTKIT Malware detection rkhunter + chkrootkit Identifies rootkits, hidden processes, file tampering
🌐 RECON Network exposure validation nmap Maps attack surface, detects misconfigurations

Each module includes:

  • βœ… Installation automation
  • βœ… Configuration management
  • βœ… Health monitoring
  • βœ… Security scanning
  • βœ… Rollback capability

πŸš€ Quick Start

Installation

# Clone repository
git clone https://github.com/cyclonite69/parrot-booty-protection.git
cd parrot-booty-protection

# Install PBP
sudo bash scripts/install.sh

# Install control system (operator sovereignty)
sudo bash scripts/install_control.sh

# Install reporting dependencies (PDF generation)
sudo bash scripts/install_reporting_deps.sh

Basic Usage

# Start control plane
pbp control start
# Access: http://localhost:7777

# List available modules
pbp list

# Enable core security modules
sudo pbp enable time      # NTS time synchronization
sudo pbp enable dns       # Unbound DNS with DoH/DoT
sudo pbp enable network   # Firewall

# Run security scan
sudo pbp scan

# View system status
pbp status

# Check integrity
pbp integrity

# View alerts
pbp alerts

# Launch interactive dashboard
pbp dashboard

Enable Automated Monitoring

# Integrity monitoring (continuous)
sudo systemctl enable --now pbp-integrity.service

# Daily security scans
sudo systemctl enable --now pbp-scan-daily.timer

# Weekly deep audits (rootkit + audit)
sudo systemctl enable --now pbp-audit-weekly.timer

# Check timer status
systemctl list-timers pbp-*

πŸ“Š Reporting System

PBP includes a universal reporting engine that generates professional PDF and JSON reports from all security scanners.

Generate Reports

# Run scanner and generate report
sudo rkhunter --check > /tmp/rkhunter.txt
sudo pbp-report rkhunter /tmp/rkhunter.txt

# Output: /var/log/pbp/reports/<timestamp>/
#   β”œβ”€β”€ raw/rkhunter.txt
#   β”œβ”€β”€ json/rkhunter.json
#   β”œβ”€β”€ html/rkhunter.html
#   β”œβ”€β”€ pdf/rkhunter.pdf
#   └── checksums/rkhunter.*.sha256

Bug Hunt Mode

Comprehensive system validation in one command:

sudo pbp bughunt

Validates:

  • βœ… Configuration integrity
  • βœ… Firewall rules (duplicates, policies)
  • βœ… Service health
  • βœ… NTS time synchronization
  • βœ… DNS hardening (DoT, DNSSEC)
  • βœ… Container privileges
  • βœ… Open ports
  • βœ… File permissions

Generates:

  • master-report.json - Machine-readable findings
  • master-report.html - Human-readable report
  • master-report.pdf - Professional PDF for compliance

🎨 Interactive Dashboard

Real-time security monitoring in your terminal:

pbp dashboard

Features:

  • πŸ“Š Module status (enabled/installed/uninstalled)
  • ❀️ Health checks per module
  • πŸ“ˆ Latest risk score
  • ⚑ Quick actions (scan/reports/health)

πŸ“ˆ Risk Scoring

PBP quantifies your security posture with weighted risk scores:

Severity Weight Examples
CRITICAL 10 points Rootkit detected, firewall disabled, DNS failing
HIGH 5 points Unencrypted DNS, privileged containers, insecure services
MEDIUM 2 points Many open ports, missing audit rules, outdated scanners
LOW 1 point IPv6 disabled, large logs, minor misconfigurations

Risk Bands:

  • 0-20: 🟒 SECURE - System is well-hardened
  • 21-50: 🟑 MODERATE - Some issues need attention
  • 51-100: 🟠 ELEVATED - Significant vulnerabilities present
  • 100+: πŸ”΄ CRITICAL - Immediate action required

πŸ”§ CLI Reference

Module Management

pbp list                     # List all modules
pbp enable <module>          # Enable a module (requires approval)
pbp disable <module>         # Disable a module (requires approval)
pbp rollback <module>        # Revert to previous configuration

Security Operations

pbp scan                     # Scan all enabled modules
pbp scan <module>            # Scan specific module
pbp status                   # Show system status
pbp health                   # Run health checks
pbp bughunt                  # Comprehensive validation

Control & Monitoring

pbp control start            # Start web control plane
pbp control stop             # Stop web control plane
pbp integrity                # Check file integrity
pbp alerts                   # View security alerts
pbp dashboard                # Launch TUI dashboard

Reporting

pbp reports                  # List all reports
pbp report <id>              # View specific report
pbp report <id> html         # Open HTML report in browser
pbp compare <id1> <id2>      # Compare two reports
pbp-report <scanner> <file>  # Generate report from scanner output

πŸ—οΈ Architecture

Modular Design

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     PBP Core Engine                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚    State     β”‚  β”‚   Registry   β”‚  β”‚    Health    β”‚ β”‚
β”‚  β”‚  Management  β”‚  β”‚  & Discovery β”‚  β”‚    Checks    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Backup &   β”‚  β”‚   Rollback   β”‚  β”‚   Logging    β”‚ β”‚
β”‚  β”‚   Restore    β”‚  β”‚    System    β”‚  β”‚   & Audit    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                   β”‚                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
β”‚   Security     β”‚  β”‚   Reporting    β”‚  β”‚     TUI      β”‚
β”‚    Modules     β”‚  β”‚     Engine     β”‚  β”‚   Dashboard  β”‚
β”‚                β”‚  β”‚                β”‚  β”‚              β”‚
β”‚ β€’ time         β”‚  β”‚ β€’ PDF Gen      β”‚  β”‚ β€’ Real-time  β”‚
β”‚ β€’ dns          β”‚  β”‚ β€’ HTML Gen     β”‚  β”‚ β€’ Health     β”‚
β”‚ β€’ network      β”‚  β”‚ β€’ Parsers      β”‚  β”‚ β€’ Actions    β”‚
β”‚ β€’ container    β”‚  β”‚ β€’ Bug Hunt     β”‚  β”‚              β”‚
β”‚ β€’ audit        β”‚  β”‚                β”‚  β”‚              β”‚
β”‚ β€’ rootkit      β”‚  β”‚                β”‚  β”‚              β”‚
β”‚ β€’ recon        β”‚  β”‚                β”‚  β”‚              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Module Lifecycle

UNINSTALLED β†’ install β†’ INSTALLED β†’ enable β†’ ENABLED
                ↑                      ↓
                └──────── rollback β”€β”€β”€β”€β”˜

πŸ“ Directory Structure

/opt/pbp/                    # Installation root
β”œβ”€β”€ bin/
β”‚   β”œβ”€β”€ pbp                  # Main CLI
β”‚   β”œβ”€β”€ pbp-dashboard        # TUI dashboard
β”‚   └── pbp-report           # Report generator
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ engine.sh            # Orchestration engine
β”‚   β”œβ”€β”€ state.sh             # State management
β”‚   β”œβ”€β”€ registry.sh          # Module discovery
β”‚   └── lib/                 # Core libraries
β”œβ”€β”€ modules/
β”‚   β”œβ”€β”€ time/                # NTS time sync
β”‚   β”œβ”€β”€ dns/                 # Encrypted DNS
β”‚   β”œβ”€β”€ network/             # nftables firewall
β”‚   β”œβ”€β”€ container/           # Podman hardening
β”‚   β”œβ”€β”€ audit/               # auditd monitoring
β”‚   β”œβ”€β”€ rootkit/             # Malware detection
β”‚   └── recon/               # Network scanning
β”œβ”€β”€ reporting/
β”‚   β”œβ”€β”€ engine.sh            # Report engine
β”‚   β”œβ”€β”€ parsers/             # Scanner parsers
β”‚   └── templates/           # HTML templates
β”œβ”€β”€ bughunt/
β”‚   └── bughunt.sh           # System validator
└── config/
    └── pbp.conf             # Global configuration

/var/lib/pbp/                # State and backups
β”œβ”€β”€ state/
β”‚   β”œβ”€β”€ modules.state        # Module status (JSON)
β”‚   └── backups/             # Config snapshots
└── data/

/var/log/pbp/                # Logs and reports
β”œβ”€β”€ audit.log                # Action trail
β”œβ”€β”€ actions.jsonl            # Structured logs
└── reports/
    β”œβ”€β”€ json/                # JSON reports
    β”œβ”€β”€ html/                # HTML reports
    β”œβ”€β”€ pdf/                 # PDF reports
    └── checksums/           # SHA256 hashes

πŸ”’ Security Features

Defense-in-Depth

  • Input Validation - All user input sanitized and validated
  • Output Escaping - HTML reports XSS-safe via Python escaping
  • Privilege Separation - Root only when necessary, immediate drop
  • Fail-Safe Defaults - Reject unknown, block on errors
  • Audit Trail - Complete logging of all actions
  • Immutable Reports - chattr +i after generation
  • Integrity Verification - SHA256 checksums for all reports

Rollback Safety

Every configuration change includes:

  1. Pre-change backup with checksums
  2. Post-change health verification
  3. Automatic rollback on failure
  4. Manual rollback capability

Access Control

  • Reports: 600 permissions (root-only)
  • Directories: 700 permissions
  • State files: 600 permissions
  • No world-readable security data

πŸ“š Documentation


πŸ§ͺ Testing

# Validate core engine
bash tests/validate_core.sh

# Generate test report
bash tests/test_report.sh

# Run demo
bash demo.sh

🀝 Contributing

Contributions welcome! Please follow the module template structure:

modules/your_module/
β”œβ”€β”€ manifest.json       # Metadata and config
β”œβ”€β”€ install.sh          # Package installation
β”œβ”€β”€ enable.sh           # Activation logic
β”œβ”€β”€ disable.sh          # Deactivation logic
β”œβ”€β”€ scan.sh             # Security scanning
└── health.sh           # Health checks

πŸ“Š Project Metrics

  • Total Files: 85+
  • Lines of Code: ~6,400 (focused, minimal)
  • Security Modules: 7 fully implemented
  • Hook Scripts: 35 (5 per module)
  • Core Libraries: 9
  • CLI Commands: 13
  • Systemd Units: 4
  • Test Coverage: Core + Modules validated
  • Documentation: 2,000+ lines

🎯 Use Cases

For Security Engineers

  • Automated hardening of Parrot OS workstations
  • Compliance reporting (CIS, NIST)
  • Security posture monitoring
  • Incident response preparation

For System Administrators

  • One-command security deployment
  • Automated daily/weekly scans
  • Professional PDF reports for management
  • Safe rollback on issues

For Penetration Testers

  • Harden attack platforms
  • Validate security controls
  • Generate compliance evidence
  • Monitor container security

For DevSecOps Teams

  • Infrastructure-as-code security
  • CI/CD security validation
  • Automated compliance checks
  • Security metrics tracking

πŸ—ΊοΈ Roadmap

Phase 5 (Planned)

  • Web dashboard (localhost:8080)
  • Policy profiles (home/privacy/pentest/paranoid)
  • Email alerting
  • Baseline tracking & trending
  • SIEM integration (Splunk/ELK)
  • Multi-host management
  • Compliance mapping (CIS/NIST/PCI-DSS)
  • Module marketplace

πŸ“„ License

MIT License - See LICENSE for details


πŸ™ Acknowledgments

Built with security best practices from:


"May your booty be guarded and your lines be encrypted." πŸ¦œπŸ΄β€β˜ οΈ

Made with ❀️ for the security community

⬆ Back to Top

About

Enterprise-grade DNS hardening for Parrot OS with DoT, DNSSEC, and emergency recovery

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors