Skip to content

Instantly share code, notes, and snippets.

@danifitz
Created October 5, 2022 09:20
Show Gist options
  • Save danifitz/3288d24e8d7446e3d722bc8c4eb1d024 to your computer and use it in GitHub Desktop.
Save danifitz/3288d24e8d7446e3d722bc8c4eb1d024 to your computer and use it in GitHub Desktop.
---
queryId: Custom_AWS_Config_ACM_ExpiringCertificate
queryText: |-
{
source {
LW_CFG_AWS_ACM_DESCRIBE_CERTIFICATE
}
filter {
RESOURCE_CONFIG:Certificate.Status NOT IN ('EXPIRED') and
DIFF_DAYS(current_timestamp_sec()::timestamp, RESOURCE_CONFIG:Certificate.NotAfter::timestamp) <= 20
}
return distinct {
ACCOUNT_ALIAS,
ACCOUNT_ID,
ARN as RESOURCE_KEY,
RESOURCE_REGION,
RESOURCE_TYPE,
SERVICE,
'CertificateExpiringIn20DaysOrLess' as COMPLIANCE_FAILURE_REASON
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment