False positive for CKV_AZURE_43: check storage account name
See original GitHub issueI’m building my Storage Account names like this
name = "${local.saname_prefix}diagnostics${module.tf-var-project.random_id}
With https://github.com/bridgecrewio/checkov/pull/429 merged I now get a Check failure on the SA name:
Check: CKV_AZURE_43: "Ensure the Storage Account naming rules"
FAILED for resource: azurerm_storage_account.diagnostics
File: /az_diag_sa.tf:8-22
8 | resource "azurerm_storage_account" "diagnostics" {
9 | #checkov:skip=CKV_AZURE_35:Public access is allowed
10 | name = "${local.saname_prefix}diagnostics${module.tf-var-project.random_id}"
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Resolve errors for storage account names - Azure
An invalid storage account name causes an error code during deployment. The following are some examples of errors for storage account names.
Read more >Manage Azure storage accounts - Ansible Documentation
To check whether it is installed, run ansible-galaxy collection list . ... If set to false, no containers in this account will be...
Read more >Checking if a blob exists in Azure Storage - Stack Overflow
- I just want to find out if a blob (with a name I've defined) exists in a particular container. I'll be downloading...
Read more >Azurerm_storage_account incorrectly flags log configuration
A diagnostic setting for a storage account which would log ... tweak the functioning of this check because it is a false positive...
Read more >azure-native.storage.StorageAccount - Pulumi
StorageAccount resource with examples, input properties, output properties, ... { accountName: "sto4445", enableHttpsTrafficOnly: false, enableNfsV3: true, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can confirm the same behavior with the false positive. I have the following variable for name which ensures the same regex validation
however when passing it in as follows, CKV_AZURE_43 is raised
though hardcoding it to something that passes the regex satisfies the condition.
It is likely validating the literal
var.name
instead of a potential variable and as such becausevar.name
the literal has a.
it will fail to satisfy the regex and raise the error. Ideally the check would have to evaluate variables (and determine what do if no default exists) and see if they satisfy the constraint, however that may be a bit much to ask.i can replicate this one @metahertz ill show u test code tomox