Features
Security analysis
Crust’s security analysis feature uses OpenAI to analyze your Terraform infrastructure for potential security issues. This guide explains how to use and interpret the security analysis results.
Running Security Analysis
To run security analysis:
This command will:
- Run your Terraform plan
- Use OpenAI to analyze security issues
- Present findings with colorized output
Output Format
The security analysis output uses XML tags for colorization:
Available Tags
<red>
: Critical security issues<yellow>
: Security warnings<green>
: Security recommendations<bold>
: Important text<italic>
: Additional context
Example Output
Common Security Issues
Crust looks for common security issues in your Terraform infrastructure:
-
Public Access
- Publicly accessible S3 buckets
- Open security groups
- Publicly exposed services
-
Encryption
- Missing encryption for EBS volumes
- Unencrypted S3 buckets
- Missing KMS keys
-
IAM
- Overly permissive IAM policies
- Missing MFA
- Hardcoded credentials
-
Networking
- Open ports
- Missing VPC flow logs
- Insecure network configurations
Best Practices
- Run security analysis early: Check for security issues before applying changes
- Review all findings: Don’t ignore warnings or recommendations
- Fix critical issues first: Address critical security issues immediately
- Document exceptions: If you can’t fix an issue, document why
- Regular checks: Run security analysis regularly, not just before deployments
Integration with CI/CD
You can integrate security analysis into your CI/CD pipeline:
Troubleshooting
If you encounter issues with security analysis:
- Check OpenAI API key: Make sure your API key is valid
- Verify Terraform plan: Ensure the plan command works correctly
- Check language setting: Make sure your language is supported
- Review error messages: Look for specific error messages in the output
Types of Security Issues Detected
Crust can detect various types of security issues, including:
1. Access Control Issues
- Overly permissive IAM policies
- Publicly accessible resources
- Missing encryption
2. Network Security Issues
- Open security groups
- Exposed ports
- Missing network segmentation
3. Data Security Issues
- Unencrypted storage
- Missing backup policies
- Sensitive data exposure
4. Compliance Issues
- Missing tags
- Non-compliant resource configurations
- Regulatory violations
Usage
Basic Usage
Best Practices
- Run security analysis early: Include security analysis in your development workflow
- Review all findings: Pay special attention to high-severity issues
- Use in CI/CD: Integrate security analysis into your CI/CD pipeline
- Regular checks: Run security analysis regularly, not just before deployments