Skip to content

Commit 27d5cfc

Browse files
authored
Merge pull request #36 from kosty-cloud/release/v1.9.2
feat: v1.9.2 — 30 services, 180+ checks, public-exposure, privilege escalation, WAFv2
2 parents 1cce6b0 + e69bc95 commit 27d5cfc

38 files changed

Lines changed: 1921 additions & 50 deletions

README.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
> 💡 Need expert help optimizing your AWS infrastructure? [Professional consulting services available →](https://kosty.cloud?utm_source=github&utm_medium=readme-header)
1111
12-
**🚀 Identify AWS cost waste and security vulnerabilities across 17 core services with a single command**
12+
**🚀 Identify AWS cost waste and security vulnerabilities across 30 core services with a single command**
1313

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

@@ -43,7 +43,7 @@ So I built Kosty - the tool I wish existed when I started consulting.
4343

4444

4545
### What Kosty Does
46-
- 🔍 Scans **17 core AWS services** in one command
46+
- 🔍 Scans **30 core AWS services** in one command
4747
- 💰 **Quantifies cost savings** with real dollar amounts (11 services)
4848
- 📊 Finds **oversized instances** (EC2, RDS, Lambda)
4949
- 🔐 Detects **security vulnerabilities** (public DBs, unencrypted storage, open ports)
@@ -54,7 +54,7 @@ So I built Kosty - the tool I wish existed when I started consulting.
5454
**One command. Full audit. Real savings. Free forever.**
5555

5656
AWS costs and security risks can spiral out of control quickly. Kosty helps you:
57-
- 🔍 **Discover** unused resources and security vulnerabilities across 17 core AWS services
57+
- 🔍 **Discover** unused resources and security vulnerabilities across 30 core AWS services
5858
- 💰 **Quantify** cost savings with real dollar amounts ($X/month calculations)
5959
- 🔐 **Detect** security misconfigurations and compliance issues
6060
-**Optimize** with prioritized recommendations by financial impact
@@ -236,6 +236,18 @@ kosty s3 check-no-cross-region-replication
236236
# RDS security
237237
kosty rds check-no-auto-minor-upgrade
238238
kosty rds check-no-performance-insights
239+
240+
# Foundational security checks
241+
kosty cloudtrail audit
242+
kosty vpc check-no-flow-logs
243+
kosty guardduty check-not-enabled
244+
kosty config check-not-enabled
245+
246+
# Secrets & AI
247+
kosty secretsmanager check-unused-secrets
248+
kosty secretsmanager check-no-rotation
249+
kosty bedrock check-no-logging
250+
kosty bedrock check-no-budget-limits
239251
```
240252

241253
### 🌐 External Attack Surface Audit
@@ -411,19 +423,26 @@ These services provide security and compliance audits without cost quantificatio
411423

412424
---
413425

414-
## 📊 Complete Service Coverage (17 Services)
426+
## 📊 Complete Service Coverage (23 Services)
415427

416428
### 🎯 Service Overview
417429

418430
| Category | Services | Key Checks |
419431
|----------|----------|------------|
420-
| **💻 Compute** | EC2, Lambda | Oversized instances, unused functions |
432+
| **💻 Compute** | EC2, Lambda | Oversized instances, unused functions, IMDSv1+oversized combo |
421433
| **🗄️ Storage** | S3, EBS, Snapshots | Empty buckets, orphaned volumes, old snapshots |
422434
| **🗃️ Database** | RDS, DynamoDB | Idle databases, over-provisioned tables |
423-
| **🌐 Network** | EIP, LB, NAT, SG, Route53 | Unused resources, no healthy targets |
424-
| **🔐 Security** | IAM, WAFv2 | MFA, privilege escalation, rate limiting, managed rules |
425-
| **📊 Management** | CloudWatch, Backup | Unused alarms, expensive logs, empty vaults |
435+
| **🌐 Network** | EIP, LB, NAT, SG, Route53, VPC | Unused resources, no healthy targets, flow logs |
436+
| **🔐 Security** | IAM, WAFv2, GuardDuty, KMS | MFA, privilege escalation, rate limiting, threat detection, key rotation |
437+
| **📊 Management** | CloudWatch, Backup, CloudTrail, AWS Config | Logging, alarms, audit trail, drift detection |
426438
| **🌐 Application** | API Gateway | WAF association, authorization, throttling, logging |
439+
| **🤖 AI/ML** | Bedrock | Invocation logging, budget limits |
440+
| **🔑 Secrets** | Secrets Manager | Unused secrets, rotation |
441+
| **📨 Messaging** | SNS, SQS | Encryption at rest and in transit |
442+
| **🗃️ Cache** | ElastiCache | Encryption at rest and in transit |
443+
| **📜 Certificates** | ACM | Expiring certificates |
444+
| **📦 Containers** | ECS | Privileged task definitions |
445+
| **🔧 Patch Management** | SSM | Patch compliance |
427446

428447
### 📋 Service Commands Summary
429448

@@ -520,7 +539,7 @@ kosty audit --output all
520539
```
521540

522541
**What `kosty audit` does:**
523-
- Scans 17 core AWS services automatically
542+
- Scans 30 core AWS services automatically
524543
- Runs complete audits (cost + security) per service
525544
- Generates comprehensive reports (JSON, CSV, Console)
526545
- Prioritizes issues by severity and impact
@@ -535,7 +554,7 @@ kosty audit --output all
535554
- Multiple report formats: Console, JSON, CSV, visual reports
536555

537556
### Comprehensive Analysis
538-
- 17 core AWS services coverage
557+
- 30 core AWS services coverage
539558
- Real dollar cost savings for 11 services
540559
- One-command audit scans everything
541560
- Multi-account organization support with configurable roles

docs/CLI_REFERENCE.md

Lines changed: 125 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Global Commands
66

77
#### `kosty audit`
8-
Comprehensive scan of all 17 AWS services.
8+
Comprehensive scan of all 30 AWS services.
99

1010
**Usage:**
1111
```bash
@@ -295,6 +295,130 @@ kosty apigateway check-missing-request-validation
295295
kosty apigateway check-cloudfront-bypass
296296
```
297297

298+
### CloudTrail Commands (6 total)
299+
300+
#### Audit Commands
301+
```bash
302+
kosty cloudtrail audit
303+
kosty cloudtrail security-audit
304+
```
305+
306+
#### Individual Checks
307+
```bash
308+
kosty cloudtrail check-not-enabled
309+
kosty cloudtrail check-no-log-validation
310+
kosty cloudtrail check-no-encryption
311+
```
312+
313+
### VPC Commands (5 total)
314+
315+
#### Audit Commands
316+
```bash
317+
kosty vpc audit
318+
kosty vpc security-audit
319+
```
320+
321+
#### Individual Checks
322+
```bash
323+
kosty vpc check-no-flow-logs
324+
kosty vpc check-default-sg-open
325+
```
326+
327+
### GuardDuty Commands (2 total)
328+
329+
```bash
330+
kosty guardduty audit
331+
kosty guardduty check-not-enabled
332+
```
333+
334+
### AWS Config Commands (2 total)
335+
336+
```bash
337+
kosty config audit
338+
kosty config check-not-enabled
339+
```
340+
341+
### Secrets Manager Commands (6 total)
342+
343+
#### Audit Commands
344+
```bash
345+
kosty secretsmanager audit [--days INT]
346+
kosty secretsmanager cost-audit [--days INT]
347+
kosty secretsmanager security-audit
348+
```
349+
350+
#### Individual Checks
351+
```bash
352+
kosty secretsmanager check-unused-secrets [--days INT]
353+
kosty secretsmanager check-no-rotation
354+
```
355+
356+
### Bedrock Commands (5 total)
357+
358+
#### Audit Commands
359+
```bash
360+
kosty bedrock audit
361+
kosty bedrock cost-audit
362+
kosty bedrock security-audit
363+
```
364+
365+
#### Individual Checks
366+
```bash
367+
kosty bedrock check-no-logging
368+
kosty bedrock check-no-budget-limits
369+
```
370+
371+
### KMS Commands (3 total)
372+
373+
```bash
374+
kosty kms audit
375+
kosty kms check-no-key-rotation
376+
```
377+
378+
### ACM Commands (3 total)
379+
380+
```bash
381+
kosty acm audit [--days INT]
382+
kosty acm check-expiring-certificates [--days INT]
383+
```
384+
385+
### ElastiCache Commands (4 total)
386+
387+
```bash
388+
kosty elasticache audit
389+
kosty elasticache security-audit
390+
kosty elasticache check-no-encryption-at-rest
391+
kosty elasticache check-no-encryption-in-transit
392+
```
393+
394+
### SNS Commands (2 total)
395+
396+
```bash
397+
kosty sns audit
398+
kosty sns check-no-encryption
399+
```
400+
401+
### SQS Commands (2 total)
402+
403+
```bash
404+
kosty sqs audit
405+
kosty sqs check-no-encryption
406+
```
407+
408+
### ECS Commands (2 total)
409+
410+
```bash
411+
kosty ecs audit
412+
kosty ecs check-privileged-tasks
413+
```
414+
415+
### SSM Commands (2 total)
416+
417+
```bash
418+
kosty ssm audit
419+
kosty ssm check-non-compliant-patches
420+
```
421+
298422
---
299423

300424
## 🔧 Common Parameters

docs/RELEASE_NOTES.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,79 @@
11
# 🚀 Kosty Release Notes
22

3+
## Version 1.9.2 - Foundational Security Services & Bedrock Audit (2025-01-XX)
4+
5+
### 🌟 13 New Services
6+
7+
**CloudTrail** (3 checks)
8+
- `check-not-enabled` — No multi-region trail configured (CIS 3.1)
9+
- `check-no-log-validation` — Log file integrity validation disabled (CIS 3.2)
10+
- `check-no-encryption` — Logs not encrypted with KMS (CIS 3.7)
11+
12+
**VPC** (2 checks)
13+
- `check-no-flow-logs` — VPC without Flow Logs enabled (CIS 3.9)
14+
- `check-default-sg-open` — Default security group has inbound rules (CIS 5.3)
15+
16+
**GuardDuty** (1 check)
17+
- `check-not-enabled` — Threat detection not active in region (CIS 4.15)
18+
19+
**AWS Config** (1 check)
20+
- `check-not-enabled` — Configuration recorder not active (CIS 3.5)
21+
22+
**Secrets Manager** (2 checks)
23+
- `check-unused-secrets` — Secrets never accessed but billed $0.40/mo each
24+
- `check-no-rotation` — Automatic rotation not enabled
25+
26+
**Amazon Bedrock** (2 checks)
27+
- `check-no-logging` — Model invocation logging disabled
28+
- `check-no-budget-limits` — No AWS Budget for Bedrock spend
29+
30+
**KMS** (1 check)
31+
- `check-no-key-rotation` — Customer-managed keys without automatic rotation
32+
33+
**ACM** (1 check)
34+
- `check-expiring-certificates` — Certificates expiring within 30 days (configurable via `--days`)
35+
36+
**ElastiCache** (2 checks)
37+
- `check-no-encryption-at-rest` — Redis replication groups without encryption at rest
38+
- `check-no-encryption-in-transit` — Redis replication groups without encryption in transit
39+
40+
**SNS** (1 check)
41+
- `check-no-encryption` — Topics without server-side encryption
42+
43+
**SQS** (1 check)
44+
- `check-no-encryption` — Queues without server-side encryption
45+
46+
**ECS** (1 check)
47+
- `check-privileged-tasks` — Task definitions with privileged containers (container escape risk)
48+
49+
**SSM** (1 check)
50+
- `check-non-compliant-patches` — Instances with missing security patches
51+
52+
### 🔧 Enhanced Checks
53+
54+
**IAM `check-unused-roles`**
55+
- Default threshold reduced from 90 to 30 days
56+
- Roles with AdministratorAccess or `*:*` now flagged as `critical` instead of `high`
57+
- Admin detection via attached policies and inline policy analysis
58+
59+
**EC2 `check-imdsv1-oversized`** (new)
60+
- Cross-references IMDSv1 + low CPU utilization into a single `critical` finding
61+
- Instances that are both SSRF-vulnerable and wasting money get highest remediation priority
62+
63+
**RDS `check-no-event-subscription`** (new)
64+
- Detects missing RDS event subscriptions for instance events
65+
66+
**S3 `check-no-account-public-access-block`** (new)
67+
- Checks if account-level S3 Block Public Access is fully enabled
68+
- Flags as critical if not configured at all
69+
70+
### 📊 Summary
71+
- **Total services**: 30 (was 17)
72+
- **New checks this release**: 25+
73+
- **Total commands**: ~240+
74+
75+
---
76+
377
## Version 1.9.0 - Security Audit Expansion, WAFv2 & Public Exposure (2025-01-XX)
478

579
### 🌐 New Command: `kosty public-exposure`

kosty/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "1.9.1"
1+
__version__ = "1.9.2"
22

kosty/cli/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@
2222
from .snapshots_commands import snapshots
2323
from .waf_commands import waf
2424
from .public_exposure_commands import public_exposure
25+
from .cloudtrail_commands import cloudtrail
26+
from .vpc_commands import vpc
27+
from .guardduty_commands import guardduty
28+
from .config_commands import awsconfig
29+
from .secretsmanager_commands import secretsmanager
30+
from .bedrock_commands import bedrock_cmd
31+
from .kms_commands import kms
32+
from .acm_commands import acm
33+
from .elasticache_commands import elasticache
34+
from .sns_commands import sns
35+
from .sqs_commands import sqs
36+
from .ecs_commands import ecs
37+
from .ssm_commands import ssm
2538

2639
@click.group(invoke_without_command=True)
2740
@click.option('--config-file', help='Path to configuration file (default: ./kosty.yaml or ~/.kosty/config.yaml)')
@@ -232,6 +245,19 @@ def version():
232245
cli.add_command(snapshots)
233246
cli.add_command(waf)
234247
cli.add_command(public_exposure)
248+
cli.add_command(cloudtrail)
249+
cli.add_command(vpc)
250+
cli.add_command(guardduty)
251+
cli.add_command(awsconfig)
252+
cli.add_command(secretsmanager)
253+
cli.add_command(bedrock_cmd)
254+
cli.add_command(kms)
255+
cli.add_command(acm)
256+
cli.add_command(elasticache)
257+
cli.add_command(sns)
258+
cli.add_command(sqs)
259+
cli.add_command(ecs)
260+
cli.add_command(ssm)
235261

236262
if __name__ == '__main__':
237263
cli()

kosty/cli/acm_commands.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import click
2+
from .utils import common_options, execute_service_command
3+
4+
5+
@click.group()
6+
@click.pass_context
7+
def acm(ctx):
8+
"""ACM (Certificate Manager) operations"""
9+
pass
10+
11+
12+
@acm.command('audit')
13+
@click.option('--days', default=30, type=int, help='Days before expiration to flag (default: 30)')
14+
@common_options
15+
@click.pass_context
16+
def acm_audit(ctx, days, profile, organization, region, max_workers, regions, output, save_to, cross_account_role, org_admin_account_id):
17+
"""Run ACM audit"""
18+
from ..services.acm_audit import ACMAuditService
19+
execute_service_command(ctx, ACMAuditService, 'audit', output, organization, region, max_workers, regions, cross_account_role, org_admin_account_id, save_to, profile, days=days)
20+
21+
22+
@acm.command('check-expiring-certificates')
23+
@click.option('--days', default=30, type=int, help='Days before expiration to flag (default: 30)')
24+
@common_options
25+
@click.pass_context
26+
def acm_check_expiring(ctx, days, profile, organization, region, max_workers, regions, output, save_to, cross_account_role, org_admin_account_id):
27+
"""Find certificates expiring soon"""
28+
from ..services.acm_audit import ACMAuditService
29+
execute_service_command(ctx, ACMAuditService, 'check_expiring_certificates', output, organization, region, max_workers, regions, cross_account_role, org_admin_account_id, save_to, profile, days=days)

0 commit comments

Comments
 (0)