Skip to content

Commit 9f1b9d3

Browse files
fix: update comment to clarify network_rule scope and public_network_access_enabled distinction
1 parent 57fa414 commit 9f1b9d3

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • assets/queries/terraform/azure/azure_elastic_san_public_access_enabled

assets/queries/terraform/azure/azure_elastic_san_public_access_enabled/query.rego

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ package Cx
33
import data.generic.common as common_lib
44
import data.generic.terraform as tf_lib
55

6-
# RULE 1: The 'network_rule' block is not defined.
7-
# In azurerm_elastic_san_volume_group, the absence of the block allows public access.
6+
# RULE 1: The 'network_rule' block is missing from an azurerm_elastic_san_volume_group.
7+
# network_rule defines a subnet whitelist; its absence means no subnet-level access
8+
# restriction is applied to the volume group.
9+
# Note: public_network_access_enabled is a separate attribute on azurerm_elastic_san
10+
# (the SAN resource itself) and is not present on azurerm_elastic_san_volume_group.
811
CxPolicy[result] {
912
doc := input.document[i]
1013
vg := doc.resource.azurerm_elastic_san_volume_group[name]
@@ -18,7 +21,7 @@ CxPolicy[result] {
1821
"searchKey": sprintf("azurerm_elastic_san_volume_group[%s]", [name]),
1922
"searchLine": common_lib.build_search_line(["resource", "azurerm_elastic_san_volume_group", name], []),
2023
"issueType": "MissingAttribute",
21-
"keyExpectedValue": sprintf("'azurerm_elastic_san_volume_group.%s' should have a 'network_rule' block to restrict public access", [name]),
22-
"keyActualValue": sprintf("'azurerm_elastic_san_volume_group.%s' is missing the 'network_rule' block", [name]),
24+
"keyExpectedValue": sprintf("'azurerm_elastic_san_volume_group.%s' should have a 'network_rule' block to restrict access to approved subnets only", [name]),
25+
"keyActualValue": sprintf("'azurerm_elastic_san_volume_group.%s' has no 'network_rule' block; no subnet-level access restriction is applied", [name]),
2326
}
2427
}

0 commit comments

Comments
 (0)