Skip to main content

AWS Cost Optimization & Security Audit CLI Tool - Identify cost waste, security vulnerabilities, and compliance issues across 16 core AWS services

Project description

๐Ÿ’ฐ Kosty - AWS Cost Optimization & Security Audit CLI Tool

Kosty Logo Python AWS License

๐Ÿš€ Identify AWS cost waste and security vulnerabilities across 16 core services with a single command

Save thousands of dollars monthly and improve security posture by finding unused resources, oversized instances, misconfigurations, and compliance issues

๐ŸŽฏ Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿ”ง Installation โ€ข ๐Ÿ’ก Examples

๐Ÿ“Š Visual Dashboard

Not just CLI! Kosty includes a beautiful, modern web dashboard to visualize your optimization results:

Kosty Dashboard

โœจ Premium Features: Interactive charts, responsive design, real-time data visualization, and professional reporting.


๐ŸŒŸ Built by a Cloud Consultant, for Cloud Engineers

After years of AWS consulting , I kept finding the same costly patterns:

  • Load Balancers with no targets 10K$-30K$/year wasted
  • Orphaned EBS volumes: $1,000-2,500/year
  • Unused NAT Gateways, oversized instances, old snapshots,...

Every. Single. Time.

So I built Kosty - the tool I wish existed when I started consulting.

What Kosty Does

  • ๐Ÿ” Scans 16 core AWS services in one command
  • ๐Ÿ’ฐ Identifies orphaned resources (instant cost savings)
  • ๐Ÿ“Š Finds oversized instances (EC2, RDS, Lambda)
  • ๐Ÿ” Detects security vulnerabilities (public DBs, unencrypted storage, open ports)
  • ๐Ÿ›ก๏ธ Identifies compliance issues (old access keys, public snapshots, weak configurations)

One command. Full audit. Free forever.

AWS costs and security risks can spiral out of control quickly. Kosty helps you:

  • ๐Ÿ” Discover unused resources and security vulnerabilities across 16 core AWS services
  • ๐Ÿ’ฐ Identify oversized and idle resources for cost optimization
  • ๐Ÿ” Detect security misconfigurations and compliance issues
  • โšก Optimize with prioritized recommendations for cost and security
  • ๐Ÿข Scale across entire AWS Organizations with parallel processing
  • ๐Ÿ“Š Track issues with comprehensive reporting

๐ŸŽฏ Quick Start

# Install Kosty via pip (recommended)
pip install kosty

# Or install from source
git clone https://github.com/kosty-cloud/kosty.git
cd kosty && ./install.sh

# ๐Ÿš€ ONE COMMAND TO RULE THEM ALL - Comprehensive scan
kosty audit --output all

# Organization-wide comprehensive scan with reports
kosty audit --organization --max-workers 20 --output all

# Individual service scans
kosty ec2 audit --cpu-threshold 20
kosty rds audit
kosty s3 audit

# Cost and security audits separately
kosty ec2 cost-audit --cpu-threshold 20
kosty s3 security-audit
kosty iam security-audit

# Individual checks
kosty ec2 check-oversized-instances --cpu-threshold 20
kosty ec2 check-stopped-instances --days 7
kosty s3 check-empty-buckets
kosty rds check-public-databases

# ๐Ÿ“Š View results in beautiful dashboard
open dashboard/index.html

๐Ÿ”ง Installation

Prerequisites

  • Python 3.7+
  • AWS CLI configured with appropriate credentials

Quick Install (Recommended)

pip install kosty

Install from Source

git clone https://github.com/kosty-cloud/kosty.git
cd kosty
./install.sh

Development Install

git clone https://github.com/kosty-cloud/kosty.git
cd kosty
pip install -e .

๐Ÿ’ก Examples

๐Ÿ† High-Impact Optimizations

# Find oversized EC2 instances
kosty ec2 check-oversized-instances --cpu-threshold 20

# Find unused RDS read replicas
kosty rds check-unused-read-replicas

# Find over-provisioned Lambda functions
kosty lambda check-over-provisioned-memory

# Find orphaned EBS volumes
kosty ebs check-orphan-volumes

# Find unattached Elastic IPs
kosty eip check-unattached-eips

๐Ÿ” Resource Discovery & Security Audits

# Storage optimization & security
kosty s3 check-empty-buckets
kosty s3 check-public-read-access
kosty s3 check-encryption-at-rest
kosty ebs check-orphan-volumes
kosty ebs check-unencrypted-orphan
kosty snapshots check-old-snapshots --days 30
kosty snapshots check-public-snapshots

# Database optimization & security
kosty rds check-oversized-instances --cpu-threshold 20
kosty rds check-public-databases
kosty rds check-unencrypted-storage
kosty dynamodb check-idle-tables

# Network optimization & security
kosty lb check-no-healthy-targets
kosty nat check-unused-gateways
kosty sg check-unused-groups
kosty sg check-overly-permissive

