Skip to content

uzaif-lab/E-Gov_Guardian

Repository files navigation

E-Gov Guardian πŸ›‘οΈ

AI-Powered Security Scanner for Web Apps + Estonian eID Integration

A comprehensive security assessment platform designed specifically for Estonian digital infrastructure and government services. Built with deep expertise in Estonian e-ID authentication systems and powered by artificial intelligence, it helps developers secure their digital products and protect citizens' sensitive data.

πŸ”— Live Demo

🌐 Live Site: https://e-gov-guardian.onrender.com

πŸ› οΈ Try scanning a URL or testing the Smart-ID login

πŸ“‹ Overview (What It Does)

E-Gov Guardian is a professional security scanner that combines traditional vulnerability detection with specialized Estonian e-ID authentication testing and AI-powered analysis.

πŸ’‘ Simple Workflow:

Scan a web app β†’ Detect SQL Injection/XSS/CSRF β†’ Get AI-powered explanations + fix suggestions β†’ Test Estonian e-ID security β†’ Generate professional PDF reports

Key Capabilities:

  • πŸ” Web Application Security: Comprehensive vulnerability scanning for government websites
  • πŸ‡ͺπŸ‡ͺ Estonian e-ID Integration: Specialized testing for Smart-ID, Mobile-ID, and e-ID Card authentication
  • 🧠 AI-Powered Analysis: GPT-4o-mini provides contextual security recommendations
  • πŸ“Š Professional Reporting: Executive summaries and detailed technical reports
  • 🌍 Multi-Language Support: Available in English and Estonian

🎯 Why I Built This

Estonia is a world leader in digital identity and public e-services, with over 99% of government services available online. As an Estonian developer, I recognized that:

  • Cybersecurity is critical for maintaining trust in e-Governance
  • Traditional scanners miss the nuanced security requirements of Estonian authentication systems
  • AI can bridge the gap between technical findings and actionable recommendations
  • Citizen data protection requires specialized tools for government-grade security

I wanted to create a tool that helps Estonian developers and government agencies secure their applications with the help of AI and deep knowledge of national ID systems.

✨ Features

Feature Description
πŸ” Web Scanner Scans apps for SQL injection, XSS, CSRF, security headers, CORS, and OWASP Top 10 vulnerabilities
🧠 AI Suggestions GPT-4o-mini explains risks in plain language and suggests specific fixes
πŸ‡ͺπŸ‡ͺ eID Integration Specialized testing for Smart-ID, Mobile-ID, and e-ID Card authentication flows
πŸ“Š Results Dashboard Real-time scan progress, vulnerability breakdown, and compliance scoring
πŸ“„ PDF Reports Professional reports suitable for audit evidence and stakeholder presentations
🌍 Multi-Language Full Estonian and English language support
⚑ Real-time Scanning Live progress updates and concurrent scan support
πŸ”§ Advanced Testing API fuzzing, GraphQL security, subresource integrity, and more

πŸ› οΈ Tech Stack

Backend

  • Python 3.11: Core application runtime
  • Flask 3.1: Web framework with Jinja2 templating
  • Gunicorn + gevent: Production WSGI server for high concurrency
  • OWASP ZAP: Professional security scanning (optional integration)
  • OpenAI API: AI-powered security analysis with GPT-4o-mini

Frontend

  • Bootstrap 5: Modern, responsive UI with professional styling
  • JavaScript: Real-time progress updates and interactive features
  • Multi-language Support: English and Estonian interface

Security Tools

  • requests: HTTP security testing and vulnerability detection
  • BeautifulSoup: HTML parsing and analysis
  • Selenium: Browser automation for complex authentication flows
  • python-nmap: Network security scanning and port analysis
  • cryptography: TLS/SSL security assessment
  • yara-python: Malware detection and pattern matching

Reporting

  • WeasyPrint: Professional PDF generation with charts
  • ReportLab: Advanced report layouts and formatting
  • JSON API: Programmatic access to scan results

πŸ“Έ Screenshots

Homepage

E-Gov Guardian Homepage Clean, professional interface with dual scanner options - Web application scanner and Estonian e-ID scanner

Homepage Detail Configurable security test selection with comprehensive vulnerability detection options

Homepage Features Advanced testing options and Estonian e-ID specific security features

Scan in Progress

Scan Progress Real-time progress tracking with detailed phase information and live vulnerability detection updates

Scan Progress Detail Professional progress indicators showing comprehensive security assessment phases

Scan Results + AI Explanation

Executive summary with risk ratings, compliance scores, and vulnerability breakdown by severity

