The check for Storage Account naming rules produced a false positive
* The check for Storage Account naming rules produced a false positive
re.match returns an object or None so we have to check if the object is not None
* Replace re.match with re.findall
@@ -21,7 +21,7 @@ class StorageAccountName(BaseResourceCheck):
:param conf: azurerm_storage_account configuration
:return: <CheckResult>
"""
- return CheckResult.PASSED if conf.get('name') and re.match(STO_NAME_REGEX, conf['name'][0]) else CheckResult.FAILED
+ return CheckResult.PASSED if conf.get('name') and re.findall(STO_NAME_REGEX, conf['name'][0]) else CheckResult.FAILED
check = StorageAccountName()