# Security & compliance checks
kosty ec2 check-ssh-open
kosty ec2 check-imdsv1
kosty ec2 check-unencrypted-ebs
kosty iam check-root-access-keys
kosty iam check-unused-roles
kosty iam check-old-access-keys

๐Ÿข Comprehensive Scanning

# ๐ŸŽฏ ULTIMATE COST AUDIT - All services, all checks
kosty audit --output all

# Organization-wide comprehensive scan (16 services)
kosty audit --organization --max-workers 20 --output json

# Multi-region comprehensive audit
kosty audit --regions us-east-1,eu-west-1,ap-southeast-1 --output csv

# Single region scan
kosty audit --region eu-west-1 --output json

# Quick console summary
kosty audit --output console

# Generate all report formats
kosty audit --organization --output all --max-workers 15

# ๐Ÿ“Š Visualize results in dashboard
kosty audit --output json
open dashboard/index.html  # Upload the JSON file

๐Ÿš€ Command Types

Kosty offers 3 types of commands for maximum flexibility:

1. ๐ŸŽฏ Complete Audits - Full service analysis

kosty <service> audit           # Complete audit (cost + security)
kosty ec2 audit                 # All EC2 checks
kosty s3 audit                  # All S3 checks

2. ๐Ÿ’ฐ Targeted Audits - Cost or security focus

kosty <service> cost-audit      # Cost optimization only
kosty <service> security-audit  # Security issues only

kosty ec2 cost-audit           # EC2 cost issues only
kosty s3 security-audit        # S3 security issues only
kosty iam security-audit       # IAM security issues only

3. ๐Ÿ” Individual Checks - Specific issue detection

kosty <service> check-<issue>   # Specific check

kosty ec2 check-oversized-instances
kosty ec2 check-stopped-instances
kosty s3 check-empty-buckets
kosty rds check-public-databases
kosty iam check-root-access-keys

4. ๐ŸŒ Multi-Region & Organization - Comprehensive scanning

# Multi-region scanning
kosty audit --regions us-east-1,eu-west-1,ap-southeast-1
kosty ec2 audit --regions us-east-1,eu-west-1

# Organization-wide with multi-region
kosty audit --organization --regions us-east-1,eu-west-1 --max-workers 20
kosty s3 check-public-read-access --organization --regions us-east-1,eu-west-1

# Custom cross-account role for organization scanning
kosty audit --organization --cross-account-role MyCustomRole

# Separate organizational admin account
kosty audit --organization --org-admin-account-id 123456789012

# Combined custom role and admin account
kosty audit --organization --cross-account-role MyRole --org-admin-account-id 123456789012

๐Ÿ“Š Complete Service Coverage (16 Services)

๐ŸŽฏ Service Overview

Category Services Key Checks
๐Ÿ’ป Compute EC2, Lambda Oversized instances, unused functions
๐Ÿ—„๏ธ Storage S3, EBS, Snapshots Empty buckets, orphaned volumes, old snapshots
๐Ÿ—ƒ๏ธ Database RDS, DynamoDB Idle databases, over-provisioned tables
๐ŸŒ Network EIP, LB, NAT, SG, Route53 Unused resources, no healthy targets
๐Ÿ” Security IAM Unused roles, old access keys, inactive users
๐Ÿ“Š Management CloudWatch, Backup Unused alarms, expensive logs, empty vaults
๐ŸŒ Application API Gateway Unused APIs, expensive configurations

๐Ÿ“‹ Service Commands Summary

Service Total Commands Audit Types Individual Checks
EC2 16 3 13 checks
RDS 17 3 14 checks
S3 14 3 11 checks
IAM 13 3 10 checks
EBS 12 3 9 checks
LB 10 3 7 checks
SG 9 3 6 checks
Lambda 8 3 5 checks
EIP 7 3 4 checks
CloudWatch 7 3 4 checks
Backup 6 3 3 checks
NAT 6 3 3 checks
Snapshots 6 3 3 checks
API Gateway 5 3 2 checks
DynamoDB 5 3 2 checks
Route53 5 3 2 checks

๐Ÿ“Š Total: 147 commands (1 global + 146 service commands)

๐Ÿ” Top Individual Checks by Service

EC2 (13 individual checks):

  • check-oversized-instances - Instances with low CPU utilization
  • check-stopped-instances - Instances stopped for 7+ days
  • check-ssh-open - SSH port open to 0.0.0.0/0
  • check-idle-instances - Instances with <5% CPU usage

S3 (11 individual checks):

  • check-empty-buckets - Buckets with no objects
  • check-public-read-access - Buckets with public read access
  • check-encryption-at-rest - Unencrypted buckets
  • check-lifecycle-policy - Buckets needing lifecycle policies

