implementing-infrastructure-as-code-security-scanning

Detect misconfigurations in Terraform, CloudFormation, and Kubernetes manifests using Checkov, tfsec, and KICS.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill implementing-infrastructure-as-code-security-scanning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-infrastructure-as-code-security-scanning
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/devsecops/implementing-infrastructure-as-code-security-scanning
Command: npx skills add https://github.com/xalgord/xalgorix --skill implementing-infrastructure-as-code-security-scanning

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires checkov, tfsec, kics.

What problem does it solve?

Insecure cloud resources get provisioned when Infrastructure as Code templates ship with misconfigurations like public S3 buckets, open security groups, or unencrypted storage. This Skill automates security scanning of IaC templates before deployment and gates CI/CD pipelines so insecure changes cannot merge.

Core Features & Use Cases

  • Multi-tool IaC Scanning: Run Checkov, tfsec, and KICS against Terraform, Terraform plan JSON, CloudFormation, Kubernetes manifests, and Helm charts.
  • CI/CD Gating: Integrate scans into GitHub Actions with SARIF upload and soft_fail disabled so HIGH findings block pull request merges.
  • Custom Policies & Baselines: Author custom Checkov checks in Python and manage suppressions through a .checkov.yaml baseline configuration.
  • Use Case: A team repeatedly creates S3 buckets without access controls. Add Checkov to the pipeline enforcing CKV_AWS_18/19/20, require an aws_s3_bucket_public_access_block resource via a custom policy, and verify the gate blocks a deliberately insecure test PR.

Quick Start

Scan the terraform directory with Checkov and add a GitHub Actions workflow that fails the build on any HIGH severity IaC finding.

Frequently Asked Questions about implementing-infrastructure-as-code-security-scanning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan Terraform for security misconfigurations?

Run Checkov against your Terraform directory with checkov -d ./terraform/ --framework terraform, or use tfsec for HCL-focused analysis. For higher accuracy, scan the resolved plan JSON produced by terraform show -json tfplan so computed values and module expansions are included.

Checkov vs tfsec vs KICS for IaC scanning?

Checkov offers 2500+ policies across many frameworks including Terraform, CloudFormation, Kubernetes, and Helm, plus graph-based relationship checks. tfsec focuses deeply on Terraform HCL, while KICS supports 15+ IaC frameworks. Running multiple scanners in parallel improves coverage.

How do I block pull requests with IaC security findings?

Set soft_fail: false on the Checkov or tfsec GitHub Actions step so the scanner exits non-zero on failed checks and blocks the merge. Upload SARIF results with if: always() for reporting, but the gate comes from the failing scan job itself.

Why does my IaC scan pass even with insecure resources?

Common causes include soft_fail mode forcing exit code 0, scanning .tf source instead of the plan JSON so modules are skipped, over-broad skip-check suppressions, and graph checks (CKV2_ prefix) not running. Verify by adding a deliberately public S3 bucket and confirming the build fails.

Can Checkov scan Kubernetes manifests and Helm charts?

Yes, Checkov scans Kubernetes manifests with --framework kubernetes and renders Helm charts before scanning with --framework helm. KICS is an alternative that supports Kubernetes via its Docker image with --type Kubernetes.

When should I not use IaC security scanning?

Do not use IaC scanning for application source code analysis (use SAST), for monitoring already-deployed infrastructure drift (use cloud security posture management), or for container image vulnerability scanning (use Trivy). It targets pre-deployment template misconfigurations only.