Skip to main content

Comprehensive Linux Security Audit Tool with Phase 1 & 2 Features

Project description

VigileGuard - Linux Security Audit Tool

๐Ÿ›ก๏ธ VigileGuard is a comprehensive security audit tool designed for developer-focused startups and Linux systems. It performs automated security checks, identifies vulnerabilities, and provides actionable recommendations for system hardening and compliance.

License: MIT Python Version GitHub issues GitHub stars CI/CD Security Status Build Status

VigileGuard is a comprehensive security audit tool designed specifically for Linux systems. It provides automated security assessments, compliance mapping, and detailed reporting to help system administrators and security professionals identify and remediate security vulnerabilities.

๐Ÿš€ Features

Phase 1 (Core Security Checks)

  • File Permission Analysis - Detect world-writable files, incorrect permissions on sensitive files
  • User Account Security - Check for weak passwords, duplicate UIDs, sudo misconfigurations
  • SSH Configuration Review - Analyze SSH settings for security best practices
  • System Information Gathering - Collect OS version, kernel info, running services

Phase 2 (Advanced Security & Reporting)

  • Web Server Security - Apache/Nginx configuration analysis, SSL/TLS checks
  • Network Security Analysis - Port scanning, firewall configuration review
  • Enhanced HTML Reporting - Beautiful, interactive security reports
  • Compliance Mapping - PCI DSS, SOC 2, NIST CSF, ISO 27001 alignment
  • Notification Integrations - Email, Slack, webhook notifications
  • Trend Tracking - Historical analysis and security trend monitoring
  • Scheduled Scanning - Automated recurring security audits

๐Ÿ“ Project Structure

VigileGuard/
โ”œโ”€โ”€ vigileguard/                    # Main package directory
โ”‚   โ”œโ”€โ”€ __init__.py                # Package initialization
โ”‚   โ”œโ”€โ”€ vigileguard.py             # Core Phase 1 + 2 scanner
โ”‚   โ”œโ”€โ”€ web_security_checkers.py   # Phase 2 web security modules
โ”‚   โ”œโ”€โ”€ enhanced_reporting.py      # Phase 2 reporting system
โ”‚   โ””โ”€โ”€ phase2_integration.py      # Phase 2 integration & config
โ”œโ”€โ”€ scripts/                       # Utility scripts
โ”‚   โ”œโ”€โ”€ badge_generator.py         # Generate status badges
โ”‚   โ”œโ”€โ”€ report_analyzer.py         # Analyze scan reports
โ”‚   โ””โ”€โ”€ vigileguard-install.sh     # Installation script
โ”œโ”€โ”€ tests/                         # Test suite
โ”‚   โ”œโ”€โ”€ test_vigileguard.py        # Core functionality tests
โ”‚   โ”œโ”€โ”€ test_web_security.py       # Web security tests
โ”‚   โ””โ”€โ”€ test_reporting.py          # Reporting tests
โ”œโ”€โ”€ docs/                          # Documentation
โ”œโ”€โ”€ examples/                      # Example configurations
โ”œโ”€โ”€ config.yaml                    # Default configuration
โ”œโ”€โ”€ requirements.txt               # Python dependencies
โ”œโ”€โ”€ setup.py                       # Package setup
โ”œโ”€โ”€ pyproject.toml                 # Modern Python packaging
โ”œโ”€โ”€ Makefile                       # Development commands
โ””โ”€โ”€ README.md                      # This file

๐Ÿ”ง Installation

Quick Install (Recommended)

# Download and run the installer
curl -sSL https://raw.githubusercontent.com/navinnm/VigileGuard/main/install.sh | bash

# Or install from PyPI
pip install vigileguard

Development Installation

# Clone the repository
git clone https://github.com/navinnm/VigileGuard.git
cd VigileGuard

# Install in development mode
make install-dev

# Or manually
pip install -e ".[dev,full]"

Virtual Environment Installation

# Create and activate virtual environment
python3 -m venv vigileguard-env
source vigileguard-env/bin/activate

# Install VigileGuard
pip install vigileguard

# Or from source
pip install -e .

Docker Installation

