Cybersecurity Blind Spots in IaC and PaC Tools Expose Cloud Platforms to New Attacks

Share:

Cybersecurity researchers have disclosed two new attack techniques against infrastructure-as-code (IaC) and policy-as-code (PaC) tools like HashiCorp’s Terraform and Styra’s Open Policy Agent (OPA) that leverage dedicated, domain-specific languages (DSLs) to breach cloud platforms and exfiltrate data.

“Since these are hardened languages with limited capabilities, they’re supposed to be more secure than standard programming languages – and indeed they are,” Tenable senior security researcher Shelly Raban said in a technical report published last week. “However, more secure does not mean bulletproof.”

OPA is a popular, open-source policy engine that allows organizations to enforce policies across cloud-native environments, such as microservices, CI/CD pipelines, and Kubernetes. Policies are defined using a native query language called Rego which are then evaluated by OPA to return a decision.

The attack method devised by Tenable targets the supply chain, wherein an attacker gains unauthorized access through a compromised access key to insert a malicious Rego policy to an OPA server, which is subsequently used during the policy decision phase to allow malicious actions like credential exfiltration using a built-in function known as “http.send.”

Even in instances where an OPA deployment restricts the use of http.send, the cybersecurity firm found that it’s possible to utilize another function named “net.lookup_ip_addr” to smuggle the data using DNS lookups via a technique referred to as DNS tunneling.

“So, the net.lookup_ip_addr function is another function you might consider restricting or at least looking out for in policies, since it also introduces the risk of data exfiltration from your OPA deployment,” Raban said.

Terraform, similar to OPA, aims to simplify the process of setting up, deploying, and managing cloud resources through code-based definitions. These configurations can be set up using another declarative DSL called HashiCorp Configuration Language (HCL).

An attacker could target the open-source IaC platform by taking advantage of its “terraform plan” command, which are typically triggered as part of GitHub “pull_request” workflows, to execute unreviewed changes containing a malicious data source during the CI/CD process.

“Data sources run during ‘terraform plan,’ which significantly lowers the entry point for attackers,” Tenable noted. “This poses a risk, as an external attacker in a public repository or a malicious insider (or an external attacker with a foothold) in a private repository could exploit a pull request for their malicious objectives.”

These data sources, in turn, could be a rogue external data source, a Terraform module shared via public or private registries, or a DNS data source, necessitating that only third-party components from trusted sources be used. Some of the other recommendations to mitigate such risks include –

  • Implement a granular role-based access control (RBAC) and follow the principle of least privilege
  • Set up application-level and cloud-level logging for monitoring and analysis
  • Limit the network and data access of the applications and the underlying machines
  • Prevent automatic execution of unreviewed and potentially malicious code in CI/CD pipelines

Furthermore, organizations can use IaC scanning tools and solutions like Terrascan and Checkov to preemptively identify misconfigurations and compliance issues prior to deployment.

Ravie Lakshmanan

Leave a Comment

Your email address will not be published. Required fields are marked *

loader-image
London, GB
6:04 am, Jun 30, 2025
weather icon 18°C
L: 17° | H: 19°
broken clouds
Humidity: 83 %
Pressure: 1020 mb
Wind: 10 mph E
Wind Gust: 0 mph
UV Index: 0
Precipitation: 0 mm
Clouds: 66%
Rain Chance: 0%
Visibility: 10 km
Sunrise: 4:46 am
Sunset: 9:21 pm
DailyHourly
Daily ForecastHourly Forecast
Today 10:00 pm
weather icon
17° | 19°°C 0 mm 0% 9 mph 83 % 1020 mb 0 mm/h
Tomorrow 10:00 pm
weather icon
22° | 33°°C 0 mm 0% 10 mph 68 % 1016 mb 0 mm/h
Wed Jul 02 10:00 pm
weather icon
16° | 23°°C 0.65 mm 65% 10 mph 82 % 1021 mb 0 mm/h
Thu Jul 03 10:00 pm
weather icon
14° | 24°°C 0 mm 0% 10 mph 84 % 1026 mb 0 mm/h
Fri Jul 04 10:00 pm
weather icon
15° | 25°°C 0 mm 0% 13 mph 57 % 1027 mb 0 mm/h
Today 7:00 am
weather icon
18° | 19°°C 0 mm 0% 4 mph 83 % 1020 mb 0 mm/h
Today 10:00 am
weather icon
21° | 25°°C 0 mm 0% 6 mph 74 % 1020 mb 0 mm/h
Today 1:00 pm
weather icon
26° | 30°°C 0 mm 0% 7 mph 49 % 1018 mb 0 mm/h
Today 4:00 pm
weather icon
30° | 30°°C 0 mm 0% 9 mph 26 % 1015 mb 0 mm/h
Today 7:00 pm
weather icon
29° | 29°°C 0 mm 0% 9 mph 31 % 1014 mb 0 mm/h
Today 10:00 pm
weather icon
27° | 27°°C 0 mm 0% 2 mph 42 % 1014 mb 0 mm/h
Tomorrow 1:00 am
weather icon
24° | 24°°C 0 mm 0% 4 mph 56 % 1015 mb 0 mm/h
Tomorrow 4:00 am
weather icon
22° | 22°°C 0 mm 0% 4 mph 68 % 1015 mb 0 mm/h
Name Price24H (%)
Bitcoin(BTC)
€92,438.72
1.03%
Ethereum(ETH)
€2,130.50
2.80%
Tether(USDT)
€0.85
-0.01%
XRP(XRP)
€1.87
0.33%
Solana(SOL)
€129.06
1.02%
USDC(USDC)
€0.85
0.00%
Dogecoin(DOGE)
€0.142414
2.46%
Shiba Inu(SHIB)
€0.000010
0.42%
Pepe(PEPE)
€0.000009
5.52%
Scroll to Top