CDK Insights Static Analysis
CDK Insights performs comprehensive static analysis of your CDK stacks, identifying security vulnerabilities, cost optimizations, and best practice violations.
How Static Analysis Works
CDK Insights analyzes your CDK application by:
- Running
cdk synthto generate CloudFormation templates - Parsing the CloudFormation output to understand your infrastructure
- Applying a comprehensive set of rules to identify issues
- Generating detailed reports with actionable recommendations
This approach ensures that we analyze exactly what AWS will deploy, not just your CDK code, giving you the most accurate results.
What Gets Analyzed
Security
Identifies security vulnerabilities and misconfigurations
Cost Optimization
Finds opportunities to reduce AWS costs
Best Practices
Enforces AWS and CDK best practices
Rule Sources
CDK Insights Rules
Custom rules specifically designed for CDK patterns and best practices
CDK Nag Rules
Integration with the popular CDK Nag security analysis tool
CDK Mixin Awareness
CDK Insights understands CDK Mixins โ the composable property-mutating API that ships with aws-cdk-lib >= ~2.230. We read the aws:cdk:analytics:mixin manifest stream that aws-cdk-lib writes for every .with() / Mixins.of(scope).apply(...) call, so each finding tells you which mixins (if any) touched the resource and any remediation we suggest accounts for them re-applying at synth.
On top of attribution, two template-level rules detect the specific footguns mixins introduce:
Compliance-Critical Mixin Applied Without Stack Coverage
Fires when a compliance-critical mixin (e.g. BucketEncryption, BucketVersioning, BucketBlockPublicAccess) is applied to some but not all resources of its target type. This is the template-visible signature of Mixins.of(scope).apply(...) silently skipping resources outside its selector. Recommends switching to requireAll() so synth fails when the mixin can't be applied.
Custom Mixin Applied Across Many Resource Types
Fires when a user-defined mixin appears on resources spanning 3+ distinct CFN types in the same stack โ the template-visible signature of .with(customMixin) recursing through every descendant because the mixin's supports() filter accepts every construct. Verify your mixin narrows to the intended type.
See the dedicated CDK Mixins page for the full picture, or our note on Aspects vs Mixins.
Supported AWS Services
CDK Insights analyzes resources across 35 AWS services, with targeted checks for each:
Understanding Severity Levels
Critical
Immediate security or compliance issues that should be fixed immediately
High
Security or configuration issues that should be addressed soon
Medium
Best practice violations or potential optimization opportunities
Low
Minor issues or suggestions for improvement
Example Analysis Output
Here's what a typical static analysis output looks like:
Ready to Run Your First Analysis?
Start with static analysis to identify security and configuration issues in your CDK stacks.