From f7350ba2b40d88b7a26533153d34f18c0f9034f4 Mon Sep 17 00:00:00 2001 From: Jakob Rieck Date: Mon, 8 Jan 2024 17:09:32 +0100 Subject: [PATCH] Fixes 'Key Vault Not Recoverable' check ScoutSuite previously did not flag key vaults for which the API returned enable_soft_delete = null. Such key vaults have neither soft-delete nor purge protecton enabled and are also not recoverable. The check would only flag key vaults for which enable_soft_delete = false. --- ScoutSuite/providers/azure/resources/keyvault/vaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScoutSuite/providers/azure/resources/keyvault/vaults.py b/ScoutSuite/providers/azure/resources/keyvault/vaults.py index 4d5005898..e4be072ca 100755 --- a/ScoutSuite/providers/azure/resources/keyvault/vaults.py +++ b/ScoutSuite/providers/azure/resources/keyvault/vaults.py @@ -30,7 +30,7 @@ def _parse_key_vault(self, raw_vault): vault['resource_group_name'] = get_resource_group_name(raw_vault.id) vault['properties'] = raw_vault.properties vault[ - 'recovery_protection_enabled'] = raw_vault.properties.enable_soft_delete and \ + 'recovery_protection_enabled'] = bool(raw_vault.properties.enable_soft_delete) and \ bool(raw_vault.properties.enable_purge_protection) vault['public_access_allowed'] = self._is_public_access_allowed(raw_vault) vault['rbac_authorization_enabled'] = raw_vault.properties.enable_rbac_authorization