The hidden risks of Terraform providers

Terraform by HashiCorp is a leading tool for DevOps engineers and cloud architects. This powerful Infrastructure as Code (IaC) tool enables DevOps to define and provision cloud infrastructure using a high-level configuration language. At the heart of Terraform’s functionality are providers. Providers are essentially plugins that interact with the APIs of cloud services, allowing Terraform to manage a wide range of resources across different platforms.

This blog outlines the potential risks of Terraform providers.

Note: An earlier version of this post mistakenly referenced a module provided by Cloud Posse as a potential attack vector. We wish to clarify that Cloud Posse’s module is not a Provider and the module does not contain any known security vulnerabilities. Our use of it as an example was misguided, and we apologize for any confusion.

Understanding Terraform providers & their risks

Terraform providers streamline and automate cloud infrastructure management, allowing for quick deployment and easy integration of services from providers like AWS, Google Cloud and Azure. 

To install Terraform providers, the package of the provider is auto downloaded. Below is an example of a simple configuration block in a Terraform script that downloads the AWS provider for managing resources in the US West (Oregon) region:

				
					provider "aws" {
  region = "us-west-2"
}

				
			

As you can see, when Terraform initializes this configuration with the terraform init command, it automatically downloads the AWS provider plugin from the Terraform Registry.

The convenience of these plugins means DevOps is using them on a daily basis, often without properly vetting them for vulnerabilities or other weaknesses. While providers owned and maintained by HashiCorp and major cloud vendors generally follow strict security standards, community-maintained providers vary significantly in quality and security. HashiCorp themselves group providers into three tiers:

 
  • Official: Official providers are owned and maintained by HashiCorp.
  • Partner: Partner providers are owned and maintained by a technology company that has gone through a partner onboarding process and maintain a direct partnership with HashiCorp. Partner providers are actively supported by the publishing organization.
  • Community: Community providers are published and maintained by individual contributors.

Hashicorp’s official recommendation is to only use official and partner providers within your Terraform configuration. However, there are thousands of community providers in use, many with download numbers in the millions, that could expose an organization’s Terraform and CI/CD pipeline to security risks. Further, while community providers are the most risky, even trusted providers have known vulnerabilities and exploits.

By analyzing ten of the most popular official, partner and community providers, we see that all Terraform providers have the potential to introduce risk, but community providers are by far the most vulnerable.
The download numbers for some of the most widely-used community providers this month are alarming, in the millions.

As many well known and widely-used providers have known critical vulnerabilities, these can serve as an attack vector for threat actors with remote or physical access to the CI/CD. This can be achieved by gaining control of the code repositories, but this is quite difficult, as code repositories are usually pretty guarded. However, attackers can also gain access from outside of the repositories. For example, Terraform access can be accomplished where the state files are being stored in an S3 bucket, which is pretty common. Many times, state files are not as secure as they should be, but based on our experience, access rights are mostly read only for unauthorized users.

Malicious modules and providers

Threat actors can craft and publish malicious modules and providers, which can act as full-blown malware. Malicious modules can also be used to exploit known provider’s vulnerabilities. The malicious module inherits the permissions of the provider that runs it, which makes it important to understand and closely manage provider permissions.

Attackers can lure potential victims to use malicious modules or providers in several ways. Very similar to other marketplaces and third-party malicious apps, Terraform modules and providers can be published to where Terraform users frequently source them:

  • Terraform Registry: The attacker submits the module or provider to the official Terraform Registry, providing a detailed description and documentation.
  • GitHub Repository: The attacker creates a public GitHub Repository for the module or provider, ensuring it appears professional and trustworthy. They might include fake stars and forks.
 

Why is this important?

Attractive target: There are many ways threat actors can leverage CI/CD systems to take full control over your cloud environment and Terraform is one of the top crown jewels. DevOps and Platform teams will often leverage the great capabilities of providers and modules which are another potential “supply-chain” risk. Any malicious or vulnerable third party used by Terraform to deploy cloud assets can lead to a server impact even though the probability of such exploitation is low.

Major blind-spot: Providers are often not being vetted or scanned for vulnerabilities as part of the SDLC and Application Security flows. Commonly used IAC scanners are mainly focused on misconfigurations and do not cover vulnerability scans for those third parties.

Manual remediation: Remediation of third-party vulnerabilities was and still is a painful and manual process. DevOps team are already busy, focusing on fixing critical misconfigurations and adding more tickets to their workload doesn’t seem possible.

Best practices & mitigation

Due diligence: Before using a provider, do your homework. Look into the provider’s documentation, its source code (if available) and feedback from the community. This investigation can reveal a lot about the provider’s reliability and security posture.

Regular scanning of cloud repositories: To mitigate risks, it’s essential to regularly scan your cloud repositories. Use security tools like Trivy, to scan provider repositories and code for vulnerabilities.

