Control: Container registries retention policy should be enabled
Description
Ensure container registry retention policy is enabled. This control is non-compliant if retention policy is disabled.
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.container_registry_retention_policy_enabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.container_registry_retention_policy_enabled --share
SQL
This control uses a named query:
select distinct a.name as resource, case when policies -> 'retentionPolicy' ->> 'status' = 'enabled' then 'ok' else 'alarm' end as status, case when policies -> 'retentionPolicy' ->> 'status' = 'enabled' then a.name || ' retention policy enabled.' else a.name || ' retention policy disabled.' end as reason , a.resource_group as resource_group , sub.display_name as subscriptionfrom azure_container_registry as a, azure_subscription as subwhere sub.subscription_id = a.subscription_id;