Skip to content

Commit 34ce9fb

Browse files
committed
fix: Update to point to the resource
1 parent 5729f59 commit 34ce9fb

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

ql/lib/codeql/hcl/security/PublicStorage.qll

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AzurePublicStorage extends PublicStorage {
1414
storage_container.getContainerAccessType() = "blob" and
1515
storage_container.getProperty("publicAccess").(StringLiteral).getValue() = "blob"
1616
and
17-
this = storage_container.getProperty("publicAccess")
17+
this = storage_container
1818
)
1919
or
2020
// Azure Storage Accounts
@@ -23,13 +23,18 @@ class AzurePublicStorage extends PublicStorage {
2323
// v2
2424
storage_acount.getAllowBlobPublicAccessValue() = true and
2525
this = storage_acount.getAllowBlobPublicAccess()
26-
) or
26+
)
27+
or
28+
(
29+
// v3
2730
(
28-
// v3
31+
storage_acount.getPublicNetworkAccessValue() = true
32+
or
2933
storage_acount.getAllowNestedItemsToBePublicValue() = true
30-
and
31-
this = storage_acount.getAllowNestedItemsToBePublic()
3234
)
35+
and
36+
this = storage_acount
37+
)
3338
)
3439
}
3540

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| storage.tf:13:22:13:27 | blob | Azure Storage is Public |
2-
| storage.tf:26:37:26:40 | true | Azure Storage is Public |
1+
| storage.tf:9:1:15:1 | resource azurerm_storage_container insecure-storage-container | Azure Storage is Public |
2+
| storage.tf:18:1:28:1 | resource azurerm_storage_account insecure-storage-account | Azure Storage is Public |

0 commit comments

Comments
 (0)