Skip to content

A comprehensive AWS resource management dashboard for identifying and tracking unused cloud resources to optimize costs. Built with Python 3.13, Docker, and modern web technologies.

License

Notifications You must be signed in to change notification settings

abhishekpanda0620/cloud-cleaner-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

105 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cloud Cleaner Dashboard

Python FastAPI Next.js Docker AWS

Cloud Cleaner Dashboard is a comprehensive AWS resource management dashboard for identifying and tracking unused cloud resources to optimize costs. Built with Python 3.13, Docker, and modern web technologies.

Dashboard Preview

✨ Features

πŸ” Resource Monitoring

  • πŸ–₯️ EC2 Instance Monitoring: Track stopped EC2 instances across all regions
  • πŸ’Ύ EBS Volume Management: Identify unattached EBS volumes across all regions
  • πŸͺ£ S3 Bucket Analysis: Find unused or empty S3 buckets (global)
  • ⚑ Elasticache Analysis: Monitor unused Redis/Memcached clusters
  • πŸ” IAM Role Auditing: Detect unused IAM roles with usage analysis
  • πŸ‘₯ IAM User Auditing: Monitor inactive IAM users with activity tracking
  • πŸ”‘ Access Key Monitoring: Track unused access keys with security risk assessment
  • 🌐 Multi-Region Scanning: Comprehensive analysis across all AWS regions

πŸ’° Cost Analysis & Reporting

  • πŸ’΅ Real-time Pricing: Accurate costs from AWS Price List API (cached via Redis)
  • πŸ“ˆ Cost Estimation: Calculate potential savings for unused resources
  • πŸ“Š Cost Breakdown: Visualize costs by resource type with beautiful gradient cards
  • πŸ’‘ Savings Calculator: Interactive calculator showing daily, monthly, and yearly savings
  • πŸ“ˆ Resource-specific Costs: Detailed cost analysis per resource type (EC2, EBS, S3, IAM)
  • πŸ“„ PDF Reports: Generate professional PDF reports with cost analysis
  • πŸ“Š CSV Export: Export resource and cost data for external analysis
  • 🎨 Professional UI: Stunning gradient design matching modern SaaS applications

πŸ›‘οΈ Compliance & Security

  • βœ… CIS Benchmark Support: Full implementation of CIS AWS Foundations Benchmark v1.4.0 (58 Controls)
  • πŸ” IAM Security: Checks for root usage, MFA enforcement, password policies, and access key rotation
  • πŸ“‹ Storage Compliance: Validates S3 bucket encryption, public access blocks, and EBS encryption
  • πŸ“ Logging & Auditing: Verifies CloudTrail integration, log file validation, and VPC flow logs
  • 🚨 Proactive Monitoring: Alerts on unauthorized API calls, console sign-in failures, and config changes
  • 🌐 Network Security: Audits Security Groups and NACLs for unrestricted access (0.0.0.0/0)

πŸ“Š Dashboard & UI

  • Real-time Dashboard: Modern React-based frontend with live data and stunning gradients
  • Advanced Filtering: Search and filter resources by region, status, and metadata
  • Resource Details: In-depth view with policies, tags, and usage history
  • Safe Delete Operations: Force cleanup options for dependent resources
  • Security Assessment: Highlight high-risk resources (active unused access keys)
  • Professional Design: Beautiful gradient backgrounds, smooth animations, and modern UI components

πŸ”” Notifications & Alerts

  • πŸ”” Slack Integration: Real-time alerts with regional breakdown
  • πŸ“§ Email Reports: Detailed HTML reports with professional formatting
  • ⏰ Scheduled Scans: Automated monitoring with Celery Beat scheduler
  • πŸ“Š Resource Aggregation: Comprehensive reporting with estimated savings

βš™οΈ Backend & API

  • RESTful API: FastAPI backend with comprehensive endpoints
  • Redis Caching: Improved performance with intelligent caching (especially for Pricing API)
  • Celery Integration: Asynchronous task processing for scheduled scans
  • Error Handling: Graceful error handling with detailed messages
  • Health Monitoring: Built-in health checks for all services

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose installed
  • AWS Account with appropriate credentials
  • Redis server (auto-included with Docker)

1. Clone & Configure

git clone <repository-url>
cd cloud-cleaner-dashboard

# Configure AWS credentials
cp .env.example .env
# Edit .env with your AWS credentials and notification settings

2. Start Services

docker-compose up -d

3. Access Dashboards

That's it! The dashboard will automatically scan your AWS resources and display them in the UI.

πŸ“š Documentation

