Skip to main content

💰 Kosty - AWS Cost Optimization & Security Audit CLI Tool

Kosty Logo Python AWS License

🧩 v3.2.0 — Modular Platform — Plugin-based engine. 151 checks, 32 services, fully extensible. Architecture guide →

Scan 32 AWS services. Find cost waste. Detect security gaps. Audit GenAI workloads. One command.

Quick Start • Key Features • Service Coverage • Documentation


⚡ Why Kosty

🌐 External Attack Surface Mapping — scan 15 resource types, classify exposure as unprotected / partially protected / protected

🔐 IAM Privilege Escalation Detection — 21 known escalation patterns with optional --deep confirmation via SimulatePrincipalPolicy

🤖 GenAI Security & Cost Audit — Bedrock guardrails, shadow AI detection, SageMaker idle GPU endpoints, prompt caching

🏢 Organization-Wide Scanning — parallel audit across hundreds of AWS accounts with cross-account role assumption

🛡️ 151 Security & Cost Checks — WAF hardening, API Gateway auth/throttling/TLS, CloudTrail, GuardDuty, VPC Flow Logs, KMS rotation

💰 Real Dollar Savings — not just recommendations, actual monthly amounts for 11 services ($280/mo per stopped m5.2xlarge, $700/mo per oversized db.r5.4xlarge)


🎯 Quick Start

pip install kosty

# Full audit — cost + security across 32 services
kosty audit --output all

# External attack surface mapping
kosty public-exposure --output console

# AI/ML audit — Bedrock + SageMaker
kosty ai audit --output console

# IAM privilege escalation detection (21 patterns)
kosty iam check-privilege-escalation --deep

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

💡 Need expert help? Professional consulting available →


📊 Visual Dashboard

Kosty Dashboard

Kosty Dashboard AI Audit Dashboard
Full Audit Dashboard AI/ML Audit Dashboard

Upload your JSON report to the built-in dashboard for interactive charts, filtering, and cost breakdowns.


🚀 Key Features

🌐 Attack Surface Mapping

Map everything publicly exposed and evaluate protections — ALB, EC2, S3, RDS, API Gateway, Lambda URLs, CloudFront, OpenSearch, Redshift, EKS, ECR, SNS, SQS, and snapshots.

kosty public-exposure --output console

Each finding is classified:

  • 🔴 Exposed & Unprotected — no protections, immediate action
  • 🟡 Exposed & Partially Protected — gaps remain
  • 🟢 Exposed & Protected — all protections verified

🔐 Security Audit

151 checks across 32 services. Highlights:

  • IAM Privilege Escalation — detects 21 known escalation patterns with optional --deep confirmation via SimulatePrincipalPolicy
  • WAF Hardening — managed rules, rate limiting, bot control, logging, action mode
  • API Gateway — WAF association, authorization, throttling, TLS 1.2, CloudFront bypass detection, request validation
  • Foundational — CloudTrail, VPC Flow Logs, GuardDuty, AWS Config, KMS key rotation
  • Data Protection — S3 encryption, RDS encryption, ElastiCache encryption, Secrets Manager rotation
kosty iam security-audit --deep
kosty waf audit
kosty apigateway security-audit

🤖 AI/ML Audit

Dedicated kosty ai command for Bedrock and SageMaker workloads. Catches the invisible waste and security gaps that standard audits miss.

kosty ai audit                              # full Bedrock + SageMaker
kosty ai bedrock check-no-guardrails        # prompt injection protection
kosty ai bedrock check-shadow-ai            # unapproved AI usage
kosty ai sagemaker check-idle-endpoints     # GPU instances burning cash

Bedrock (12 checks) — guardrails, shadow AI detection, VPC endpoints, prompt caching, inference profiles, custom model encryption, logging, budget limits, TPM quota monitoring, cross-account model access, model sizing analysis, batch eligibility detection

SageMaker (8 checks) — idle endpoints, zombie notebooks, Spot training, checkpointing, Inference Components, VPC endpoints, internet access, root access

💰 Cost Optimization

Real dollar savings for 11 services — not just recommendations, actual monthly amounts:

Finding Typical Savings
Stopped EC2 instances $280/mo per m5.2xlarge
Oversized RDS instances $700/mo per db.r5.4xlarge
Unused NAT Gateways $33/mo each
Orphaned EBS volumes $10/mo per 100GB
Load Balancers with no targets $16/mo each
Unused secrets $0.40/mo each
kosty audit --output json   # generates report with $ amounts
open dashboard/index.html   # visualize savings