# Build Docker image
docker build -t vigileguard .

# Run in container
docker run --rm -v $(pwd)/reports:/app/reports vigileguard --format html

๐Ÿš€ Quick Start

Basic Usage

# Run basic console scan
vigileguard

# Generate HTML report
vigileguard --format html --output security-report.html

# Generate JSON report
vigileguard --format json --output security-report.json

# Generate all report formats
vigileguard --format all --output ./reports/

Advanced Usage

# Use custom configuration
vigileguard --config custom-config.yaml --format html

# Specify environment
vigileguard --environment production --format json

# Enable notifications
vigileguard --notifications --format html

# Debug mode
vigileguard --debug --format console

Using Make Commands

# Install and setup
make install-dev

# Run tests
make test

# Format code
make format

# Run security scans
make security

# Build package
make build

# Generate HTML report
make run-html

# Run all formats
make run-all

โš™๏ธ Configuration

Create a configuration file at ~/.config/vigileguard/config.yaml:

vigileguard:
  # Output settings
  output:
    directory: "./reports"
    timestamp_format: "%Y%m%d_%H%M%S"
    
  # Security checks
  checks:
    file_permissions: true
    user_accounts: true
    ssh_configuration: true
    web_security: true
    network_security: true
    
  # Reporting
  reports:
    include_compliance: true
    severity_threshold: "INFO"
    
  # Phase 2 features
  phase2:
    enabled: true
    web_security_deep_scan: true
    enhanced_html_reports: true
    
  # Notifications (Phase 2)
  notifications:
    enabled: false
    email:
      smtp_server: "smtp.gmail.com"
      smtp_port: 587
      username: "your-email@domain.com"
      recipients: ["admin@company.com"]
    slack:
      webhook_url: "https://hooks.slack.com/..."
      channel: "#security"

๐Ÿ“Š Report Examples

Console Output

๐Ÿ›ก๏ธ VigileGuard Security Audit
==============================

โœ… FilePermissionChecker completed - 3 findings
โœ… UserAccountChecker completed - 1 findings  
โœ… SSHConfigChecker completed - 2 findings
โœ… WebServerSecurityChecker completed - 4 findings
โœ… NetworkSecurityChecker completed - 0 findings

๐Ÿ“Š Audit Results
================
CRITICAL: 1
HIGH: 3
MEDIUM: 4
LOW: 2

HTML Report Features

  • Interactive Dashboard - Summary cards, charts, and graphs
  • Detailed Findings - Expandable cards with recommendations
  • Compliance Mapping - Framework alignment visualization
  • Trend Analysis - Historical comparison charts
  • Export Options - PDF generation, CSV export

JSON Report Structure

{
  "scan_info": {
    "timestamp": "2025-06-11T20:39:00Z",
    "hostname": "web-server-01",
    "version": "2.0.2"
  },
  "summary": {
    "total_findings": 10,
    "by_severity": {"CRITICAL": 1, "HIGH": 3, "MEDIUM": 4, "LOW": 2}
  },
  "findings": [...],
  "compliance": {...},
  "trends": {...}
}

๐Ÿ”’ Security Frameworks

VigileGuard maps findings to major compliance frameworks:

  • PCI DSS - Payment Card Industry Data Security Standard
  • SOC 2 - Service Organization Control 2
  • NIST CSF - NIST Cybersecurity Framework
  • ISO 27001 - Information Security Management
  • CIS Controls - Center for Internet Security

๐Ÿ”ง Development

Setting Up Development Environment

# Clone repository
git clone https://github.com/navinnm/VigileGuard.git
cd VigileGuard

# Setup development environment
make dev-setup

# Run tests
make test

# Run linting
make lint

# Format code
make format

Running Tests

# Unit tests
make test

# All tests with coverage
make test-all

# Specific test file
pytest tests/test_vigileguard.py -v

# Integration tests
pytest tests/ -m integration

Code Quality

# Format code
make format

# Lint code
make lint

# Security checks
make security

# All quality checks
make dev-check

๐Ÿณ Docker Usage

Build and Run

# Build image
make docker-build

# Run scan
make docker-run