Version pinning: To avoid unexpected updates that might introduce vulnerabilities, pin the version of your providers in your Terraform configurations.

				
					provider "aws" {
  version = "~> 3.27"
  region  = "us-west-2"
}
				
			

This code snippet ensures that Terraform uses only the specified version or patch updates within a minor version, helping to maintain consistency and security.

Auditing and monitoring: Regularly audit your Terraform plans and state files for any misconfigurations or unexpected changes. Tools like Terraform’s plan command or external security scanners can be invaluable here.

IaC security tools: Utilize Terraform-specific security tools, such as tfsec or checkov, to scan your configurations for potential security issues.

Conclusion

The power and convenience of Terraform providers are undeniable, but so are the security risks they pose if not properly managed. By understanding these risks and adopting a mindful approach to using providers, we can significantly mitigate potential threats to our cloud infrastructure.

As part of the broader Terraform and cloud security community, it’s also within our power to contribute towards safer practices. Reporting security issues, contributing to the development of providers, or even creating more secure alternatives, are all ways we can make a difference.

To learn more about how ZEST is helping organizations resolve cloud risks, reach out to our team.

Share the Post:

Related Resources

ZEST for Cloud Security Risk Resolution

How ZEST streamlines remediation and mitigation of cloud security risks…

7 RSAC 2025 Cloud Security Sessions You Don’t Want to Miss

Some of the brightest minds in the industry will discuss…

Understanding Preemptive Exposure Management and Why it Matters

Last week, Gartner® released a new emerging technology report on…

ZEST Platform Now Available in AWS Marketplace

We are excited to announce that ZEST Security’s Agentic-AI Risk…

How to go From Zero to a Well-Secured, Managed Cloud Security State

Building an effective cloud security risk management program can seem…

Google’s $32 Billion Wiz Buy Bolsters Its Cloud Security Capabilities, Experts Say

Google Cloud aims to harness Wiz’s expertise and Mandiant’s threat…

Aaron Brown Joins ZEST Security’s Advisory Board

Today we are excited to officially announce that Aaron Brown,…

$32 billion Google-Wiz deal bodes well for cloud security, experts say

Cloud industry leaders such as Snir Ben Shimol, co-founder and…

Building a Cloud Security Program That Actually Works

In this webinar, we discuss essential best practices and milestones…

Code to Cloud and Back: Closing the Remediation Loop

What is Code to Cloud? Everyone is in the cloud,…

The Future of Cloud Security and the Role of AI

With the visibility challenge largely addressed, what’s next? How will…

ZEST Security’s Cloud Risk Exposure Impact Report Reveals 62% of Incidents are Related to Risks Known to the Organization

ZEST Security, provider of an Agentic-AI Cloud Risk Resolution platform,…

4 Reasons Cloud Security Risk Management is Adopting an Incident Response Mentality

The high volume of alerts, combined with tedious and manual…

Stat of the week

Cybersecurity professionals have to always have one eye on the…

Cloud security report shows growing remediation gap amid increased risk awareness

Attackers now exploit vulnerabilities within an average of five days,…

Beyond CVSS: Why EPSS and KEV Are Game-Changers for Prioritizing Vulnerabilities

Publicly disclosed computer vulnerabilities are organized into a globally recognized…

Cloud risks rise due to slow remediation, costs USD $2m+

The study reports that organisations face an annual remediation cost…

Resilient Cyber Newsletter #33

ZEST’s Cloud Risk Exposure Impact Report provided a handful of…

Over 60 percent of enterprise cybersecurity incidents relate to known risks

“There is a direct correlation between delays in remediation and…

Survey Sees Organizations Being Overwhelmed by Remediation Challenges

Conducted by ZEST Security, the survey finds half of respondents…

The Cloud Security Paradox: Why We Keep Losing To Known Risks

Organizations have more visibility into cloud cybersecurity risks today than…

7 cloud security startups not named Wiz

Today, remediation processes today are extremely manual, time consuming and…

ZEST Security’s Cloud Risk Exposure Impact Report Reveals 62% of Incidents are Related to Risks Known to the Organization

Report uncovers direct link between remediation toil and rise in…

Cloud Risk Exposure Impact Report 2025

Industry-first report examining the relationship between remediation delays and…

How to Build an Efficient Risk Resolution Plan

From Visibility to Action  While security teams have the visibility…

ZEST Security’s Cloud Security Predictions for 2025

2025 is here and it’s time to talk predictions. Here…

The Role of AI, Consolidation, and More on Cloud Security

Today, CNAPP is a billion-dollar industry, providing security teams with…

6 Core Capabilities for Cloud Risk Resolution

This guide outlines the core capabilities to build an efficient…

A Conversation with Vladi Sandler: A World Beyond CNAPP

Discussing the journey that led to the widespread adoption of…

ZEST Expands its IaC Tool Support

The rapid adoption of DevOps tools has transformed how organizations…

Resolving your cloud risks with ZEST!