RDS (14 individual checks):

  • check-public-databases - Publicly accessible databases
  • check-oversized-instances - Over-provisioned RDS instances
  • check-unused-read-replicas - Unused read replicas
  • check-unencrypted-storage - Unencrypted RDS storage

IAM (10 individual checks):

  • check-root-access-keys - Root account access keys
  • check-unused-roles - Roles unused for 90+ days
  • check-inactive-users - Inactive users with active keys
  • check-wildcard-policies - Policies with wildcard permissions

๐ŸŽฏ The Ultimate Command

# ๐Ÿš€ ONE COMMAND TO AUDIT EVERYTHING
kosty audit

# Organization-wide comprehensive audit
kosty audit --organization --max-workers 20

# Generate all report formats
kosty audit --output all

What kosty audit does:

  • โœ… Scans 16 core AWS services automatically
  • โœ… Runs complete audits (cost + security) per service
  • โœ… Generates comprehensive reports (JSON, CSV, Console)
  • โœ… Prioritizes issues by severity and impact
  • โœ… Scales across single account or entire organization

๐Ÿš€ Features

๐Ÿ’ป CLI + Web Dashboard

  • โœ… Modular CLI Architecture - Organized by AWS service for maintainability
  • โœ… Command Line Interface - Powerful CLI for automation and scripting
  • โœ… Visual Web Dashboard - Modern React-based interface with interactive charts
  • โœ… Multiple Report Formats - Console, JSON, CSV outputs + visual reports

๐Ÿ” Comprehensive Analysis

  • โœ… 16 Core AWS Services - Essential infrastructure coverage
  • โœ… One-Command Audit - kosty audit scans everything
  • โœ… Organization Support - Multi-account scanning with configurable roles
  • โœ… Multi-Region - Scan across multiple AWS regions simultaneously with --regions
  • โœ… Flexible IAM - Custom cross-account roles and separate org admin accounts

โšก Performance & Usability

  • โœ… Parallel Processing - High-performance with configurable workers
  • โœ… Issue Tracking - Comprehensive categorization and prioritization
  • โœ… Safe Operations - Read-only analysis, no resource modifications
  • โœ… Professional Reporting - Executive-ready dashboards and reports
  • โœ… Smart Validation - Upfront permission checks with clear error messages

๐Ÿ“– Documentation

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. ๐Ÿ› Report Issues - Found a bug? Open an issue
  2. ๐Ÿ’ก Feature Requests - Have an idea? Start a discussion
  3. ๐Ÿ”ง Add Services - Implement new AWS service checks
  4. ๐Ÿ“– Improve Docs - Help make documentation better
  5. โญ Star the Repo - Show your support!

Adding New Services

# kosty/services/new_service_audit.py
import boto3
from typing import List, Dict, Any

class NewServiceAuditService:
    def __init__(self):
        self.cost_checks = ['check_unused_resources']
        self.security_checks = ['check_public_access']
    
    def audit(self, session: boto3.Session, region: str, **kwargs) -> List[Dict[str, Any]]:
        results = []
        results.extend(self.cost_audit(session, region, **kwargs))
        results.extend(self.security_audit(session, region, **kwargs))
        return results

๐Ÿ“„ License

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

โญ Show Your Support

If Kosty helped you save money on AWS costs, please:

  • โญ Star this repository
  • ๐Ÿฆ Share on Twitter with #AWSCostOptimization
  • ๐Ÿ’ฌ Tell your colleagues about cost optimization
  • ๐Ÿค Contribute to make it even better

๐Ÿ’ฐ Save money. Optimize AWS. Scale efficiently.

๐ŸŽฏ Get Started โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿค Contribute

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

kosty-1.3.8.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

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

kosty-1.3.8-py3-none-any.whl (75.1 kB view details)

Uploaded Python 3

File details

Details for the file kosty-1.3.8.tar.gz.

File metadata

  • Download URL: kosty-1.3.8.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kosty-1.3.8.tar.gz
Algorithm Hash digest
SHA256 718906258bf42edeb6df2d3775348e7efc81d091defeb1db730a38c3c22f8e74
MD5 32b96504e6293c4b6073a5ed6a206241
BLAKE2b-256 e3be3246b71603b3cc691b0c1e973a9715705218f11ee95aec193f84a93bcd34

See more details on using hashes here.

File details

Details for the file kosty-1.3.8-py3-none-any.whl.

File metadata

  • Download URL: kosty-1.3.8-py3-none-any.whl
  • Upload date:
  • Size: 75.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kosty-1.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 678e64fd0c8f1533aa8f18358b8fae307b759d6756837d6bfd3be3bc6e9423bb
MD5 c412bb6e24ea64d71bee0ae6bb830b47
BLAKE2b-256 36807497c810f5f4688cc1573df2e1cbcca5a07778fd1258be013920d6097a03

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