Complete documentation index with navigation and architecture overview.

πŸ“‹ Documentation Navigation

πŸš€ Setup Guide

Complete installation and setup instructions

  • Docker Quick Start: One-command deployment
  • Local Development: Manual setup for development
  • Production Deployment: Production-ready configuration
  • Environment Configuration: All required environment variables

Detailed configuration reference

  • Environment Variables: Complete reference for all settings
  • AWS Permissions: Required IAM permissions and security best practices
  • Notification Setup: Slack and Email configuration
  • Redis Configuration: Caching and task queue setup
  • Security Settings: Production security hardening

Complete API reference with examples

  • Resource Endpoints: EC2, EBS, S3, IAM API endpoints
  • Cost Analysis Endpoints: Cost estimation and reporting APIs
  • Schedule Endpoints: Automated scanning configuration
  • Notification Endpoints: Alert and notification APIs
  • Export Endpoints: PDF and CSV report generation
  • Request/Response Examples: Detailed examples for all endpoints
  • Error Handling: Error responses and status codes

Automated monitoring and alerts

  • Celery Beat Setup: Background task scheduling
  • Configuration Options: Frequency and notification settings
  • Multi-Region Scanning: Comprehensive AWS region coverage
  • Security Monitoring: Access key risk assessment
  • Troubleshooting: Common issues and solutions

Step-by-step usage guide

  • Dashboard Navigation: Interface overview and navigation
  • Resource Management: Filtering, searching, and managing resources
  • Cost Analysis: Understanding cost breakdowns and savings opportunities
  • Report Generation: Creating PDF and CSV reports
  • Alert Panel: Sending notifications and reports
  • Schedule Settings: Configuring automated scanning
  • Best Practices: Security and cost optimization tips

Detailed instructions for configuring Slack and Email notifications.

πŸ—οΈ Architecture

Backend (FastAPI + Python 3.13)

  • Modular Design: Separate modules for each AWS service
  • Centralized AWS Client: Single factory pattern for boto3 clients
  • Redis Integration: Caching and task queue management
  • Celery Workers: Background task processing for scheduled scans

Frontend (Next.js 14 + TypeScript)

  • Server-Side Rendering: Next.js 14 with App Router
  • Component Architecture: Reusable, maintainable components
  • Real-time Updates: Live data refresh with progress feedback
  • Responsive Design: Mobile-first approach with Tailwind CSS

Infrastructure

  • Redis: Task queue and caching layer
  • Celery Beat: Scheduled task management
  • Docker Compose: Complete service orchestration
  • Health Checks: Comprehensive monitoring and alerting

πŸ”§ Development

Local Setup

# Backend
cd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Seed security frameworks (CIS Benchmark)
python scripts/seed_security_frameworks.py
python main.py

# Celery Worker (Terminal 2)
./start_celery_worker.sh

# Celery Beat (Terminal 3)
./start_celery_beat.sh

# Frontend (Terminal 4)
cd frontend
npm install
npm run dev

Testing

# Backend tests
cd backend
pytest

# Frontend tests
cd frontend
npm test

# Code quality
flake8 .  # Backend
npm run lint  # Frontend

πŸ›‘οΈ Security

AWS Permissions

The application requires read-only permissions for AWS resource monitoring:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstances",
        "ec2:DescribeRegions",
        "ec2:DescribeVolumes",
        "ec2:DescribeSnapshots",
        "ec2:DescribeAddresses",
        "rds:DescribeDBInstances",
        "rds:ListTagsForResource",
        "s3:ListAllMyBuckets",
        "s3:GetBucketLocation",
        "s3:GetBucketTagging",
        "s3:GetBucketVersioning",
        "elasticache:DescribeCacheClusters",
        "elasticache:ListTagsForResource",
        "lambda:ListFunctions",
        "lambda:GetFunction",
        "iam:ListRoles",
        "iam:GetRole",
        "iam:ListRolePolicies",
        "iam:ListAttachedRolePolicies",
        "iam:ListUsers",
        "iam:GetUser",
        "iam:ListUserPolicies",
        "iam:ListAttachedUserPolicies",
        "iam:ListAccessKeys",
        "iam:GetAccessKeyLastUsed",
        "iam:GetLoginProfile",
        "pricing:GetProducts",
        "pricing:GetAttributeValues",
        "cloudwatch:GetMetricStatistics"
      ],
      "Resource": "*"
    }
  ]
}

Security Best Practices

  • Use IAM roles instead of access keys when possible
  • Enable Multi-Factor Authentication for AWS console
  • Restrict notification recipients to authorized users
  • Use environment-specific AWS credentials
  • Enable CloudTrail for audit logging

