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
๐ค New in v2.0.0 โ
kosty ainow audits Bedrock and SageMaker workloads: guardrails, shadow AI detection, idle GPU endpoints, prompt caching, and more. See what's new โ
Scan 30+ 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
๐ก๏ธ 200+ Security 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 30+ 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
| 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
200+ checks across 30+ services. Highlights:
- IAM Privilege Escalation โ detects 21 known escalation patterns with optional
--deepconfirmation 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
30 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)
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
Full configuration guide โ docs/CONFIGURATION.md
๐ Documentation
| Guide | Description |
|---|---|
| Full Documentation | Complete user guide |
| Service Coverage | All 30 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 |
๐ค Contributing
- Report Issues โ Open an issue
- Add Services โ Follow the pattern in
kosty/services/ - 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kosty-2.0.0.tar.gz.
File metadata
- Download URL: kosty-2.0.0.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8edea3951c8593dabb56a2545494a0d733b434bbf8b012cf418ee2f5848d5a7
|
|
| MD5 |
25c76d664a7470c9df703d6f6d20ea72
|
|
| BLAKE2b-256 |
0650b9b0f62b5912e034fe4d4931d605d511136b26a3e987fb1e9cb5a67b1846
|
File details
Details for the file kosty-2.0.0-py3-none-any.whl.
File metadata
- Download URL: kosty-2.0.0-py3-none-any.whl
- Upload date:
- Size: 143.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1618d03679bba17d86e922610d639b3524eb46520963677b19a9721d8ed5e3e4
|
|
| MD5 |
24ca75a3926116f5d650c92fe2a9875b
|
|
| BLAKE2b-256 |
b69f3ec648a28f257c97527fc6dcf60e72a045c50d48bbb8aa247bc1ec85f98c
|