BlogsGitLabTerraform Security and Supply Chain

Terraform Security and Supply Chain

Terraform Security and Supply Chain

6
posts
2019–2022

GitLab is enhancing its Infrastructure as Code (IaC) security capabilities by integrating with tools like Indeni Cloudrail. This integration shifts security checks left in the GitOps workflow, automating infrastructure compliance and reducing false positives. The goal is to prevent insecure infrastructure from being deployed by evaluating IaC for security impacts early in the development lifecycle, thereby accelerating delivery without compromising security. This post details the integration of GitLab's SSCS framework, which includes controls for Source, Build, Consumption, Management Process, and Tool Security, to provide a secure, end-to-end software supply chain. Near-term projects include enhancements to GitLab Runner Core.

2022

Terraform in the software supply chain: Modules & providers

6/1/2022

This post details the security mechanisms for Terraform providers, including the use of SHA256 hashes (zh) for zip files and dirhashes (h1) for provider directories, as recorded in the `.terraform.lock.hcl` file. It explains how these hashes are generated and how attackers could potentially exploit the lock file by adding malicious hashes. For modules, it highlights the vulnerability of mutable Git tags and recommends using specific commit SHAs as a more secure alternative. It also references existing work on malicious Terraform modules and static detection rules.

Fantastic Infrastructure as Code security attacks and how to find them

2/17/2022

This post introduces and details specific security risks in Infrastructure as Code (IaC) management tools, particularly Terraform. It provides a practical example of an S3 bucket vulnerability and demonstrates how to detect it using multiple IaC security scanning tools (tfsec, kics, checkov, terrascan, semgrep, tflint). The post also covers parsing scan reports with `jq` and integrating these scanners into CI/CD pipelines and merge requests. It further suggests using resources like Terragoat for developing and testing IaC security scenarios.

Introducing GitLab’s supply chain security direction and landscape

2/15/2022

This post introduces GitLab's Software Supply Chain Security (SSCS) direction and framework, outlining five key aspects: Source, Build, Consumption, Management Process, and Tool Security. It emphasizes the benefits of a single application for SSCS, such as minimizing tools, reducing failure points, enabling seamless interoperability, and simplifying visibility. The post also mentions near-term projects like GitLab Runner Core and highlights the integration with existing capabilities and potential partnerships.

2021

How to get GitOps right with infrastructure as code security

6/10/2021

This post details the integration of Indeni Cloudrail with GitLab CI/CD to automate IaC security checks within the GitOps workflow. It highlights how this integration shifts security left, provides context-based analysis to reduce false positives, and enables developers to remediate security risks instantly, thus accelerating delivery.

2019

GitLab and HashiCorp streamline delivery workflows

9/17/2019

This post introduces the integration of HashiCorp Terraform and Terraform Cloud with GitLab CI/CD. It outlines how Terraform's infrastructure as code capabilities can be used within GitLab's CI/CD pipelines for automated infrastructure provisioning. It also mentions future iterations involving integration with HashiCorp Vault for secrets management.

Build enterprise-grade IaC pipelines with GitLab DevSecOps

7/1/2019

This post details a comprehensive DevSecOps workflow for enterprise-grade IaC pipelines using GitLab. It showcases the integration of OpenTofu for provisioning AWS infrastructure and Ansible for deploying a Tomcat web server. Key technical contributions include: building and storing custom Ansible execution environments in the GitLab Container Registry, utilizing GitLab's security scanning for IaC and container vulnerabilities, integrating Ansible linting with GitLab's Code Quality, storing application binaries in the Generic Package Repository, and leveraging CI/CD environment variables. It also demonstrates the use of GitLab's OpenTofu components, Terraform state management, module registry, and OpenID Connect integration with AWS for secure cloud access.