πŸ“Š Project Structure

cloud-cleaner-dashboard/
β”œβ”€β”€ backend/                    # FastAPI backend
β”‚   β”œβ”€β”€ api/                   # API endpoints
β”‚   β”‚   β”œβ”€β”€ ec2.py            # EC2 resource endpoints
β”‚   β”‚   β”œβ”€β”€ ebs.py            # EBS volume endpoints  
β”‚   β”‚   β”œβ”€β”€ iam.py            # IAM user/role endpoints
β”‚   β”‚   └── notifications.py  # Notification endpoints
β”‚   β”œβ”€β”€ core/                 # Core functionality
β”‚   β”‚   β”œβ”€β”€ aws_client.py     # AWS client factory
β”‚   β”‚   β”œβ”€β”€ celery_app.py     # Celery configuration
β”‚   β”‚   └── cache.py          # Redis caching
β”‚   β”œβ”€β”€ services/             # Domain services
β”‚   β”‚   └── aws/             # AWS specific logic
β”‚   β”‚       β”œβ”€β”€ pricing.py    # AWS Price List API integration
β”‚   β”‚       β”œβ”€β”€ scanner_registry.py # Plugin registry
β”‚   β”‚       β”œβ”€β”€ scanner_base.py     # Base scanner class
β”‚   β”‚       └── scanners/           # Resource scanners
β”‚   β”‚           β”œβ”€β”€ ec2_scanner.py
β”‚   β”‚           β”œβ”€β”€ rds_scanner.py
β”‚   β”‚           β”œβ”€β”€ s3_scanner.py
β”‚   β”‚           └── elasticache_scanner.py
β”‚   └── main.py               # FastAPI application
β”œβ”€β”€ frontend/                  # Next.js frontend
β”‚   β”œβ”€β”€ src/app/             # Next.js pages
β”‚   β”‚   β”œβ”€β”€ dashboard/       # Resource dashboard
β”‚   β”‚   └── cost-analysis/   # Cost analysis dashboard
β”‚   β”œβ”€β”€ src/components/      # React components
β”‚   └── src/hooks/          # Custom React hooks
β”œβ”€β”€ docs/                     # Documentation
β”‚   β”œβ”€β”€ README.md           # Documentation index
β”‚   β”œβ”€β”€ setup.md            # Installation guide
β”‚   β”œβ”€β”€ api.md              # API documentation
β”‚   β”œβ”€β”€ configuration.md    # Configuration guide
β”‚   β”œβ”€β”€ scheduled-scanning.md # Automation guide
β”‚   β”œβ”€β”€ usage.md            # Dashboard usage guide
β”‚   └── NOTIFICATIONS_SETUP.md # Notification setup
β”œβ”€β”€ docker-compose.yml        # Service orchestration
β”œβ”€β”€ LICENSE.md                # MIT License
└── README.md                 # This file

🀝 Contributing

We love contributions! Please read our Contributing Guide to get started.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT License - see LICENSE.md file for details.

πŸ›‘οΈ Security Policy

Please read our Security Policy for information on supported versions and reporting vulnerabilities.

πŸ†˜ Support & Troubleshooting

Common Issues

πŸ”§ Setup Issues

  • Ensure Docker is running: docker --version
  • Check Redis connectivity: redis-cli ping
  • Verify AWS credentials: aws sts get-caller-identity

πŸ” API Issues

  • Check backend logs: docker-compose logs backend
  • Verify API connectivity: curl http://localhost:8084/health
  • Test AWS permissions: Use the API docs at /docs

⏰ Scheduling Issues

  • Check Celery worker: docker-compose logs celery-worker
  • Verify Redis queue: redis-cli KEYS *
  • Test manual trigger: POST /api/schedule/trigger

Getting Help

  1. Check the Setup Guide for installation issues
  2. Review the API Documentation for endpoint questions
  3. See Configuration Guide for setup problems
  4. Check logs: docker-compose logs -f
  5. Open an issue on GitHub with logs and error messages

Logging

# View all service logs
docker-compose logs -f

# View specific service logs
docker-compose logs -f backend
docker-compose logs -f frontend
docker-compose logs -f celery-worker
docker-compose logs -f celery-beat

πŸ”„ Changelog

See RELEASES.md for detailed release notes and version history.


Built with ❀️ for better AWS resource management

GitHub stars GitHub forks

About

A comprehensive AWS resource management dashboard for identifying and tracking unused cloud resources to optimize costs. Built with Python 3.13, Docker, and modern web technologies.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors