Panther medium experimental python
AWS ACM Certificate Expiration
When a certificate is 60 days away from expiration, ACM automatically attempts to renew it every hour.
Detection Logic
import datetime
from panther_base_helpers import resolve_timestamp_string
AWS_TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
EXPIRATION_BUFFER = datetime.timedelta(days=60)
def policy(resource):
if not resource.get("NotAfter"):
return False
timestamp = resolve_timestamp_string(resource.get("NotAfter"))
if not timestamp:
return True
time_to_expiration = timestamp - datetime.datetime.now()
return time_to_expiration >= EXPIRATION_BUFFER Field Validations
Loading…
Comments (0)
Loading comments...