Safeguard
Security Guides•

What does GitLab IaC scanning check, and what are its limits?

GitLab IaC scanning uses KICS to check Terraform, Kubernetes, CloudFormation and more in CI. See supported formats, setup steps and known limits.

Safeguard Security Team
3 min read

GitLab infrastructure as code scanning checks definition files such as Terraform, Kubernetes manifests, CloudFormation and Dockerfiles for misconfigurations before they reach the default branch. It uses the KICS analyzer and runs as a CI job on every pipeline, so a missed file type is the main risk.

What it covers

The GitLab documentation lists these formats: Ansible, AWS CloudFormation, Dockerfile, Google Deployment Manager, Kubernetes and OpenAPI. Azure Resource Manager is supported for JSON only, and Bicep files must be converted with the Bicep CLI first.

Terraform has a nuance. KICS has resource queries for Alibaba Cloud, AWS, Azure, Databricks, GitHub, Google Cloud, Kubernetes, NIFCLOUD and Tencent Cloud. For other providers you get provider independent checks only.

Tier differences

Scanning itself is listed on Free, Premium and Ultimate. Merge request visibility, approval workflows, vulnerability report integration, result downloads and rule optimization need Ultimate. Offline configuration needs Premium or Ultimate on Self-Managed.

How to enable it

  1. Confirm you have the Maintainer or Owner role, a Linux runner with the Docker or Kubernetes executor, and at least 4 GB of RAM.
  2. Add the Jobs/SAST-IaC.gitlab-ci.yml template, or the iac-sast component, to your CI file.
  3. Validate the pipeline, commit and merge.
  4. Open the pipeline Security tab to see location, severity, scanner and identifiers.

If no supported files exist, the job completes with no findings. That is normal, but it means a green job is not proof that your Terraform was checked.

Limits to plan for

LimitConsequence
Rules can be disabled or overridden, not added or replacedCustom checks need another tool
Terraform modules from custom registries are not scannedModule internals may be unchecked
AMD64 only, no Windows runnersRunner choice is constrained
Findings can become "No longer detected" after rule updatesTrend charts need care
Exclusions use KICS comments, for some file typesSuppression is file specific

What IaC scanning cannot tell you

It reads files. It does not see what is actually deployed, so drift between code and the live cloud account is invisible to it. A scan of the repo and a check of the running environment answer different questions, and an audit may ask for both.

A simple review habit

Run the job on a branch that adds one deliberately weak setting, such as a storage bucket open to the public. Confirm the scanner flags it and the finding shows in the merge request. That one test tells you whether your pipeline wiring works.

Where a dedicated scanner fits

If you want IaC findings in the same queue as code and dependency issues, or want one policy to apply across hosts, a separate scanner can help. Safeguard offers policies, gates and guardrails plus a free scan at gold.safeguard.sh/scan.

Quick check

Does a passing IaC job mean my Terraform is safe?

No. It means the scanner found nothing in the files and rules it supports. Custom registry modules, unsupported providers and runtime drift are outside that check.

Can I add my own rules to GitLab IaC scanning?

The documentation says rules can be disabled or have attributes overridden, but cannot be added or replaced.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.