Text of docs.gitlab.com › user › application_security › iac_scanning as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Infrastructure as Code scanning | GitLab Docs

/ Infrastructure as Code scanning Tier : Free, Premium, Ultimate Offering : GitLab.com, GitLab Self-Managed, GitLab Dedicated Infrastructure as Code (IaC) scanning runs in your CI/CD pipeline, checking your infrastructure definition files for known vulnerabilities. Identify vulnerabilities before they’re committed to the default branch to proactively address the risk to your application. The IaC scanning analyzer outputs JSON-formatted reports as job artifacts .

With GitLab Ultimate, IaC scanning results are also processed so you can: See them in merge requests. Use them in approval workflows. Review them in the vulnerability report. Getting started If you are new to IaC scanning, follow these steps to enable it for your project. Prerequisites: The Maintainer or Owner role for the project. Minimum of 4 GB RAM to ensure consistent performance. Linux-based GitLab Runner with either the Docker or Kubernetes executor.

If you’re using hosted runners for GitLab.com, the Docker or Kubernetes executor is enabled by default. GitLab Runner on Windows is not supported. CPU architectures other than AMD64 are not supported. GitLab CI/CD configuration ( .gitlab-ci.yml ) must include the test stage. The test stage is included by default, but if you redefine stages, you must explicitly add it. To enable IaC scanning: In the top bar, select Search or go to and find your project.

Go to Build > Pipeline editor. Add either the IaC scanning CI/CD template or component. To use the template, add the following lines: yaml include : - template : Jobs/SAST-IaC.gitlab-ci.yml To use the CI/CD component, add the following lines: yaml include : - component : gitlab.com/components/sast/iac-sast@main Select the Validate tab, then select Validate pipeline . The message Simulation completed successfully confirms the file is valid.

Select the Edit tab. Complete the fields: Commit message. Branch. For example, add-iac . Select the Start a new merge request with these changes checkbox, then select Commit changes . The merge request page opens. Complete the fields according to your standard workflow, then select Create merge request . Review and edit the merge request according to your standard workflow, then select Merge . At this point, IaC scanning is enabled in your pipeline: The IaC scanning job runs on every pipeline and executes the KICS analyzer.

The analyzer determines whether the project contains supported IaC files. If supported files are found, the analyzer scans for vulnerabilities. If no supported files are found, the job completes with no findings. The corresponding job appears under the test stage in your pipeline. You can see a working example in IaC scanning example project . Next steps After you enable IaC scanning, you can: Learn more about how to understand the results Review optimization tips Plan a rollout to more projects Understanding the results Prerequisites: The Security Manager, Developer, Maintainer, or Owner role for the project.

You can review vulnerabilities in a pipeline: In the top bar, select Search or go to and find your project. In the left sidebar, select Build > Pipelines . Select the pipeline. Select the Security tab. Select a vulnerability to view its details, including: Description: Explains the cause of the vulnerability, its potential impact, and recommended remediation steps. Status: Indicates whether the vulnerability has been triaged or resolved.

Severity: Learn more about severity levels . Location: Shows the filename and line number where the issue was found. Selecting the file path opens the corresponding line in the code view. Scanner: Identifies which analyzer detected the vulnerability. Identifiers: A list of references used to classify the vulnerability, such as CWE identifiers and the IDs of the rules that detected it. In Ultimate, you can also download the security scan results: Prerequisites: The Security Manager, Developer, Maintainer, or Owner role for the project.

In the top bar, select Search or go to and find your project. In the left sidebar, select Build > Pipelines . Select the pipeline. Select the Security tab. In the pipeline’s Security tab, select Download results . For more details, see Pipeline security report . Findings are generated on feature branches. When they are merged into the default branch, they become vulnerabilities. This distinction is important when evaluating your security posture.

Additional ways to see IaC scanning results: Merge request reports : Shows newly introduced or resolved findings. Merge request changes view : Shows inline annotations for changed lines. Vulnerability report : Shows confirmed vulnerabilities on the default branch. Supported languages and frameworks IaC scanning supports a variety of IaC configuration files. When any supported configuration files are detected in a project, they are scanned by using KICS .

Projects with a mix of IaC configuration files are supported. Supported configuration formats: Ansible AWS CloudFormation Azure Resource Manager IaC scanning can analyze Azure Resource Manager templates in JSON format. If you write templates in Bicep , you must use the Bicep CLI to convert your Bicep files into JSON before IaC scanning can analyze them. Dockerfile Google Deployment Manager Kubernetes OpenAPI Terraform KICS reports findings only for resource types it has queries for.

KICS has Terraform queries for these providers: Alibaba Cloud AWS Azure Databricks GitHub Google Cloud Kubernetes NIFCLOUD Tencent Cloud KICS also has provider-independent checks. For other providers, these checks are the only ones that apply. For more information, see KICS platforms . Terraform modules in a custom registry are not scanned for vulnerabilities. For more information about the proposed feature, see issue 357004 .

Optimize IaC scanning Tier : Ultimate Offering : GitLab.com, GitLab Self-Managed, GitLab Dedicated You can optimize IaC scanning to reduce noise and focus on relevant findings: Disable specific rules by using a sast-ruleset.toml file. Override rule attributes (like severity) by using a sast-ruleset.toml file. Disable scanning of specific files by using KICS annotations in those files. IaC scanning does not support adding or replacing rules.

For the options each analyzer supports, see rule customization options . Use a sast-ruleset.toml file to disable rules or override rule attributes. This approach provides the following: Integration with GitLab vulnerability management to automatically resolve existing findings when rules are disabled. Version-controlled documentation of your security policy decisions. The option to share rulesets across multiple projects when you roll out IaC scanning.

Ruleset definition Every IaC scanning rule is contained in a ruleset section, which contains the following: A type field for the rule. For IaC scanning, the identifier type is kics_id . A value field for the rule identifier. KICS rule identifiers are alphanumeric strings. To find the rule identifier: Find it in the JSON report artifact . Search for the rule name in the list of KICS queries and copy the alphanumeric identifier that’s shown.

The rule name is shown on the vulnerability details page when a rule violation is detected. Disable rules You can disable specific IaC scanning rules. Findings previously detected by disabled rules are automatically resolved . Prerequisites: The Maintainer or Owner role for the project. To disable analyzer rules: Create a .gitlab directory at the root of your project, if one doesn’t already exist. Create a custom ruleset file named sast-ruleset.toml in the .gitlab directory, if one doesn’t already exist.

Set the disabled flag to true in the context of a ruleset section. In one or more ruleset subsections, list the rules to disable. After you merge the sast-ruleset.toml file to the default branch, existing findings for disabled rules are automatically resolved . In the following example sast-ruleset.toml file, the disabled rules are assigned

The rest of this page is on the live site.