diff --git a/pkg/policies/opa/rego/gcp/google_kms_crypto_key/checkRotation365Days.rego b/pkg/policies/opa/rego/gcp/google_kms_crypto_key/checkRotation365Days.rego index e8d6961fb..ad9defb52 100755 --- a/pkg/policies/opa/rego/gcp/google_kms_crypto_key/checkRotation365Days.rego +++ b/pkg/policies/opa/rego/gcp/google_kms_crypto_key/checkRotation365Days.rego @@ -1,6 +1,6 @@ package accurics -checkRotation365Days[kms.id] { - kms := input.google_kms_crypto_key[_] - kms.config.rotation_period <= "31536000s" -} +checkRotation365Days[crypto_key.id]{ + crypto_key := input.google_kms_crypto_key[_] + to_number(trim(crypto_key.config.rotation_period, "s")) > 31536000 +} \ No newline at end of file diff --git a/pkg/policies/opa/rego/gcp/google_kms_crypto_key/checkRotation90Days.rego b/pkg/policies/opa/rego/gcp/google_kms_crypto_key/checkRotation90Days.rego index 9f6c82c9a..5cc29fb6b 100755 --- a/pkg/policies/opa/rego/gcp/google_kms_crypto_key/checkRotation90Days.rego +++ b/pkg/policies/opa/rego/gcp/google_kms_crypto_key/checkRotation90Days.rego @@ -1,7 +1,6 @@ package accurics -checkRotation90Days[api.id] -{ - api := input.google_kms_crypto_key[_] - api.config.rotation_period <= "7776000s" +checkRotation90Days[crypto_key.id]{ + crypto_key := input.google_kms_crypto_key[_] + to_number(trim(crypto_key.config.rotation_period, "s")) > 7776000 } \ No newline at end of file