turbot/steampipe-mod-azure-compliance

Control: Soft delete for blobs should be enabled

Description

Enable soft delete for blobs to protect against accidental or malicious deletion of blob data.

Usage

Run the control in your terminal:

powerpipe control run azure_compliance.control.storage_account_blob_soft_delete_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run azure_compliance.control.storage_account_blob_soft_delete_enabled --share

SQL

This control uses a named query:

select
sa.id as resource,
case
when blob_soft_delete_enabled and blob_soft_delete_retention_days between 7 and 365 then 'ok'
else 'alarm'
end as status,
case
when not blob_soft_delete_enabled then name || ' blob soft delete disabled.'
when blob_soft_delete_retention_days < 7 or blob_soft_delete_retention_days > 365
then name || ' blob soft delete retention days (' || blob_soft_delete_retention_days || ') not between 7 and 365.'
else name || ' blob soft delete enabled with ' || blob_soft_delete_retention_days || ' days retention.'
end as reason
, sa.resource_group as resource_group
, sub.display_name as subscription
from
azure_storage_account sa,
azure_subscription sub
where
sub.subscription_id = sa.subscription_id;

Tags