Loading...
Loading...
Run tfsec (now part of Trivy) to scan Terraform code for security misconfigurations. Deep HCL analysis with support for Terraform modules, variables, and expressions.
npx skill4agent add vchirrav/owasp-secure-coding-md iac-scan-tfsecbrew install tfsecgo install github.com/aquasecurity/tfsec/cmd/tfsec@latesttrivy config --format json .tfsec --versiontfsec <terraform-dir> --format json > tfsec-results.jsontfsec . --minimum-severity HIGH --format jsontfsec . --exclude aws-s3-enable-versioning --format jsontfsec . --include-passed --format jsontrivy config --format json --severity HIGH,CRITICAL <terraform-dir>| # | Severity | Rule ID | Resource | File:Line | Description | Resolution |
|---|----------|---------|----------|-----------|-------------|------------|| Provider | Common Rules |
|---|---|
| AWS | S3 encryption, Security group rules, RDS encryption, CloudTrail logging |
| Azure | Storage encryption, NSG rules, Key Vault settings |
| GCP | IAM bindings, GKE settings, Cloud SQL encryption |
| General | Sensitive variables, hardcoded secrets in HCL |