Security Scanning
Security scanning is integrated into all our modules using Checkov and CIS benchmarks.
Checkov
Checkov is a static code analysis tool for infrastructure as code.
Frameworks
We scan against:
- CIS Azure Foundations Benchmark: For Azure modules
- CIS AWS Foundations Benchmark: For AWS modules
- CIS GCP Foundations Benchmark: For GCP modules
- Terraform: General Terraform best practices
Configuration
Each module includes a .checkov.yml configuration:
framework:
- terraform
- cis_azure # or cis_aws, cis_gcp
check:
- CKV_AZURE_* # Azure-specific checks
- CKV2_AZURE_* # Azure-specific checks (v2)
Running Locally
# Install Checkov
pip install checkov
# Run scan
checkov -d . --framework terraform --framework cis_azure
# Run in compact mode
checkov -d . --framework terraform --framework cis_azure --compact
CI/CD Integration
Checkov runs automatically on:
- Pull requests (informational mode)
- Main branch commits
- Release workflows
Addressing Findings
- Review findings: Check Checkov output for security issues
- Fix critical issues: Address high-severity findings immediately
- Document exceptions: Use Checkov skip comments for justified exceptions
- Re-run scan: Verify fixes before merging
Skip Comments
For justified exceptions:
# checkov:skip=CKV_AZURE_123:Reason for skipping
resource "azurerm_storage_account" "example" {
# ...
}
Best Practices
- Fix before merge: Address all critical findings
- Document exceptions: Always provide reasoning for skips
- Regular updates: Keep Checkov updated for latest checks
- Review regularly: Periodically review skipped checks