📊 Service Coverage

32 services, organized by category:

Category Services Key Checks
Compute EC2, Lambda Oversized, idle, IMDSv1, outdated runtimes
Storage S3, EBS, Snapshots Public access, encryption, lifecycle, object lock
Database RDS, DynamoDB Public DBs, oversized, encryption, backups
Network EIP, LB, NAT, SG, Route53, VPC Unused resources, open ports, flow logs
Security IAM, WAFv2, GuardDuty, KMS Privilege escalation, MFA, key rotation, threat detection
Management CloudWatch, Backup, CloudTrail, Config Logging, audit trail, drift detection
Application API Gateway WAF, auth, throttling, TLS, CloudFront bypass
AI/ML Bedrock, SageMaker Guardrails, shadow AI, idle endpoints, prompt caching, VPC endpoints
Secrets Secrets Manager Unused secrets, rotation
Messaging SNS, SQS Encryption at rest and in transit
Cache ElastiCache Encryption at rest and in transit
Certificates ACM Expiring certificates
Containers ECS Privileged task definitions
Patch Mgmt SSM Patch compliance

Full check list per service → docs/SERVICES.md


🔧 Installation

# PyPI (recommended) — requires Python 3.10+
pip install kosty

# Docker
docker run --rm -v ~/.aws:/home/nonroot/.aws:ro ghcr.io/kosty-cloud/kosty:latest audit

# From source
git clone https://github.com/kosty-cloud/kosty.git && cd kosty && pip install -e .

⚙️ Configuration

# kosty.yaml
default:
  regions: [us-east-1, eu-west-1]
  max_workers: 20

exclude:
  services: [route53]
  tags:
    - key: "kosty_ignore"
      value: "true"

profiles:
  production:
    role_arn: "arn:aws:iam::123456789012:role/AuditRole"
    regions: [us-east-1]
  staging:
    aws_profile: "staging-profile"
    regions: [eu-west-1]
kosty audit --profile production
kosty audit --profiles --output all    # all profiles in parallel

Local reports include a .sha256 sidecar for integrity verification:

sha256sum -c kosty_full_*.json.sha256

Full configuration guide → docs/CONFIGURATION.md


📖 Documentation

Guide Description
Full Documentation Complete user guide
Service Coverage All 32 services and their checks
CLI Reference Every command and option
Examples Detailed usage examples
Configuration YAML config, profiles, exclusions
Multi-Profile Guide Parallel multi-customer audits
Release Notes Version history
Architecture (v3) Plugin system, writing checks

🤝 Contributing

  1. Report Issues — Open an issue
  2. Add Checks — Follow the plugin pattern in kosty/providers/aws/services/. After adding a plugin, run python scripts/generate_manifest.py to update the integrity manifest.
  3. Star the Repo — Show your support

💼 Professional Services

Free 30-minute assessment to discuss your AWS setup.

📅 Book a call · 📧 yassir@kosty.cloud · 🌐 kosty.cloud


📄 License

MIT License — see LICENSE

💰 Save money. Secure infrastructure. Ship faster.

⭐ Star this repo if Kosty saved you money

Metadata

Release files for kosty 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kosty 3.2.0
File Size Uploaded
kosty-3.2.0.tar.gz 4.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for kosty 3.2.0
File Interpreter ABI Platform
kosty-3.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.3 MB

Release files / kosty-3.2.0.tar.gz

Download URL kosty-3.2.0.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
4252657239b0a0d370f4d1c3099742a84f0b3def0bba7d13e866bf929c58b848
BLAKE2b-256 checksum
How to use checksums
37cf0020f756f715ad29515d786bf679f41ea2057ecd4afad0225cc430cf8303
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kosty-3.2.0-py3-none-any.whl

Download URL kosty-3.2.0-py3-none-any.whl
Size 220.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6dc5307100a567d94fe7fc2ee4fb7647242a0985d427266bae4377c1dbb8f3c7
BLAKE2b-256 checksum
How to use checksums
4443b516a9bb1f6dabc5f4fe29245e6075847e81e56ff0f10d826db9ce0dd398
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.3

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.3

2 release files

1.3.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page