mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-24 20:34:16 +00:00
fix(kms): handle if describe_keys returns no value
This commit is contained in:
1 parent
f88613b26d
commit
c01ff74c73
1 file changed
+9
-2
@@ -76,7 +76,12 @@ class KMS:
|
||||
logger.info("KMS - Get Key Rotation Status...")
|
||||
try:
|
||||
for key in self.keys:
|
||||
if "EXTERNAL" not in key.origin and "AWS" not in key.manager:
|
||||
if (
|
||||
key.origin
|
||||
and key.manager
|
||||
and "EXTERNAL" not in key.origin
|
||||
and "AWS" not in key.manager
|
||||
):
|
||||
regional_client = self.regional_clients[key.region]
|
||||
key.rotation_enabled = regional_client.get_key_rotation_status(
|
||||
KeyId=key.id
|
||||
@@ -90,7 +95,9 @@ class KMS:
|
||||
logger.info("KMS - Get Key Policy...")
|
||||
try:
|
||||
for key in self.keys:
|
||||
if key.manager == "CUSTOMER": # only customer KMS have policies
|
||||
if (
|
||||
key.manager and key.manager == "CUSTOMER"
|
||||
): # only customer KMS have policies
|
||||
regional_client = self.regional_clients[key.region]
|
||||
key.policy = json.loads(
|
||||
regional_client.get_key_policy(
|
||||
|
||||
Reference in new issue
Block a user