Control: Backup recovery points should not expire before retention period
Description
Ensure a recovery point expires no earlier than after the specified period. The rule is non-compliant if the recovery point has a retention point less than 35 days.
Usage
Run the control in your terminal:
powerpipe control run aws_compliance.control.backup_recovery_point_min_retention_35_days
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run aws_compliance.control.backup_recovery_point_min_retention_35_days --share
SQL
This control uses a named query:
select recovery_point_arn as resource, case when (lifecycle -> 'DeleteAfterDays') is null then 'ok' when (lifecycle -> 'DeleteAfterDays')::int >= 35 then 'ok' else 'alarm' end as status, case when (lifecycle -> 'DeleteAfterDays') is null then split_part(recovery_point_arn, ':', -1) || ' retention period set to never expire.' else split_part(recovery_point_arn, ':', -1) || ' recovery point has a retention period of ' || (lifecycle -> 'DeleteAfterDays')::int || ' days.' end as reason , region, account_idfrom aws_backup_recovery_point;