CKV_GCP_44 - check file update (GENERAL_SECURITY)
@@ -2,6 +2,7 @@ from checkov.terraform.checks.resource.base_resource_check import BaseResourceCh
from checkov.common.models.enums import CheckResult, CheckCategories
NINETY_DAYS = {'d': 90, 'h': 2160, 'm': 129600, 's': 7776000}
+ONE_DAY = {'d': 1, 'h': 24, 'm': 1440, 's': 86400}
class GoogleKMSKeyRotationPeriod(BaseResourceCheck):
def __init__(self):
@@ -15,7 +16,7 @@ class GoogleKMSKeyRotationPeriod(BaseResourceCheck):
if 'rotation_period' in conf.keys():
time_unit = conf['rotation_period'][0][-1]
time = int(conf['rotation_period'][0][:-1])
- if time <= NINETY_DAYS[time_unit]:
+ if ONE_DAY[time_unit] <= time <= NINETY_DAYS[time_unit]:
return CheckResult.PASSED
return CheckResult.FAILED
