> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/monitoring/appsec-tf-1.md).

# Terraform module sources do not use a git url with a commit hash revision misconfiguration detected

## Rule Details

|                        |                                |
| ---------------------- | ------------------------------ |
| Cortex AppSec Rule ID  | APPSEC\_TF\_1                  |
| Category - Subcategory | Monitoring - Tags and metadata |
| Provider               | OTHER                          |
| Severity               | MEDIUM                         |
| Framework              | Terraform                      |

## Impact

Terraform modules are a collection of multiple resource configuration to offer an easy way of repeatable and reusable code logic. The most common way is to consume them through the public Terraform registry, which are connected to a VCS, like GitHub. This approach is problematic, because the module versions are not immutable and the module can be changed without changing the version, which makes the code vulnerable to a Supply Chain Attack. To mitigate this risk, it is recommended to use Git URLs with a commit hash revision to guarantee immutability and consistency. This is a more restrictive policy than <https://docs.prismacloud.io/en/enterprise-edition/policy-reference/supply-chain-policies/terraform-policies/ensure-terraform-module-sources-use-git-url-with-commit-hash-revision\\[Terraform> module sources do not use a git url with a tag or commit hash revision].

## How to Fix

Resource: module\*

* *Argument: source, condition*

## If you are using a remote module, use the Git URL with a commit hash. \[source,go]

module "vpc" {

* source = "terraform-aws-modules/vpc/aws"
* version = "5.0.0"
* source = "git::<https://github.com/terraform-aws-modules/terraform-aws-vpc.git?ref=26c38a66f12e7c6c93b6a2ba127ad68981a48671>" # commit hash of version 5.0.0

name = "my-vpc" cidr = "10.0.0.0/16"

azs = \["eu-west-1a", "eu-west-1b", "eu-west-1c"] private\_subnets = \["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] public\_subnets = \["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]

enable\_nat\_gateway = true enable\_vpn\_gateway = true

## tags = { Terraform = "true" Environment = "dev" } }


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/monitoring/appsec-tf-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
