cdk-insights
Version:
AWS CDK security and cost analysis tool with AI-powered insights
427 lines (303 loc) ⢠11.7 kB
Markdown
# CDK Insights š
> **AI-Powered Analysis Tool for AWS CDK Stacks**
CDK Insights helps you identify security vulnerabilities, cost optimization opportunities, and best practice issues in your AWS CDK infrastructure. It combines static analysis with AI-powered recommendations to provide actionable insights for improving your cloud infrastructure.
> **š§ Currently in Beta** - We're actively developing and improving CDK Insights. The current version is stable for testing and early adoption, but we recommend using it in development environments first.
## ⨠What CDK Insights Does
- **š Static Analysis**: Automatically checks your CDK code for 20+ AWS services
- **š¤ AI-Powered Insights**: Gets intelligent recommendations using AWS Bedrock (Pro subscription)
- **š Multiple Output Formats**: View results as JSON, Markdown, Table, or Summary
- **š§ Easy to Use**: Simple CLI with interactive prompts
- **āļø Configurable**: Save your preferences and customize what gets analyzed
- **š GitHub Integration**: Create issues directly from findings
- **š”ļø Security Focus**: Comprehensive security checks and recommendations
- **š° Cost Optimization**: Find opportunities to reduce AWS costs
## š Get Started in 30 Seconds
### Try It Now (No Installation Required)
```bash
# Run immediately without installing anything
npx cdk-insights scan
```
That's it! CDK Insights will:
1. Scan your CDK stacks
2. Show you issues it found
3. Provide recommendations to fix them
### Install for Regular Use
**For Teams (Recommended):**
```bash
# Install in your project
npm install --save-dev cdk-insights
# Add to your package.json scripts
```
```json
{
"scripts": {
"cdk-insights": "node scripts/cdk-insights-wrapper.js"
}
}
```
**Using NPM Scripts (Recommended):**
After installing, you can use convenient npm scripts:
```bash
# Basic scan
npm run scan
# Scan all stacks
npm run scan:all
# Different output formats
npm run scan:json
npm run scan:markdown
npm run scan:summary
# Setup CDK Nag integration
npm run cdk-insights -- setup-cdk-nag
# Install Git pre-commit hooks
npm run cdk-insights -- hook
# Cache management
npm run cdk-insights -- cache-status
npm run cdk-insights -- cache:clear
# Configuration
npm run cdk-insights -- config list
```
**For Personal Use:**
```bash
# Install globally
npm install -g cdk-insights
# Use from anywhere
cdk-insights scan
```
## š How to Use CDK Insights
### Basic Commands
```bash
# Scan a specific stack
cdk-insights scan MyStack
# Scan all stacks in your project
cdk-insights scan --all
# Interactive mode (recommended for first time)
cdk-insights scan
```
### What You'll See
```
š Analyzing stack: MyStack
š Found 12 issues across 8 resources
š“ CRITICAL (2)
⢠IAM policy allows full access to all resources
⢠S3 bucket allows public ACLs
š” MEDIUM (7)
⢠Lambda function has high memory allocation
⢠DynamoDB table has no auto-scaling enabled
š¢ LOW (3)
⢠S3 bucket does not use Intelligent-Tiering
ā
Analysis complete.
```
### Output Formats
Choose how you want to see your results:
```bash
# Table format (default) - great for quick review
cdk-insights scan --output table
# Markdown format - perfect for GitHub issues and PRs
cdk-insights scan --output markdown
# JSON format - ideal for CI/CD pipelines
cdk-insights scan --output json
# Summary format - just the essentials
cdk-insights scan --output summary
```
## š What Gets Scanned
CDK Insights checks your infrastructure across these AWS services:
| Service | What It Checks | Focus Areas |
| ------------------- | ---------------------- | ------------------------------ |
| **IAM** | Policy permissions | Security, Least privilege |
| **S3** | Bucket settings | Security, Cost optimization |
| **Lambda** | Function configuration | Performance, Security |
| **DynamoDB** | Table settings | Cost optimization, Performance |
| **RDS** | Database configuration | Security, Cost optimization |
| **EC2** | Instance settings | Cost optimization, Security |
| **API Gateway** | Endpoint security | Security |
| **CloudTrail** | Logging setup | Security, Compliance |
| **KMS** | Key policies | Security |
| **SNS/SQS** | Message security | Security |
| **Step Functions** | Workflow configuration | Security, Performance |
| **EventBridge** | Rule configuration | Security, Performance |
| **Secrets Manager** | Secret configuration | Security |
| **EBS** | Volume management | Cost optimization |
## šÆ Common Use Cases
### Security Audits
```bash
# Focus on security issues
cdk-insights scan --services IAM,S3,KMS,SecretsManager
```
### Cost Optimization
```bash
# Find cost savings opportunities
cdk-insights scan --services EC2,DynamoDB,RDS,EBS
```
### Before Deployments
```bash
# Full scan before going to production
cdk-insights scan --all --output markdown
```
### In Your CI/CD Pipeline
```bash
# Automated checks in your deployment process
cdk-insights scan --output json | jq '.summary.totalIssues'
```
## āļø Configuration
Set your preferences once and CDK Insights will remember them:
```bash
# Set your preferred output format
cdk-insights config set output markdown
# Set default services to scan
cdk-insights config set services IAM,S3,Lambda
# View your current settings
cdk-insights config list
# Clear your settings
cdk-insights config reset
```
## š¤ AI-Powered Analysis (Pro Feature)
Upgrade to Pro for intelligent, context-aware recommendations:
- **Smart Suggestions**: AI understands your specific infrastructure
- **Custom Fixes**: Get code examples tailored to your setup
- **Pattern Recognition**: AI spots complex architectural issues
- **Natural Language**: Clear explanations of what's wrong and how to fix it
[Learn more about AI features ā](docs/ai-features.md)
## š° Pricing & Plans
CDK Insights offers three flexible tiers to meet your needs:
### š Free Tier
**Perfect for getting started and small projects**
**Price**: $0/month
**Core Features**:
- ā
Basic static scanning (5 scans/month)
- ā
Multi-stack scanning (10 stacks/month)
- ā
Table, JSON, and Markdown output formats
- ā
CLI tool access
- ā
Local scanning
- ā
Community support
- ā
Basic security checks
- ā
Basic reporting
**Limits**:
- 5 basic scans per month
- 10 multi-stack scans per month
- 1 team member
- 5 project fingerprints
---
### š Pro Tier
**Ideal for development teams and growing projects**
**Price**: $29/month
**Everything in Free, plus**:
- ā
**Unlimited** basic and multi-stack scanning
- ā
AI-powered recommendations (100/month)
- ā
Contextual fix suggestions (100/month)
- ā
Smart prioritization
- ā
Natural language explanations
- ā
Custom rule creation (50 rules)
- ā
Advanced compliance frameworks
- ā
PDF reports (20/month)
- ā
GitHub integration (100 integrations/month)
- ā
Team dashboards
- ā
Shared configurations (10 configs)
- ā
Cloud-based scanning
- ā
Parallel scanning
- ā
Caching & incremental scanning
- ā
Large project support (1000+ resources)
- ā
Email support
- ā
SOC2 & HIPAA compliance
- ā
Advanced analytics
**Limits**:
- 100 AI recommendations per month
- 100 contextual fixes per month
- 50 custom rules
- 20 PDF reports per month
- 100 GitHub integrations per month
- 10 shared configurations
- 5 team members
- 10 project fingerprints
---
### š¢ Enterprise Tier
**For large organizations with advanced requirements**
**Price**: Contact sales
**Everything in Pro, plus**:
- ā
**Unlimited** AI recommendations and contextual fixes
- ā
Historical trend scanning
- ā
Dependency mapping
- ā
Custom AI training
- ā
Executive summaries
- ā
Custom branded reports
- ā
Role-based access control
- ā
Collaborative commenting
- ā
Team analytics
- ā
API access (10,000 calls/month)
- ā
Webhook notifications
- ā
CI/CD integration
- ā
Custom integrations
- ā
Advanced filtering & search
- ā
Priority support
- ā
Dedicated account manager
- ā
Custom training
- ā
FedRAMP compliance
- ā
Custom compliance frameworks
- ā
Audit trails
- ā
SSO integration
- ā
Custom dashboards
- ā
White-labeling
- ā
Custom branding
- ā
Multi-tenant support
**Limits**:
- 10,000 API calls per month
- Unlimited team members
- Unlimited project fingerprints
- Unlimited custom rules
- Unlimited PDF reports
---
### š Upgrade Path
**Free ā Pro**: Unlock AI-powered insights and team features
**Pro ā Enterprise**: Get enterprise-grade features and unlimited usage
### š³ Billing & Support
- **Free Tier**: No credit card required
- **Pro Tier**: Monthly billing, cancel anytime
- **Enterprise**: Annual billing with volume discounts
- **Support**: Email support for Pro+, priority support for Enterprise
### šÆ Choose Your Plan
| Feature Category | Free | Pro | Enterprise |
| ----------------- | --------- | ---------- | ---------- |
| **Scanning** | 5/month | Unlimited | Unlimited |
| **AI Features** | ā | 100/month | Unlimited |
| **Team Features** | 1 user | 5 users | Unlimited |
| **Integrations** | Basic | GitHub | All |
| **Support** | Community | Email | Priority |
| **Compliance** | Basic | SOC2/HIPAA | FedRAMP |
[Get Started Free ā](https://cdkinsights.dev/signup) | [View Pro Plan ā](https://cdkinsights.dev/pricing) | [Contact Sales ā](https://cdkinsights.dev/enterprise)
For detailed pricing information, see our [complete pricing guide](docs/pricing.md).
## š GitHub Integration
Create GitHub issues directly from your findings:
```bash
# Create issues for all findings
cdk-insights scan --with-issue
# Create issues for critical findings only
cdk-insights scan --with-issue --rule-filter Security
```
## š Understanding Your Results
### Severity Levels
- **š“ CRITICAL**: Security vulnerabilities or major issues that need immediate attention
- **š” MEDIUM**: Issues that should be addressed soon for better security/cost
- **š¢ LOW**: Minor optimizations and best practice recommendations
### Issue Types
- **Security**: IAM policies, encryption, access controls
- **Cost Optimization**: Resource sizing, unused resources, better pricing models
- **Performance**: Configuration that could impact speed or efficiency
- **Compliance**: Best practices and industry standards
## š ļø Troubleshooting
### Common Issues
**"No stacks found"**
- Make sure you're in a CDK project directory
- Run `cdk synth` first to generate CloudFormation templates
**"Permission denied"**
- Ensure you have read access to your CDK project files
- Check that your AWS credentials are configured
**"Scan is slow"**
- Use `--services` to limit what gets scanned
- Try `--output summary` for faster results
### Getting Help
- **Documentation**: [docs/](docs/)
- **Issues**: [GitHub Issues](https://github.com/TheLeePriest/cdk-insights/issues)
- **Discussions**: [GitHub Discussions](https://github.com/TheLeePriest/cdk-insights/discussions)
## š License
CDK Insights is licensed under the MIT License. Some functionality integrates with cdk-nag, which is licensed under Apache License 2.0.
---
**Ready to improve your CDK infrastructure?** Start with `npx cdk-insights scan` and discover what insights await! š