CircleCI Integration (Example)
As is standard for CircleCI, you can easily define IaC analysis as a step in your pipelines by specifying it in your .circleci/config.yml
file.
Below is a minimal example of a config.yml
for reference.
Terraform (CircleCI)
CircleCI config.yml example
yaml
1version: 22jobs:3build:4docker:5# Here we use Hashicorp's Alpine image with terraform already installed6- image: hashicorp/terraform:light78steps:9- checkout10- run:11name: InsightCloudSec IaC Security Scan12command: |13# Generate JSON-formatted Terraform plan14terraform init15terraform plan -out tf.plan16terraform show -json tf.plan > tf.plan.json17cd ..1819# Use the mimics Docker image20docker run -v $(pwd):/data -e MIMICS_BASE_URL=$ICS_BASE_URL -e MIMICS_API_KEY=$ICS_API_KEY public.ecr.aws/rapid7-insightcloudsec/ics/mimics:latest scan data/tf.plan.json -c "My IaC Config Name" --report-formats all --report-path "/data/reports" --no-progress2122# Store results. CircleCI caches this for 30 days.23- store_artifacts:24path: /tmp/scan_output.html2526
Did this page help you?