AI-powered recommendations for each finding with authentication method-specific security analysis

Application Interface

Complete application interface showing the professional security scanning dashboard

πŸ“„ Sample PDF Report

E-Gov Guardian generates professional PDF reports suitable for audit evidence and stakeholder presentations. Here's a sample security report:

**πŸ“‹ View Sample Security Report**upda

Report Features:

  • Executive Summary: High-level security assessment with risk ratings
  • Detailed Vulnerability Analysis: Comprehensive breakdown of all findings
  • AI-Powered Recommendations: Contextual fix suggestions for each vulnerability
  • Compliance Scoring: eIDAS and GDPR compliance assessment
  • Professional Formatting: Branded reports suitable for government agencies
  • Multi-Language Support: Available in English and Estonian

πŸš€ How to Run Locally

Prerequisites

  • Python 3.11+
  • Docker (optional, for containerized deployment)
  • OpenAI API key (optional, for AI analysis)

Method 1: Docker (Recommended)

# Clone the repository
git clone https://github.com/uzaif-lab/E-Gov_Guardian.git
cd E-Gov_Guardian

# Build and run with Docker
docker build -t egov-guardian .
docker run -e OPENAI_API_KEY="your-api-key" -p 5000:5000 egov-guardian

# Access the application
open http://localhost:5000

Method 2: Local Development

# Clone the repository
git clone https://github.com/uzaif-lab/E-Gov_Guardian.git
cd E-Gov_Guardian

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set environment variables
export OPENAI_API_KEY="your-api-key"  # Optional

# Run development server
python web_app.py

Method 3: Docker Compose

# Clone and configure
git clone https://github.com/uzaif-lab/E-Gov_Guardian.git
cd E-Gov_Guardian

# Edit docker-compose.yml to add your OpenAI API key
# Then run:
docker-compose up -d

Environment Variables

Variable Description Required
OPENAI_API_KEY OpenAI API key for AI analysis Optional*
WEB_CONCURRENCY Number of worker processes Optional
PORT Application port (default: 5000) Optional

*AI analysis will be disabled if no API key is provided

πŸ”§ Configuration

Copy config.template.yaml to config.yaml for advanced settings:

# AI Analysis Configuration
ai_analysis:
  enabled: true
  model: "gpt-4o-mini"
  max_tokens: 150
  temperature: 0.1

# Scanner Configuration
scanner:
  max_scan_time: 1800 # 30 minutes
  max_depth: 5
  deep_scan_depth: 8

# OWASP ZAP Integration (Optional)
zap:
  enabled: false
  host: "127.0.0.1"
  port: 8080

πŸ” Security Test Coverage

Web Application Security

  • βœ… SQL Injection (Error-based, Boolean-based, Time-based)
  • βœ… Cross-Site Scripting (Reflected, Stored, DOM-based)
  • βœ… Cross-Site Request Forgery (CSRF)
  • βœ… Security Headers Analysis (CSP, HSTS, X-Frame-Options, etc.)
  • βœ… Cookie Security Assessment (Secure, HttpOnly, SameSite)
  • βœ… CORS Misconfiguration Testing
  • βœ… Open Redirect Vulnerabilities
  • βœ… Host Header Injection
  • βœ… Directory Traversal
  • βœ… Command Injection

API Security

  • βœ… REST API Endpoint Fuzzing
  • βœ… GraphQL Introspection and Security
  • βœ… Subresource Integrity Verification
  • βœ… HTTP Method Testing (GET, POST, PUT, DELETE, etc.)
  • βœ… Information Disclosure Detection

Estonian e-ID Specific

  • βœ… Smart-ID Authentication Flow Security
  • βœ… Mobile-ID Implementation Testing
  • βœ… e-ID Certificate Chain Validation
  • βœ… TLS/SSL Configuration for e-ID Services
  • βœ… Authentication Redirect Security
  • βœ… Privacy and Data Protection Compliance

Infrastructure Security

  • βœ… TLS/SSL Configuration Testing
  • βœ… Certificate Validation
  • βœ… Network Security Assessment
  • βœ… Service Discovery and Fingerprinting

πŸ‡ͺπŸ‡ͺ Estonian e-ID Security Expertise

E-Gov Guardian includes specialized knowledge of Estonian digital identity systems:

Authentication Methods Supported

  • Smart-ID: Mobile app-based authentication
  • Mobile-ID: SMS-based authentication
  • e-ID Card: Physical card-based authentication

