Allowing all Access Control List (ACL) permissions(rwdl for read, write, delete, and list) on an Azure storage file share grants overly broad access, increasing the risk of unauthorized access, data leakage, or malicious data manipulation. This misconfiguration could allow any user or process with the relevant access policy to not only read and list files, but also modify or delete important data, potentially leading to service disruption or data loss. To mitigate this risk, permissions should be set according to the principle of least privilege, For example, grant only r (read) permissions when read-only access is required, as shown below:
resource"azurerm_storage_table""table_resource2"{name="my_table_name"storage_account_name="mystoragexxx"acl{id="someid-1XXXXXXXXX"access_policy{expiry="2022-10-03T05:05:00.0000000Z"permissions="r"start="2021-05-28T04:05:00.0000000Z"}}}# The targeted share ("secure") is safely permissioned. An unrelated share
# is Terraform-labeled "file" - the same string split(url, ".")[1] would
# produce for a hardcoded share URL - and is over-permissioned. Must not
# be picked up as a false positive by the file/name-collision.
resource"azurerm_storage_share""secure"{name="securesharename"storage_account_name="mystoragexxx"quota=50acl{id="MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI"access_policy{permissions="r"start="2022-07-02T09:38:21.0000000Z"expiry="2021-07-02T10:38:21.0000000Z"}}}resource"azurerm_storage_share""file"{name="unrelatedsharename"storage_account_name="mystoragexxx"quota=50acl{id="MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI"access_policy{permissions="rwdl"start="2022-07-02T09:38:21.0000000Z"expiry="2021-07-02T10:38:21.0000000Z"}}}resource"azurerm_storage_share_file""secure"{name="safe-content.zip"storage_share_id="https://acct.file.core.windows.net/secure"source="some-local-file.zip"}
# Declared in a separate file from azurerm_storage_share.crossfile
# (positive3.tf) - must still be flagged, since the reference is only
# local to the module, not to this file.
resource"azurerm_storage_share_file""crossfile"{name="cross-file-content.zip"storage_share_id=azurerm_storage_share.crossfile.idsource="some-local-file.zip"}
1
2
rulesets:- Terraform / Azure # Rules to enforce / Azure.
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.