# Interactive shell
make docker-shell

# Custom command
docker run --rm -v $(pwd)/reports:/app/reports vigileguard:latest --format json

Docker Compose

version: '3.8'
services:
  vigileguard:
    build: .
    volumes:
      - ./reports:/app/reports
      - ./config:/app/config
    command: ["--format", "html", "--output", "/app/reports/report.html"]

๐Ÿ“… Scheduled Scanning

Cron Setup

# Setup daily scans
./install.sh --setup-cron

# Manual cron entry (daily at 2 AM)
0 2 * * * /usr/local/bin/vigileguard --format json --output /var/log/vigileguard/daily-$(date +\%Y\%m\%d).json

Systemd Timer

# /etc/systemd/system/vigileguard.timer
[Unit]
Description=VigileGuard Security Scan
Requires=vigileguard.service

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target

๐Ÿ”ง API Usage

Python API

import vigileguard

# Create audit engine
engine = vigileguard.create_audit_engine()

# Run audit
findings = engine.run_audit()

# Generate reports
report_manager = vigileguard.ReportManager(findings, scan_info)
report_manager.generate_all_formats("./reports")

# Check Phase 2 availability
if vigileguard.check_phase2_availability():
    print("Phase 2 features available")

Command Line Integration

# JSON output for scripting
vigileguard --format json | jq '.summary.total_findings'

# Exit code based on findings
vigileguard --format console
echo "Exit code: $?"  # Non-zero if critical/high issues found

# Custom severity threshold
vigileguard --format json | jq '.findings[] | select(.severity=="CRITICAL")'

๐Ÿšจ Troubleshooting

Common Issues

Phase 2 Components Not Available

# Check if Phase 2 files exist
ls vigileguard/web_security_checkers.py
ls vigileguard/enhanced_reporting.py
ls vigileguard/phase2_integration.py

# Reinstall with Phase 2
pip uninstall vigileguard
pip install vigileguard[full]

Permission Errors

# Run with appropriate privileges
sudo vigileguard --format console

# Or use user installation
pip install --user vigileguard

Missing Dependencies

# Install all dependencies
pip install vigileguard[full]

# Or install manually
pip install rich click PyYAML requests

Debug Mode

# Enable debug output
vigileguard --debug --format console

# Check imports
python -c "import vigileguard; print(vigileguard.get_version())"

# Verbose logging
export VIGILEGUARD_LOG_LEVEL=DEBUG
vigileguard --format console

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: make test
  5. Submit a pull request

Code Standards

  • Follow PEP 8 style guidelines
  • Add tests for new features
  • Update documentation
  • Run make dev-check before submitting

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ›ก๏ธ Security

For security issues, please email security@vigileguard.dev or see SECURITY.md.

๐Ÿ“ž Support

๐Ÿ™ Acknowledgments

  • Security best practices from OWASP, NIST, and CIS
  • Linux security community
  • Open source security tools ecosystem

Made with โค๏ธ by the VigileGuard Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vigileguard-2.0.2.tar.gz (77.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vigileguard-2.0.2-py3-none-any.whl (63.8 kB view details)

Uploaded Python 3

File details

Details for the file vigileguard-2.0.2.tar.gz.

File metadata

  • Download URL: vigileguard-2.0.2.tar.gz
  • Upload date:
  • Size: 77.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for vigileguard-2.0.2.tar.gz
Algorithm Hash digest
SHA256 b0d5d1f9606ea009790adb767744a588c53d83d64ddd73edff43b8c6bc5a4258
MD5 ae2b5683bee98764159f6e25fce44609
BLAKE2b-256 3c779e24bc651b26677ca2d87e6e0d508cb2583e41a3994c381b7a90a681df18

See more details on using hashes here.

File details

Details for the file vigileguard-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: vigileguard-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 63.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for vigileguard-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5e36efb4bea8e7d7fd67284817efb00382c23471a361e8362b7fd83bea4168b4
MD5 96e0c74a7f3ab707ba22fd4e6b312e63
BLAKE2b-256 614c6f4cb64a331d1607fb02269b16c2e83f57edf277a00a471d5bfa2536a88d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page