Control: OSS buckets should have lifecycle policies
Description
Buckets should have a lifecycle policy associated for data retention.
Usage
Run the control in your terminal:
powerpipe control run alicloud_thrifty.control.oss_bucket_without_lifecycle_policy
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run alicloud_thrifty.control.oss_bucket_without_lifecycle_policy --share
Steampipe Tables
SQL
select arn as resource, case when lifecycle_rules is null then 'alarm' when lifecycle_rules @> '[{"Status":"Enabled"}]' then 'ok' else 'alarm' end as status, case when lifecycle_rules is null then title || ' has no lifecycle policy.' when lifecycle_rules @> '[{"Status":"Enabled"}]' then title || ' has lifecycle policy.' else title || ' has disabled lifecycle policy.' end as reason , account_id, regionfrom alicloud_oss_bucket;