Compliance Frameworks

  • eIDAS Regulation: European digital identity standards
  • Estonian Trust Services: National digital identity requirements
  • GDPR: Privacy and data protection compliance

Security Assessments

  • Certificate chain validation for e-ID services
  • Authentication flow security analysis
  • Privacy risk assessment
  • Cross-border interoperability security

πŸ“Š API Reference

Start Security Scan

POST /scan
Content-Type: application/x-www-form-urlencoded

target_url=https://example.com
&deep_scan=true
&ai_analysis=true
&test_sql_injection=true
&test_xss=true

Get Scan Results

GET /api/scan-results/{scan_id}

Download PDF Report

GET /download/{scan_id}

Estonian e-ID Scan

POST /estonian-scan
Content-Type: application/x-www-form-urlencoded

estonian_url=https://login.eesti.ee
&estonian_ai_analysis=true

πŸ›£οΈ Future Roadmap

  • Real Smart-ID/Mobile-ID Integration: Direct integration with SK ID Solutions API
  • Exportable PDF Security Reports: Enhanced reporting with executive summaries
  • Support for Estonian Public Service Domains: Pre-configured scanning for government domains
  • Multilingual UI: Enhanced Estonian + English language support
  • Scheduled Scans: Automated security monitoring with email alerts
  • Team Collaboration: Multi-user support for government agencies
  • Compliance Templates: Pre-built templates for eIDAS and GDPR compliance
  • Integration APIs: RESTful APIs for CI/CD pipeline integration

🀝 Contributing to Estonia's Digital Security

I welcome contributions from Estonian developers, security researchers, and government technologists who are passionate about protecting Estonian citizens' data and improving our nation's digital infrastructure security. Together, we can ensure Estonia maintains its position as a global leader in secure digital governance.

Development Setup

# Clone and setup development environment
git clone https://github.com/uzaif-lab/E-Gov_Guardian.git
cd E-Gov_Guardian

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run tests
python -m pytest

# Start development server
python web_app.py

πŸš€ Deployment

Production Deployment Checklist

  • Configure OPENAI_API_KEY environment variable
  • Set appropriate WEB_CONCURRENCY for your infrastructure
  • Configure reverse proxy (nginx/Apache) with SSL termination
  • Set up monitoring and logging
  • Configure backup and disaster recovery
  • Implement rate limiting and DDoS protection
  • Review and customize security scan configurations

Monitoring

Monitor these key metrics in production:

  • Response time for security scans
  • Memory usage during concurrent scans
  • AI API usage and costs
  • Scan completion rates
  • Error rates and types

πŸ“ž Support for Estonian Developers

Getting Help

  • GitHub Issues: Report bugs, request features, and discuss improvements with fellow Estonian developers
  • Security Issues: Contact maintainers privately for security vulnerabilities - protecting citizens' data is our top priority
  • Estonian e-ID Questions: Specialized support for Estonian authentication systems (Smart-ID, Mobile-ID, e-ID Card)
  • Community Support: Connect with other Estonian developers working on digital government security

Learning Resources for Estonian Developers

  • Estonian e-ID Security Documentation: Official security guidelines and best practices
  • OWASP Security Testing Guide: International security standards adapted for Estonian context
  • eIDAS Regulation Compliance Guide: European digital identity requirements
  • Estonian Government Web Security Best Practices: National security standards
  • RIA (Riigi InfosΓΌsteemi Amet) Security Guidelines: Official Estonian government IT security requirements

πŸ“„ License

MIT License Β© 2024 Mohd Uzaif Khan

E-Gov Guardian is developed with the mission of improving digital government security in Estonia and protecting Estonian citizens' data. This project is dedicated to the public good and the advancement of secure digital governance in Estonia.

As a developers, i have a unique opportunity and responsibility to maintain development with security. Every line of code i write, every security measure i implement, and every vulnerability i prevent helps protect the personal data and digital rights of estonian citizens.


"Securing digital government services for Estonian citizens - because their trust in digital society depends on it"

E-Gov Guardian - Professional security assessment for Estonia's digital future.


πŸ‘€ Author & Contact

πŸ‘€ Built by: [Mohd Uzaif Khan]

πŸ“§ Email: [uzaifkhan7867@gmail.com]

πŸ‡ͺπŸ‡ͺ For Estonian Developers

This tool was created specifically for the Estonian developer community. Whether you're working on government portals, e-services, or any digital product that serves Estonian citizens, E-Gov Guardian helps you maintain the security standards that our digital society depends on.

Thank you

Releases

No releases published

Packages

No packages published

Languages